Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 126379
b: refs/heads/master
c: ab5dc37
h: refs/heads/master
i:
  126377: 92e9bae
  126375: 1d300b7
v: v3
  • Loading branch information
David Brownell authored and Linus Torvalds committed Jan 6, 2009
1 parent 0ccfc46 commit 2dd7f5a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cabb3fc4bd1628c37c37e054960eb3e4bf30dc26
refs/heads/master: ab5dc372021def8f40b34761babecad0bf868b1c
7 changes: 4 additions & 3 deletions trunk/drivers/gpio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ config GPIO_MAX732X
number for these GPIOs.

config GPIO_PCA953X
tristate "PCA953x, PCA955x, and MAX7310 I/O ports"
tristate "PCA953x, PCA955x, TCA64xx, and MAX7310 I/O ports"
depends on I2C
help
Say yes here to provide access to several register-oriented
Expand All @@ -104,9 +104,10 @@ config GPIO_PCA953X

4 bits: pca9536, pca9537

8 bits: max7310, pca9534, pca9538, pca9554, pca9557
8 bits: max7310, pca9534, pca9538, pca9554, pca9557,
tca6408

16 bits: pca9535, pca9539, pca9555
16 bits: pca9535, pca9539, pca9555, tca6416

This driver can also be built as a module. If so, the module
will be called pca953x.
Expand Down
12 changes: 7 additions & 5 deletions trunk/drivers/gpio/pca953x.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ static const struct i2c_device_id pca953x_id[] = {
{ "pca9554", 8, },
{ "pca9555", 16, },
{ "pca9557", 8, },

{ "max7310", 8, },
{ "pca6107", 8, },
{ "tca6408", 8, },
{ "tca6416", 16, },
/* NYET: { "tca6424", 24, }, */
{ }
};
MODULE_DEVICE_TABLE(i2c, pca953x_id);
Expand All @@ -47,9 +52,6 @@ struct pca953x_chip {
struct gpio_chip gpio_chip;
};

/* NOTE: we can't currently rely on fault codes to come from SMBus
* calls, so we map all errors to EIO here and return zero otherwise.
*/
static int pca953x_write_reg(struct pca953x_chip *chip, int reg, uint16_t val)
{
int ret;
Expand All @@ -61,7 +63,7 @@ static int pca953x_write_reg(struct pca953x_chip *chip, int reg, uint16_t val)

if (ret < 0) {
dev_err(&chip->client->dev, "failed writing register\n");
return -EIO;
return ret;
}

return 0;
Expand All @@ -78,7 +80,7 @@ static int pca953x_read_reg(struct pca953x_chip *chip, int reg, uint16_t *val)

if (ret < 0) {
dev_err(&chip->client->dev, "failed reading register\n");
return -EIO;
return ret;
}

*val = (uint16_t)ret;
Expand Down

0 comments on commit 2dd7f5a

Please sign in to comment.