From f4f4a5b8a89949446c6df3154de8008aaa38d4d0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=AE=8B=E7=A7=80=E6=9D=B0?= Date: Wed, 8 Sep 2010 06:04:29 -0700 Subject: [PATCH] add expand gpio soft interrupt in kconfig, so modify raho defconfig, amended some places which is not standard --- arch/arm/configs/rk2818_raho_defconfig | 1 + arch/arm/mach-rk2818/board-infosdk.c | 51 ------------------- drivers/gpio/Kconfig | 2 +- drivers/gpio/Makefile | 2 +- ...terrupt.c => expand_gpio_soft_interrupt.c} | 13 ++--- ...terrupt.h => expand_gpio_soft_interrupt.h} | 0 drivers/gpio/tca6424.c | 10 ++-- 7 files changed, 15 insertions(+), 64 deletions(-) mode change 100644 => 100755 arch/arm/configs/rk2818_raho_defconfig rename drivers/gpio/{soft_interrupt.c => expand_gpio_soft_interrupt.c} (95%) rename drivers/gpio/{soft_interrupt.h => expand_gpio_soft_interrupt.h} (100%) diff --git a/arch/arm/configs/rk2818_raho_defconfig b/arch/arm/configs/rk2818_raho_defconfig old mode 100644 new mode 100755 index 4029e5015bc0..c37aa0a3fba7 --- a/arch/arm/configs/rk2818_raho_defconfig +++ b/arch/arm/configs/rk2818_raho_defconfig @@ -885,6 +885,7 @@ CONFIG_GPIOLIB=y # CONFIG_IOEXTEND_TCA6424 is not set CONFIG_EXPANDED_GPIO_NUM=96 CONFIG_EXPANDED_GPIO_IRQ_NUM=16 +# CONFIG_EXPAND_GPIO_SOFT_INTERRUPT is not set CONFIG_SPI_FPGA_GPIO_NUM=96 CONFIG_SPI_FPGA_GPIO_IRQ_NUM=16 # CONFIG_W1 is not set diff --git a/arch/arm/mach-rk2818/board-infosdk.c b/arch/arm/mach-rk2818/board-infosdk.c index c84a3fb19554..f7385d5c3aca 100755 --- a/arch/arm/mach-rk2818/board-infosdk.c +++ b/arch/arm/mach-rk2818/board-infosdk.c @@ -1388,7 +1388,6 @@ struct platform_device rk2818_device_dm9k = { /* * InfoPhone Matrix Keyboard Device */ - #define KEYOUT0 TCA6424_P01 #define KEYOUT1 TCA6424_P02 #define KEYOUT2 TCA6424_P03 @@ -1400,31 +1399,7 @@ struct platform_device rk2818_device_dm9k = { #define KEYIN2 TCA6424_P14 #define KEYIN3 TCA6424_P15 - -#if 1 static const uint32_t rk2818matrix_keymap[] = { -#if 0 - KEY(0, 0, KEY_1), - KEY(0, 1, KEY_3), - KEY(0, 2, KEY_5), - KEY(0, 3, KEY_6), - KEY(0, 4, KEY_7), - KEY(1, 0, KEY_2), - KEY(1, 1, KEY_4), - KEY(1, 2, KEY_R), - KEY(1, 3, KEY_Y), - KEY(1, 4, KEY_8), - KEY(2, 0, KEY_TAB), - KEY(2, 1, KEY_Q), - KEY(2, 2, KEY_E), - KEY(2, 3, KEY_T), - KEY(2, 4, KEY_G), - KEY(3, 0, KEY_LEFTCTRL), - KEY(3, 1, KEY_W), - KEY(3, 2, KEY_S), - KEY(3, 3, KEY_F), - KEY(3, 4, KEY_V), -#else KEY(0, 0, KEY_1), KEY(1, 0, KEY_2), KEY(2, 0, KEY_3), @@ -1445,33 +1420,7 @@ static const uint32_t rk2818matrix_keymap[] = { KEY(1, 4, KEY_S), KEY(2, 4, KEY_F), KEY(3, 4, KEY_V), -#endif }; -#else -static const uint32_t rk2818matrix_keymap[] = { - KEY(0, 0, KEY_1), - KEY(0, 1, KEY_2), - KEY(0, 2, KEY_3), - KEY(0, 3, KEY_TAB), - KEY(1, 0, KEY_4), - KEY(1, 1, KEY_5), - KEY(1, 2, KEY_6), - KEY(1, 3, KEY_R), - KEY(2, 0, KEY_7), - KEY(2, 1, KEY_8), - KEY(2, 2, KEY_9), - KEY(2, 3, KEY_LEFTCTRL), - KEY(3, 0, KEY_SWITCHVIDEOMODE), - KEY(3, 1, KEY_0), - KEY(3, 2, KEY_S), - KEY(3, 3, KEY_F), - KEY(4, 0, KEY_G), - KEY(4, 1, KEY_W), - KEY(4, 2, KEY_S), - KEY(4, 3, KEY_F), -}; - -#endif static struct matrix_keymap_data rk2818matrix_keymap_data = { .keymap = rk2818matrix_keymap, diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 604fa05d470f..27553305bab0 100755 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -252,7 +252,7 @@ config EXPANDED_GPIO_IRQ_NUM int "setting the amount of expanded gpio irqs" help for tca6424, set 24 -config SOFT_INTERRUPT +config EXPAND_GPIO_SOFT_INTERRUPT bool "soft interrupt for expand gpio use" help if you want expand gpio support interrupt,choose it diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index 27efb0654627..dd031a14d055 100755 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -21,4 +21,4 @@ obj-$(CONFIG_GPIO_VR41XX) += vr41xx_giu.o obj-$(CONFIG_GPIO_WM831X) += wm831x-gpio.o obj-$(CONFIG_GPIO_PCA9554) += pca9554.o obj-$(CONFIG_IOEXTEND_TCA6424) += tca6424.o -obj-$(CONFIG_SOFT_INTERRUPT) += soft_interrupt.o +obj-$(CONFIG_EXPAND_GPIO_SOFT_INTERRUPT) += expand_gpio_soft_interrupt.o diff --git a/drivers/gpio/soft_interrupt.c b/drivers/gpio/expand_gpio_soft_interrupt.c similarity index 95% rename from drivers/gpio/soft_interrupt.c rename to drivers/gpio/expand_gpio_soft_interrupt.c index 6868d549d75c..79c4fd06cfe3 100755 --- a/drivers/gpio/soft_interrupt.c +++ b/drivers/gpio/expand_gpio_soft_interrupt.c @@ -44,7 +44,7 @@ NOTES : #include #include #include -#include "../drivers/gpio/soft_interrupt.h" +#include "../drivers/gpio/expand_gpio_soft_interrupt.h" #if 0 #define DBG(x...) printk(KERN_INFO x) @@ -64,12 +64,13 @@ NOTES : #define MIN(x,y) (((x)<(y))?(x):(y)) -int expand_gpio_irq_en = -1; -int expand_gpio_irq_ctrflag = -1; -unsigned int expand_gpio_irq_num = 0; +static int expand_gpio_irq_en = -1; +static int expand_gpio_irq_ctrflag = -1; +static unsigned int expand_gpio_irq_num = 0; + +static struct workqueue_struct *irqworkqueue; +static struct lock_class_key gpio_lock_class; -struct workqueue_struct *irqworkqueue; -extern struct lock_class_key gpio_lock_class; struct expand_gpio_soft_int expand_irq_data; void expand_gpio_irq_ctr_dis(int irq,int ctrflag) diff --git a/drivers/gpio/soft_interrupt.h b/drivers/gpio/expand_gpio_soft_interrupt.h similarity index 100% rename from drivers/gpio/soft_interrupt.h rename to drivers/gpio/expand_gpio_soft_interrupt.h diff --git a/drivers/gpio/tca6424.c b/drivers/gpio/tca6424.c index 4969a49bdf0c..e3edd35f1f3b 100755 --- a/drivers/gpio/tca6424.c +++ b/drivers/gpio/tca6424.c @@ -43,7 +43,7 @@ NOTES : #include #include #include -#include "../drivers/gpio/soft_interrupt.h" +#include "../drivers/gpio/expand_gpio_soft_interrupt.h" #if 0 #define TCA6424DEB @@ -293,7 +293,7 @@ static int tca6424_gpio_get_value(struct gpio_chip *gc, unsigned pin_num) chip = container_of(gc, struct tca6424_chip, gpio_chip); - #ifdef CONFIG_SOFT_INTERRUPT + #ifdef CONFIG_EXPAND_GPIO_SOFT_INTERRUPT ret = wait_untill_input_reg_flash( ); if(ret<0) return -1; @@ -306,7 +306,7 @@ static int tca6424_gpio_get_value(struct gpio_chip *gc, unsigned pin_num) if((gpioPortNum>=TCA6424_PortNum)||(gpioPortPinNum>=portnum[gpioPortNum])) return -1; - #ifndef CONFIG_SOFT_INTERRUPT + #ifndef CONFIG_EXPAND_GPIO_SOFT_INTERRUPT uint8_t reg_val; ret = tca6424_read_reg(chip->client, Regaddr, ®_val); if (ret < 0) @@ -514,7 +514,7 @@ static int __devinit tca6424_probe(struct i2c_client *client,const struct i2c_de chip->client = client; chip->names = pdata->names; - #ifdef CONFIG_SOFT_INTERRUPT + #ifdef CONFIG_EXPAND_GPIO_SOFT_INTERRUPT chip->expand = &expand_irq_data; chip->expand->gpio_irq_start =pdata->gpio_irq_start; chip->expand->irq_pin_num = pdata->irq_pin_num; @@ -543,7 +543,7 @@ static int __devinit tca6424_probe(struct i2c_client *client,const struct i2c_de } i2c_set_clientdata(client, chip); - #ifdef CONFIG_SOFT_INTERRUPT + #ifdef CONFIG_EXPAND_GPIO_SOFT_INTERRUPT expand_irq_init(chip,&chip->gtca6424_struct,tca6424_irq_read_inputreg); #endif return 0; -- 2.34.1