mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
补充提交iomux接口的添加
This commit is contained in:
@@ -554,11 +554,13 @@ void lcd_set_iomux(u8 enable)
|
||||
else
|
||||
{
|
||||
gpio_free(RK2818_PIN_PA4);
|
||||
rk2818_mux_api_set(CXGPIO_HSADC_SEL_NAME, 1);
|
||||
//rk2818_mux_api_set(CXGPIO_HSADC_SEL_NAME, 1);
|
||||
rk2818_mux_api_mode_resume(CXGPIO_HSADC_SEL_NAME);
|
||||
|
||||
gpio_free(RK2818_PIN_PE7);
|
||||
gpio_free(RK2818_PIN_PE6);
|
||||
rk2818_mux_api_set(GPIOE_U1IR_I2C1_NAME, 2);
|
||||
//rk2818_mux_api_set(GPIOE_U1IR_I2C1_NAME, 2);
|
||||
rk2818_mux_api_mode_resume(GPIOE_U1IR_I2C1_NAME);
|
||||
}
|
||||
return ;
|
||||
pin_err:
|
||||
|
||||
@@ -560,11 +560,13 @@ void lcd_set_iomux(u8 enable)
|
||||
else
|
||||
{
|
||||
gpio_free(RK2818_PIN_PA4);
|
||||
rk2818_mux_api_set(CXGPIO_HSADC_SEL_NAME, 1);
|
||||
//rk2818_mux_api_set(CXGPIO_HSADC_SEL_NAME, 1);
|
||||
rk2818_mux_api_mode_resume(CXGPIO_HSADC_SEL_NAME);
|
||||
|
||||
gpio_free(RK2818_PIN_PE7);
|
||||
gpio_free(RK2818_PIN_PE6);
|
||||
rk2818_mux_api_set(GPIOE_U1IR_I2C1_NAME, 2);
|
||||
//rk2818_mux_api_set(GPIOE_U1IR_I2C1_NAME, 2);
|
||||
rk2818_mux_api_mode_resume(GPIOE_U1IR_I2C1_NAME);
|
||||
}
|
||||
return ;
|
||||
pin_err:
|
||||
|
||||
@@ -393,12 +393,10 @@ 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);
|
||||
}
|
||||
}
|
||||
@@ -584,11 +582,13 @@ void lcd_set_iomux(u8 enable)
|
||||
else
|
||||
{
|
||||
gpio_free(RK2818_PIN_PH6);
|
||||
rk2818_mux_api_set(GPIOH6_IQ_SEL_NAME, 1);
|
||||
//rk2818_mux_api_set(GPIOH6_IQ_SEL_NAME, 1);
|
||||
rk2818_mux_api_mode_resume(GPIOH6_IQ_SEL_NAME);
|
||||
|
||||
gpio_free(RK2818_PIN_PE4);
|
||||
gpio_free(RK2818_PIN_PE5);
|
||||
rk2818_mux_api_set(GPIOE_I2C0_SEL_NAME, 0);
|
||||
//rk2818_mux_api_set(GPIOE_I2C0_SEL_NAME, 0);
|
||||
rk2818_mux_api_mode_resume(GPIOE_I2C0_SEL_NAME);
|
||||
}
|
||||
return ;
|
||||
pin_err:
|
||||
|
||||
@@ -207,6 +207,7 @@
|
||||
.interleave = interl, \
|
||||
.mux_reg = RK2818_IOMUX_##reg##_CON, \
|
||||
.mode = mux_mode, \
|
||||
.premode = mux_mode, \
|
||||
.flags = bflags, \
|
||||
},
|
||||
|
||||
@@ -214,6 +215,7 @@ struct mux_config {
|
||||
char *name;
|
||||
const unsigned int offset;
|
||||
unsigned int mode;
|
||||
unsigned int premode;
|
||||
const unsigned int mux_reg;
|
||||
const unsigned int interleave;
|
||||
unsigned int flags;
|
||||
@@ -221,7 +223,7 @@ struct mux_config {
|
||||
|
||||
extern int rk2818_iomux_init(void);
|
||||
extern void rk2818_mux_api_set(char *name, unsigned int mode);
|
||||
extern unsigned int rk2818_mux_api_get(char *name);
|
||||
extern void rk2818_mux_api_mode_resume(char *name);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -788,7 +788,6 @@ static int rk2818_nand_probe(struct platform_device *pdev)
|
||||
int err = 0;
|
||||
pNANDC pRK28NC;
|
||||
u_char maf_id,dev_id,ext_id3,ext_id4;
|
||||
u32 iomux_mode0,iomux_mode1,iomux_mode2,iomux_mode3,iomux_mode4;
|
||||
struct nand_chip *chip;
|
||||
|
||||
#ifdef CONFIG_MTD_PARTITIONS
|
||||
@@ -884,12 +883,6 @@ static int rk2818_nand_probe(struct platform_device *pdev)
|
||||
this->options |= NAND_BUSWIDTH_16;
|
||||
this->ecc.layout = &nand_hw_eccoob_16;
|
||||
}
|
||||
//<2F><><EFBFBD><EFBFBD>IO MUXԭʼֵ
|
||||
iomux_mode0=rk2818_mux_api_get(GPIOA5_FLASHCS1_SEL_NAME);
|
||||
iomux_mode1=rk2818_mux_api_get(GPIOA6_FLASHCS2_SEL_NAME);
|
||||
iomux_mode2=rk2818_mux_api_get(GPIOA7_FLASHCS3_SEL_NAME);
|
||||
iomux_mode3=rk2818_mux_api_get(GPIOE_SPI1_FLASH_SEL1_NAME);
|
||||
iomux_mode4=rk2818_mux_api_get(GPIOE_SPI1_FLASH_SEL_NAME);
|
||||
// iomux flash cs1~cs7
|
||||
rk2818_mux_api_set(GPIOA5_FLASHCS1_SEL_NAME, IOMUXB_FLASH_CS1);
|
||||
rk2818_mux_api_set(GPIOA6_FLASHCS2_SEL_NAME, IOMUXB_FLASH_CS2);
|
||||
@@ -911,16 +904,16 @@ static int rk2818_nand_probe(struct platform_device *pdev)
|
||||
switch(chip->numchips)
|
||||
{
|
||||
case 1:
|
||||
rk2818_mux_api_set(GPIOA5_FLASHCS1_SEL_NAME, iomux_mode0);
|
||||
rk2818_mux_api_mode_resume(GPIOA5_FLASHCS1_SEL_NAME);
|
||||
case 2:
|
||||
rk2818_mux_api_set(GPIOA6_FLASHCS2_SEL_NAME, iomux_mode1);
|
||||
rk2818_mux_api_mode_resume(GPIOA6_FLASHCS2_SEL_NAME);
|
||||
case 3:
|
||||
rk2818_mux_api_set(GPIOA7_FLASHCS3_SEL_NAME, iomux_mode2);
|
||||
rk2818_mux_api_mode_resume(GPIOA7_FLASHCS3_SEL_NAME);
|
||||
case 4:
|
||||
rk2818_mux_api_set(GPIOE_SPI1_FLASH_SEL1_NAME, iomux_mode3);
|
||||
rk2818_mux_api_mode_resume(GPIOE_SPI1_FLASH_SEL1_NAME);
|
||||
case 5:
|
||||
case 6:
|
||||
rk2818_mux_api_set(GPIOE_SPI1_FLASH_SEL_NAME, iomux_mode4);
|
||||
rk2818_mux_api_mode_resume(GPIOE_SPI1_FLASH_SEL_NAME);
|
||||
case 7:
|
||||
case 8:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user