diff options
author | Peter Meerwald <pmeerw@pmeerw.net> | 2014-07-03 01:50:35 -0400 |
---|---|---|
committer | Bryan Wu <cooloney@gmail.com> | 2014-07-03 14:55:56 -0400 |
commit | 0c62f42dabb5d43d880262d7f1f85e6464acd601 (patch) | |
tree | 60b3da61cc2b0adab9aa7ea512462bc8c89fcd32 /drivers | |
parent | 3dfedb9d545346958311b8d73f90b8522d1fc759 (diff) |
leds:pca963x: Always initialize MODE2 register
PCA9632 defaults to open-drain
PCA9633/4/5 defaults to totem-pole
the driver assumed that totem-pole default and didn't actively set
the value; the MODE2 register is now written if platform
data indicating the mode is given
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/leds/leds-pca963x.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/leds/leds-pca963x.c b/drivers/leds/leds-pca963x.c index 4438be9980a6..f110b4c456ba 100644 --- a/drivers/leds/leds-pca963x.c +++ b/drivers/leds/leds-pca963x.c | |||
@@ -423,9 +423,13 @@ static int pca963x_probe(struct i2c_client *client, | |||
423 | /* Disable LED all-call address and set normal mode */ | 423 | /* Disable LED all-call address and set normal mode */ |
424 | i2c_smbus_write_byte_data(client, PCA963X_MODE1, 0x00); | 424 | i2c_smbus_write_byte_data(client, PCA963X_MODE1, 0x00); |
425 | 425 | ||
426 | /* Configure output: open-drain or totem pole (push-pull) */ | 426 | if (pdata) { |
427 | if (pdata && pdata->outdrv == PCA963X_OPEN_DRAIN) | 427 | /* Configure output: open-drain or totem pole (push-pull) */ |
428 | i2c_smbus_write_byte_data(client, PCA963X_MODE2, 0x01); | 428 | if (pdata->outdrv == PCA963X_OPEN_DRAIN) |
429 | i2c_smbus_write_byte_data(client, PCA963X_MODE2, 0x01); | ||
430 | else | ||
431 | i2c_smbus_write_byte_data(client, PCA963X_MODE2, 0x05); | ||
432 | } | ||
429 | 433 | ||
430 | return 0; | 434 | return 0; |
431 | 435 | ||