aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpio/gpio-pca953x.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index e6805b97d047..c43b8ff626a7 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -21,7 +21,6 @@
21#include <linux/slab.h> 21#include <linux/slab.h>
22#ifdef CONFIG_OF_GPIO 22#ifdef CONFIG_OF_GPIO
23#include <linux/of_platform.h> 23#include <linux/of_platform.h>
24#include <linux/of_gpio.h>
25#endif 24#endif
26 25
27#define PCA953X_INPUT 0 26#define PCA953X_INPUT 0
@@ -545,6 +544,7 @@ static void pca953x_irq_teardown(struct pca953x_chip *chip)
545#ifdef CONFIG_OF_GPIO 544#ifdef CONFIG_OF_GPIO
546/* 545/*
547 * Translate OpenFirmware node properties into platform_data 546 * Translate OpenFirmware node properties into platform_data
547 * WARNING: This is DEPRECATED and will be removed eventually!
548 */ 548 */
549void 549void
550pca953x_get_alt_pdata(struct i2c_client *client, int *gpio_base, int *invert) 550pca953x_get_alt_pdata(struct i2c_client *client, int *gpio_base, int *invert)
@@ -559,6 +559,7 @@ pca953x_get_alt_pdata(struct i2c_client *client, int *gpio_base, int *invert)
559 559
560 *gpio_base = -1; 560 *gpio_base = -1;
561 val = of_get_property(node, "linux,gpio-base", &size); 561 val = of_get_property(node, "linux,gpio-base", &size);
562 WARN(val, "%s: device-tree property 'linux,gpio-base' is deprecated!", __func__);
562 if (val) { 563 if (val) {
563 if (size != sizeof(*val)) 564 if (size != sizeof(*val))
564 dev_warn(&client->dev, "%s: wrong linux,gpio-base\n", 565 dev_warn(&client->dev, "%s: wrong linux,gpio-base\n",
@@ -568,6 +569,7 @@ pca953x_get_alt_pdata(struct i2c_client *client, int *gpio_base, int *invert)
568 } 569 }
569 570
570 val = of_get_property(node, "polarity", NULL); 571 val = of_get_property(node, "polarity", NULL);
572 WARN(val, "%s: device-tree property 'polarity' is deprecated!", __func__);
571 if (val) 573 if (val)
572 *invert = *val; 574 *invert = *val;
573} 575}
@@ -636,7 +638,7 @@ static int __devinit pca953x_probe(struct i2c_client *client,
636{ 638{
637 struct pca953x_platform_data *pdata; 639 struct pca953x_platform_data *pdata;
638 struct pca953x_chip *chip; 640 struct pca953x_chip *chip;
639 int irq_base=-1, invert=0; 641 int irq_base=0, invert=0;
640 int ret = 0; 642 int ret = 0;
641 643
642 chip = kzalloc(sizeof(struct pca953x_chip), GFP_KERNEL); 644 chip = kzalloc(sizeof(struct pca953x_chip), GFP_KERNEL);
@@ -651,6 +653,11 @@ static int __devinit pca953x_probe(struct i2c_client *client,
651 chip->names = pdata->names; 653 chip->names = pdata->names;
652 } else { 654 } else {
653 pca953x_get_alt_pdata(client, &chip->gpio_start, &invert); 655 pca953x_get_alt_pdata(client, &chip->gpio_start, &invert);
656#ifdef CONFIG_OF_GPIO
657 /* If I2C node has no interrupts property, disable GPIO interrupts */
658 if (of_find_property(client->dev.of_node, "interrupts", NULL) == NULL)
659 irq_base = -1;
660#endif
654 } 661 }
655 662
656 chip->client = client; 663 chip->client = client;