pca953x: support GPIOLIB GPIO naming
authorDaniel Silverstone <dsilvers@simtec.co.uk>
Wed, 17 Jun 2009 23:26:15 +0000 (16:26 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 18 Jun 2009 20:03:44 +0000 (13:03 -0700)
Add support to the PCA953x driver to use the GPIOLIB naming facility for
GPIOs.

Signed-off-by: Daniel Silverstone <dsilvers@simtec.co.uk>
Cc: Ben Gardner <bgardner@wabtec.com>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/gpio/pca953x.c
include/linux/i2c/pca953x.h

index 8dc0164bd51e036af7ae4986644957cf6a4c8b94..2dae94fbabf4f94c21ec8aab08cedca312daa732 100644 (file)
@@ -50,6 +50,7 @@ struct pca953x_chip {
 
        struct i2c_client *client;
        struct gpio_chip gpio_chip;
+       char **names;
 };
 
 static int pca953x_write_reg(struct pca953x_chip *chip, int reg, uint16_t val)
@@ -192,6 +193,7 @@ static void pca953x_setup_gpio(struct pca953x_chip *chip, int gpios)
        gc->label = chip->client->name;
        gc->dev = &chip->client->dev;
        gc->owner = THIS_MODULE;
+       gc->names = chip->names;
 }
 
 static int __devinit pca953x_probe(struct i2c_client *client,
@@ -215,6 +217,8 @@ static int __devinit pca953x_probe(struct i2c_client *client,
 
        chip->gpio_start = pdata->gpio_base;
 
+       chip->names = pdata->names;
+
        /* initialize cached registers from their original values.
         * we can't share this chip with another i2c master.
         */
index 3c7361217df81098a0c052140b12ce409ee1f9be..81736d6a8db7380280a8da7757ca017ed2ce08e4 100644 (file)
@@ -15,4 +15,5 @@ struct pca953x_platform_data {
        int             (*teardown)(struct i2c_client *client,
                                unsigned gpio, unsigned ngpio,
                                void *context);
+       char            **names;
 };