diff options
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/leds-lm3642.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/leds/leds-lm3642.c b/drivers/leds/leds-lm3642.c index 924853b7922c..3285006e9888 100644 --- a/drivers/leds/leds-lm3642.c +++ b/drivers/leds/leds-lm3642.c | |||
@@ -95,23 +95,14 @@ struct lm3642_chip_data { | |||
95 | /* chip initialize */ | 95 | /* chip initialize */ |
96 | static int __devinit lm3642_chip_init(struct lm3642_chip_data *chip) | 96 | static int __devinit lm3642_chip_init(struct lm3642_chip_data *chip) |
97 | { | 97 | { |
98 | unsigned int reg_val; | ||
99 | int ret; | 98 | int ret; |
100 | struct lm3642_platform_data *pdata = chip->pdata; | 99 | struct lm3642_platform_data *pdata = chip->pdata; |
101 | 100 | ||
102 | /* set enable register */ | 101 | /* set enable register */ |
103 | ret = regmap_read(chip->regmap, REG_ENABLE, ®_val); | 102 | ret = regmap_update_bits(chip->regmap, REG_ENABLE, EX_PIN_ENABLE_MASK, |
103 | pdata->tx_pin); | ||
104 | if (ret < 0) | 104 | if (ret < 0) |
105 | goto out; | 105 | dev_err(chip->dev, "Failed to update REG_ENABLE Register\n"); |
106 | |||
107 | reg_val &= (~EX_PIN_ENABLE_MASK); | ||
108 | reg_val |= pdata->tx_pin; | ||
109 | ret = regmap_write(chip->regmap, REG_ENABLE, reg_val); | ||
110 | if (ret < 0) | ||
111 | goto out; | ||
112 | |||
113 | out: | ||
114 | dev_err(chip->dev, "Failed to read REG_ENABLE Register\n"); | ||
115 | return ret; | 106 | return ret; |
116 | } | 107 | } |
117 | 108 | ||