aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorLeed Aguilar <leed.aguilar@ti.com>2012-07-10 09:35:53 -0400
committerLinus Walleij <linus.walleij@linaro.org>2012-07-17 15:00:18 -0400
commitca3ffe910f9935d24e02bb5628a8cbcab119fd9a (patch)
treed1753ea42d143ba28bbf2c4b0424d83104e21c16 /drivers/gpio
parent6a7b36aa4b0afbe7a9798feac16de47ad856f358 (diff)
gpio/pca953x: increase variables size to support 24 bit of data
Increase variable size from u16 to u32 to allocate 24 bit of data required for the TCA6424 I/O expander device type. Signed-off-by: Leed Aguilar <leed.aguilar@ti.com> 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.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 266b910de43b..9c693ae17956 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -78,10 +78,10 @@ struct pca953x_chip {
78 78
79#ifdef CONFIG_GPIO_PCA953X_IRQ 79#ifdef CONFIG_GPIO_PCA953X_IRQ
80 struct mutex irq_lock; 80 struct mutex irq_lock;
81 uint16_t irq_mask; 81 u32 irq_mask;
82 uint16_t irq_stat; 82 u32 irq_stat;
83 uint16_t irq_trig_raise; 83 u32 irq_trig_raise;
84 uint16_t irq_trig_fall; 84 u32 irq_trig_fall;
85 int irq_base; 85 int irq_base;
86#endif 86#endif
87 87
@@ -353,8 +353,8 @@ static void pca953x_irq_bus_lock(struct irq_data *d)
353static void pca953x_irq_bus_sync_unlock(struct irq_data *d) 353static void pca953x_irq_bus_sync_unlock(struct irq_data *d)
354{ 354{
355 struct pca953x_chip *chip = irq_data_get_irq_chip_data(d); 355 struct pca953x_chip *chip = irq_data_get_irq_chip_data(d);
356 uint16_t new_irqs; 356 u32 new_irqs;
357 uint16_t level; 357 u32 level;
358 358
359 /* Look for any newly setup interrupt */ 359 /* Look for any newly setup interrupt */
360 new_irqs = chip->irq_trig_fall | chip->irq_trig_raise; 360 new_irqs = chip->irq_trig_fall | chip->irq_trig_raise;
@@ -372,8 +372,8 @@ static void pca953x_irq_bus_sync_unlock(struct irq_data *d)
372static int pca953x_irq_set_type(struct irq_data *d, unsigned int type) 372static int pca953x_irq_set_type(struct irq_data *d, unsigned int type)
373{ 373{
374 struct pca953x_chip *chip = irq_data_get_irq_chip_data(d); 374 struct pca953x_chip *chip = irq_data_get_irq_chip_data(d);
375 uint16_t level = d->irq - chip->irq_base; 375 u32 level = d->irq - chip->irq_base;
376 uint16_t mask = 1 << level; 376 u32 mask = 1 << level;
377 377
378 if (!(type & IRQ_TYPE_EDGE_BOTH)) { 378 if (!(type & IRQ_TYPE_EDGE_BOTH)) {
379 dev_err(&chip->client->dev, "irq %d: unsupported type %d\n", 379 dev_err(&chip->client->dev, "irq %d: unsupported type %d\n",
@@ -403,12 +403,12 @@ static struct irq_chip pca953x_irq_chip = {
403 .irq_set_type = pca953x_irq_set_type, 403 .irq_set_type = pca953x_irq_set_type,
404}; 404};
405 405
406static uint16_t pca953x_irq_pending(struct pca953x_chip *chip) 406static u32 pca953x_irq_pending(struct pca953x_chip *chip)
407{ 407{
408 u32 cur_stat; 408 u32 cur_stat;
409 uint16_t old_stat; 409 u32 old_stat;
410 uint16_t pending; 410 u32 pending;
411 uint16_t trigger; 411 u32 trigger;
412 int ret, offset = 0; 412 int ret, offset = 0;
413 413
414 switch (chip->chip_type) { 414 switch (chip->chip_type) {
@@ -444,8 +444,8 @@ static uint16_t pca953x_irq_pending(struct pca953x_chip *chip)
444static irqreturn_t pca953x_irq_handler(int irq, void *devid) 444static irqreturn_t pca953x_irq_handler(int irq, void *devid)
445{ 445{
446 struct pca953x_chip *chip = devid; 446 struct pca953x_chip *chip = devid;
447 uint16_t pending; 447 u32 pending;
448 uint16_t level; 448 u32 level;
449 449
450 pending = pca953x_irq_pending(chip); 450 pending = pca953x_irq_pending(chip);
451 451