diff options
author | Arnd Bergmann <arnd@arndb.de> | 2013-04-09 17:50:59 +0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2013-04-09 18:01:23 +0400 |
commit | 835f9c38bbb4498c3d43b7466964bdadbb1fd244 (patch) | |
tree | ade5aec66bc7ddb97048c4f141932de0f93369b9 /drivers/input/touchscreen/mms114.c | |
parent | f5f29151588744ea2e283971cb0ad403ee04e3e2 (diff) | |
parent | a937536b868b8369b98967929045f1df54234323 (diff) | |
download | linux-835f9c38bbb4498c3d43b7466964bdadbb1fd244.tar.xz |
Merge tag 'v3.9-rc3' into next/multiplatform
Linux 3.9-rc3
Conflicts:
arch/arm/Kconfig
arch/arm/mach-spear/spear3xx.c
arch/arm/plat-spear/Kconfig
This is a dependency for ux500/multiplatform
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/input/touchscreen/mms114.c')
-rw-r--r-- | drivers/input/touchscreen/mms114.c | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/drivers/input/touchscreen/mms114.c b/drivers/input/touchscreen/mms114.c index 4a29ddf6bf1e..1443532fe6c4 100644 --- a/drivers/input/touchscreen/mms114.c +++ b/drivers/input/touchscreen/mms114.c @@ -314,15 +314,27 @@ static int mms114_start(struct mms114_data *data) struct i2c_client *client = data->client; int error; - if (data->core_reg) - regulator_enable(data->core_reg); - if (data->io_reg) - regulator_enable(data->io_reg); + error = regulator_enable(data->core_reg); + if (error) { + dev_err(&client->dev, "Failed to enable avdd: %d\n", error); + return error; + } + + error = regulator_enable(data->io_reg); + if (error) { + dev_err(&client->dev, "Failed to enable vdd: %d\n", error); + regulator_disable(data->core_reg); + return error; + } + mdelay(MMS114_POWERON_DELAY); error = mms114_setup_regs(data); - if (error < 0) + if (error < 0) { + regulator_disable(data->io_reg); + regulator_disable(data->core_reg); return error; + } if (data->pdata->cfg_pin) data->pdata->cfg_pin(true); @@ -335,16 +347,20 @@ static int mms114_start(struct mms114_data *data) static void mms114_stop(struct mms114_data *data) { struct i2c_client *client = data->client; + int error; disable_irq(client->irq); if (data->pdata->cfg_pin) data->pdata->cfg_pin(false); - if (data->io_reg) - regulator_disable(data->io_reg); - if (data->core_reg) - regulator_disable(data->core_reg); + error = regulator_disable(data->io_reg); + if (error) + dev_warn(&client->dev, "Failed to disable vdd: %d\n", error); + + error = regulator_disable(data->core_reg); + if (error) + dev_warn(&client->dev, "Failed to disable avdd: %d\n", error); } static int mms114_input_open(struct input_dev *dev) |