Skip to contentSkip to conversation

PCA953x: Support GPIOLIB GPIO naming

PATCH Daniel Silverstone 1 participant 1 message Apr 8, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

This patch adds support to the PCA953x driver to use the GPIOLIB naming facility for GPIOs.

drivers/gpio/pca953x.c +4 -0
Index: linux-2.6.27/drivers/gpio/pca953x.c
===================================================================
@@ -45,6 +45,7 @@
 
 	struct i2c_client *client;
 	struct gpio_chip gpio_chip;
+	char **names;
 };
 
 /* NOTE:  we can't currently rely on fault codes to come from SMBus
@@ -190,6 +191,7 @@
 	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,
@@ -211,6 +213,8 @@
 
 	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.
 	 */
include/linux/i2c/pca953x.h +1 -0
Index: linux-2.6.27/include/linux/i2c/pca953x.h
===================================================================
@@ -15,4 +15,5 @@
 	int		(*teardown)(struct i2c_client *client,
 				unsigned gpio, unsigned ngpio,
 				void *context);
+	char		**names;
 };
Signature · 2 lines
Daniel Silverstone                              http://www.simtec.co.uk/
PGP mail accepted and encouraged.            Key Id: 2BC8 4016 2068 7895