mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
pca953x: support GPIOLIB GPIO naming
Add support to the PCA953x driver to use the GPIOLIB naming facility for GPIOs. Signed-off-by: Daniel Silverstone <[email protected]> Cc: Ben Gardner <[email protected]> Cc: Jean Delvare <[email protected]> Cc: David Brownell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
7bfa58dd4a
commit
77906a5461
2 changed files with 5 additions and 0 deletions
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue