mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
change raho lcd color & spi cs
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
|
||||
#include "devices.h"
|
||||
|
||||
#include "../../../drivers/spi/rk2818_spim.h"
|
||||
|
||||
/* --------------------------------------------------------------------
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>rk2818_gpioBank<6E><6B><EFBFBD>飬<EFBFBD><E9A3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>GPIO<49>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>ID<49>ͼĴ<CDBC><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>
|
||||
@@ -388,6 +389,25 @@ static struct i2c_board_info __initdata board_i2c3_devices[] = {
|
||||
|
||||
};
|
||||
|
||||
static void spi_xpt2046_cs_control(u32 command)
|
||||
{
|
||||
if(command == 3)
|
||||
{
|
||||
//printk("spi_xpt2046_cs_control cs \n");
|
||||
gpio_direction_output(RK2818_PIN_PF5, GPIO_LOW);
|
||||
}
|
||||
if(command == 0)
|
||||
{
|
||||
//printk("spi_xpt2046_cs_control decs \n");
|
||||
gpio_direction_output(RK2818_PIN_PF5, GPIO_HIGH);
|
||||
}
|
||||
}
|
||||
|
||||
struct rk2818_spi_chip spi_xpt2046_info = {
|
||||
.cs_control = spi_xpt2046_cs_control,
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************************
|
||||
* SPI devices
|
||||
*author: lhh
|
||||
@@ -414,10 +434,11 @@ static struct spi_board_info board_spi_devices[] = {
|
||||
#if defined(CONFIG_TOUCHSCREEN_XPT2046_320X480_SPI) || defined(CONFIG_TOUCHSCREEN_XPT2046_320X480_CBN_SPI)
|
||||
{
|
||||
.modalias = "xpt2046_ts",
|
||||
.chip_select = 0,
|
||||
.chip_select = 2,
|
||||
.max_speed_hz = 125 * 1000 * 26,/* (max sample rate @ 3V) * (cmd + data + overhead) */
|
||||
.bus_num = 0,
|
||||
.irq = RK2818_PIN_PE1,
|
||||
.controller_data = &spi_xpt2046_info,
|
||||
.irq = RK2818_PIN_PE1,
|
||||
},
|
||||
#endif
|
||||
|
||||
@@ -557,6 +578,13 @@ static void __init machine_rk2818_board_init(void)
|
||||
rk2818_mux_api_set(GPIOB4_SPI0CS0_MMC0D4_NAME,IOMUXA_GPIO0_B4); //IOMUXA_SPI0_CSN0);//use for gpio SPI CS0
|
||||
rk2818_mux_api_set(GPIOB0_SPI0CSN1_MMC1PCA_NAME,IOMUXA_GPIO0_B0); //IOMUXA_SPI0_CSN1);//use for gpio SPI CS1
|
||||
rk2818_mux_api_set(GPIOB_SPI0_MMC0_NAME,IOMUXA_SPI0);//use for SPI CLK SDI SDO
|
||||
|
||||
rk2818_mux_api_set(GPIOF5_APWM3_DPWM3_NAME,IOMUXB_GPIO1_B5);
|
||||
if(0 != gpio_request(RK2818_PIN_PF5, NULL))
|
||||
{
|
||||
gpio_free(RK2818_PIN_PF5);
|
||||
printk(">>>>>> RK2818_PIN_PF5 gpio_request err \n ");
|
||||
}
|
||||
}
|
||||
|
||||
static void __init machine_rk2818_mapio(void)
|
||||
|
||||
@@ -428,6 +428,17 @@ static void dma_transfer(struct rk2818_spi *dws, struct spi_transfer *xfer) //in
|
||||
|
||||
}
|
||||
|
||||
static void spi_chip_sel(struct rk2818_spi *dws, u16 cs)
|
||||
{
|
||||
if(cs >= dws->master->num_chipselect)
|
||||
return;
|
||||
|
||||
if (dws->cs_control){
|
||||
dws->cs_control(cs+1);
|
||||
}
|
||||
//rk2818_writel(dws, SPIM_SER, 1 << cs);
|
||||
}
|
||||
|
||||
static void pump_transfers(unsigned long data)
|
||||
{
|
||||
struct rk2818_spi *dws = (struct rk2818_spi *)data;
|
||||
@@ -644,7 +655,8 @@ static void pump_messages(struct work_struct *work)
|
||||
struct spi_transfer,
|
||||
transfer_list);
|
||||
dws->cur_chip = spi_get_ctldata(dws->cur_msg->spi);
|
||||
|
||||
dws->prev_chip = NULL; //ÿ<><C3BF>pump messageʱǿ<CAB1>Ƹ<EFBFBD><C6B8><EFBFBD>cs dxj
|
||||
|
||||
/* Mark as busy and launch transfers */
|
||||
tasklet_schedule(&dws->pump_transfers);
|
||||
|
||||
@@ -953,7 +965,11 @@ static int __init rk2818_spim_probe(struct platform_device *pdev)
|
||||
}
|
||||
master->mode_bits = SPI_CPOL | SPI_CPHA;
|
||||
master->bus_num = pdev->id;
|
||||
master->num_chipselect = 2;
|
||||
#if defined(CONFIG_MACH_RAHO)
|
||||
master->num_chipselect = 3; //raho <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ֧<D2AA><D6A7>3<EFBFBD><33>Ƭѡ dxj
|
||||
#else
|
||||
master->num_chipselect = 2;
|
||||
#endif
|
||||
master->cleanup = rk2818_spi_cleanup;
|
||||
master->setup = rk2818_spi_setup;
|
||||
master->transfer = rk2818_spi_transfer;
|
||||
|
||||
@@ -178,20 +178,6 @@ static inline void spi_set_clk(struct rk2818_spi *dws, u16 div)
|
||||
rk2818_writel(dws, SPIM_BAUDR, div);
|
||||
}
|
||||
|
||||
static inline void spi_chip_sel(struct rk2818_spi *dws, u16 cs)
|
||||
{
|
||||
if (cs > 1)
|
||||
return;
|
||||
|
||||
if (dws->cs_control){
|
||||
if(cs == 1)
|
||||
dws->cs_control(2);
|
||||
else
|
||||
dws->cs_control(1);
|
||||
}
|
||||
rk2818_writel(dws, SPIM_SER, 1 << cs);
|
||||
}
|
||||
|
||||
/* Disable IRQ bits */
|
||||
static inline void spi_mask_intr(struct rk2818_spi *dws, u32 mask)
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
/* Other */
|
||||
#define DCLK_POL 0
|
||||
#define SWAP_RB 1
|
||||
#define SWAP_RB 0
|
||||
|
||||
int init(void);
|
||||
int standby(u8 enable);
|
||||
|
||||
Reference in New Issue
Block a user