leds:pca963x: Always initialize MODE2 register
authorPeter Meerwald <pmeerw@pmeerw.net>
Thu, 3 Jul 2014 05:50:35 +0000 (22:50 -0700)
committerBryan Wu <cooloney@gmail.com>
Thu, 3 Jul 2014 18:55:56 +0000 (11:55 -0700)
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>
drivers/leds/leds-pca963x.c

index 4438be9980a617281203949b849e471e395f82f4..f110b4c456baa77f632c610fd8e024c94eb5b3fe 100644 (file)
@@ -423,9 +423,13 @@ static int pca963x_probe(struct i2c_client *client,
        /* Disable LED all-call address and set normal mode */
        i2c_smbus_write_byte_data(client, PCA963X_MODE1, 0x00);
 
-       /* Configure output: open-drain or totem pole (push-pull) */
-       if (pdata && pdata->outdrv == PCA963X_OPEN_DRAIN)
-               i2c_smbus_write_byte_data(client, PCA963X_MODE2, 0x01);
+       if (pdata) {
+               /* Configure output: open-drain or totem pole (push-pull) */
+               if (pdata->outdrv == PCA963X_OPEN_DRAIN)
+                       i2c_smbus_write_byte_data(client, PCA963X_MODE2, 0x01);
+               else
+                       i2c_smbus_write_byte_data(client, PCA963X_MODE2, 0x05);
+       }
 
        return 0;
 
This page took 0.024679 seconds and 5 git commands to generate.