在信息机中添加了扩展IO的全局配置,修改init的加载方式,采用subsys_initcall的方式
author宋秀杰 <sxj@rock-chips.com>
Wed, 18 Aug 2010 03:15:37 +0000 (20:15 -0700)
committer宋秀杰 <sxj@rock-chips.com>
Wed, 18 Aug 2010 03:18:08 +0000 (20:18 -0700)
arch/arm/configs/rk2818_info_defconfig
drivers/gpio/tca6424.c

index 848f138e8a1e24ac7ac7c261ff1fa88658d3d9ca..39d70141f7bef1645913727b14d4a79ca5cce359 100644 (file)
@@ -862,8 +862,11 @@ CONFIG_GPIOLIB=y
 # AC97 GPIO expanders:
 #
 # CONFIG_GPIO_PCA9554 is not set
-CONFIG_EXPANDED_GPIO_NUM=0
-CONFIG_EXPANDED_GPIO_IRQ_NUM=0
+CONFIG_IOEXTEND_TCA6424=y
+CONFIG_EXPANDED_GPIO_NUM=24
+CONFIG_EXPANDED_GPIO_IRQ_NUM=24
+CONFIG_SPI_FPGA_GPIO_NUM=0
+CONFIG_SPI_FPGA_GPIO_IRQ_NUM=0
 # CONFIG_W1 is not set
 CONFIG_POWER_SUPPLY=y
 # CONFIG_POWER_SUPPLY_DEBUG is not set
index ec7010708aa2b46ea07b1bdc3948bec930700d52..ba7d185076da24ad0ac04fd7994154631133f2be 100755 (executable)
@@ -836,10 +836,10 @@ int tca6424_init_pintype(struct tca6424_chip *chip,struct i2c_client *client)
 }
 void tca6424_reset_itr(void)
 {
+               rk2818_mux_api_set(GPIOE_U1IR_I2C1_NAME, IOMUXA_GPIO1_A67);
                gpio_request(RK2818_PIN_PE6,NULL);
                gpio_request(RK2818_PIN_PE7,NULL);
 
-               rk2818_mux_api_set(GPIOE_U1IR_I2C1_NAME, IOMUXA_GPIO1_A67);
                gpio_direction_output(RK2818_PIN_PE6,GPIO_HIGH);
                gpio_direction_output(RK2818_PIN_PE7,GPIO_LOW);
                udelay(3);
@@ -905,6 +905,7 @@ static int __devinit tca6424_probe(struct i2c_client *client,const struct i2c_de
        tca6424_gpio_irq_setup(chip);
        i2c_set_clientdata(client, chip);
        chip->client = client;
+
        return 0;
 
 out_failed:
@@ -957,13 +958,13 @@ static int __init tca6424_init(void)
        tmp=i2c_add_driver(&tca6424_driver);
        return 0;
 }
+subsys_initcall(tca6424_init);
+
 static void __exit tca6424_exit(void)
 {
     DBG(KERN_ALERT"**********tca6424_exit**********\n");
        i2c_del_driver(&tca6424_driver);
 }
-
-module_init(tca6424_init);
 module_exit(tca6424_exit);
 
 MODULE_AUTHOR(" XXX  XXX@rock-chips.com");