pca953x: support GPIOLIB GPIO naming

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, June 18, 2009 - 2:59 pm

Gitweb:     http://git.kernel.org/linus/77906a546127e056dbdac618a7afb5b92d00c058
Commit:     77906a546127e056dbdac618a7afb5b92d00c058
Parent:     7bfa58dd4ac8b07b28d4d48780fd44ee6215562b
Author:     Daniel Silverstone <dsilvers@simtec.co.uk>
AuthorDate: Wed Jun 17 16:26:15 2009 -0700
Committer:  Linus Torvalds <torvalds@linux-foundation.org>
CommitDate: Thu Jun 18 13:03:44 2009 -0700

    pca953x: support GPIOLIB GPIO naming
    
    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      |    4 ++++
 include/linux/i2c/pca953x.h |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/gpio/pca953x.c b/drivers/gpio/pca953x.c
index 8dc0164..2dae94f 100644
--- a/drivers/gpio/pca953x.c
+++ b/drivers/gpio/pca953x.c
@@ -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.
 	 */
diff --git a/include/linux/i2c/pca953x.h b/include/linux/i2c/pca953x.h
index 3c73612..81736d6 100644
--- a/include/linux/i2c/pca953x.h
+++ b/include/linux/i2c/pca953x.h
@@ -15,4 +15,5 @@ struct pca953x_platform_data {
 	int		(*teardown)(struct i2c_client *client,
 				unsigned gpio, unsigned ngpio,
 				void *context);
+	char		**names;
 };
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
pca953x: support GPIOLIB GPIO naming, Linux Kernel Mailing ..., (Thu Jun 18, 2:59 pm)