aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorChandrabhanu Mahapatra <cmahapatra@ti.com>2012-07-10 09:35:37 -0400
committerLinus Walleij <linus.walleij@linaro.org>2012-07-17 15:00:18 -0400
commit6a7b36aa4b0afbe7a9798feac16de47ad856f358 (patch)
treece7f451864f44cbd4d8896f7ca8d478f07b8d249 /drivers/gpio
parent346720130aa49e1b711c0900e98fd12f4de972b0 (diff)
GPIO: PCA953X: Increase size of invert variable to support 24 bit
TCA6424 is a low voltage 24 bit I2C and SMBus I/O expander of pca953x family similar to its 16 bit predecessor TCA6416. It comes with three 8-bit active Input, Output, Polarity Inversion and Configuration registers each. The polarity of Input ports can be reversed by setting the appropiate bit in Polarity Inversion registers. The variables corresponding to Input, Output and Configuration registers have already been updated to support 24 bit values. This patch thus updates the invert variable of PCA953X platform data to support 24 bit. Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-pca953x.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index de24af202447..266b910de43b 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -568,7 +568,7 @@ static void pca953x_irq_teardown(struct pca953x_chip *chip)
568 * WARNING: This is DEPRECATED and will be removed eventually! 568 * WARNING: This is DEPRECATED and will be removed eventually!
569 */ 569 */
570static void 570static void
571pca953x_get_alt_pdata(struct i2c_client *client, int *gpio_base, int *invert) 571pca953x_get_alt_pdata(struct i2c_client *client, int *gpio_base, u32 *invert)
572{ 572{
573 struct device_node *node; 573 struct device_node *node;
574 const __be32 *val; 574 const __be32 *val;
@@ -596,13 +596,13 @@ pca953x_get_alt_pdata(struct i2c_client *client, int *gpio_base, int *invert)
596} 596}
597#else 597#else
598static void 598static void
599pca953x_get_alt_pdata(struct i2c_client *client, int *gpio_base, int *invert) 599pca953x_get_alt_pdata(struct i2c_client *client, int *gpio_base, u32 *invert)
600{ 600{
601 *gpio_base = -1; 601 *gpio_base = -1;
602} 602}
603#endif 603#endif
604 604
605static int __devinit device_pca953x_init(struct pca953x_chip *chip, int invert) 605static int __devinit device_pca953x_init(struct pca953x_chip *chip, u32 invert)
606{ 606{
607 int ret; 607 int ret;
608 608
@@ -621,7 +621,7 @@ out:
621 return ret; 621 return ret;
622} 622}
623 623
624static int __devinit device_pca957x_init(struct pca953x_chip *chip, int invert) 624static int __devinit device_pca957x_init(struct pca953x_chip *chip, u32 invert)
625{ 625{
626 int ret; 626 int ret;
627 u32 val = 0; 627 u32 val = 0;
@@ -657,8 +657,9 @@ static int __devinit pca953x_probe(struct i2c_client *client,
657{ 657{
658 struct pca953x_platform_data *pdata; 658 struct pca953x_platform_data *pdata;
659 struct pca953x_chip *chip; 659 struct pca953x_chip *chip;
660 int irq_base=0, invert=0; 660 int irq_base = 0;
661 int ret; 661 int ret;
662 u32 invert = 0;
662 663
663 chip = kzalloc(sizeof(struct pca953x_chip), GFP_KERNEL); 664 chip = kzalloc(sizeof(struct pca953x_chip), GFP_KERNEL);
664 if (chip == NULL) 665 if (chip == NULL)