aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/max8997_haptic.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-09 21:46:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-09 21:46:02 -0400
commitf4f9b8fc73f9aa93744f0e91e18f367d7766f523 (patch)
tree90d02c6722b0ffd8252ac438370600aaf8d814e7 /drivers/input/misc/max8997_haptic.c
parent9894e6d9c020b754dd962960e9f7eac18282f69f (diff)
parenta292241cccb7e20e8b997a9a44177e7c98141859 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov: "A big update to the Atmel touchscreen driver, devm support for polled input devices, several drivers have been converted to using managed resources, and assorted driver fixes" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (87 commits) Input: synaptics - fix resolution for manually provided min/max Input: atmel_mxt_ts - fix invalid return from mxt_get_bootloader_version Input: max8997_haptic - add error handling for regulator and pwm Input: elantech - don't set bit 1 of reg_10 when the no_hw_res quirk is set Input: elantech - deal with clickpads reporting right button events Input: edt-ft5x06 - fix an i2c write for M09 support Input: omap-keypad - remove platform data support ARM: OMAP2+: remove unused omap4-keypad file and code Input: ab8500-ponkey - switch to using managed resources Input: max8925_onkey - switch to using managed resources Input: 88pm860x-ts - switch to using managed resources Input: 88pm860x_onkey - switch to using managed resources Input: intel-mid-touch - switch to using managed resources Input: wacom - process outbound for newer Cintiqs Input: wacom - set stylus_in_proximity when pen is in range DTS: ARM: OMAP3-N900: Add tsc2005 support Input: tsc2005 - add DT support Input: add common DT binding for touchscreens Input: jornada680_kbd - switch top using managed resources Input: adp5520-keys - switch to using managed resources ...
Diffstat (limited to 'drivers/input/misc/max8997_haptic.c')
-rw-r--r--drivers/input/misc/max8997_haptic.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c
index 1fea5484941f..a363ebbd9cc0 100644
--- a/drivers/input/misc/max8997_haptic.c
+++ b/drivers/input/misc/max8997_haptic.c
@@ -181,11 +181,21 @@ static void max8997_haptic_enable(struct max8997_haptic *chip)
181 } 181 }
182 182
183 if (!chip->enabled) { 183 if (!chip->enabled) {
184 chip->enabled = true; 184 error = regulator_enable(chip->regulator);
185 regulator_enable(chip->regulator); 185 if (error) {
186 dev_err(chip->dev, "Failed to enable regulator\n");
187 goto out;
188 }
186 max8997_haptic_configure(chip); 189 max8997_haptic_configure(chip);
187 if (chip->mode == MAX8997_EXTERNAL_MODE) 190 if (chip->mode == MAX8997_EXTERNAL_MODE) {
188 pwm_enable(chip->pwm); 191 error = pwm_enable(chip->pwm);
192 if (error) {
193 dev_err(chip->dev, "Failed to enable PWM\n");
194 regulator_disable(chip->regulator);
195 goto out;
196 }
197 }
198 chip->enabled = true;
189 } 199 }
190 200
191out: 201out: