summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAshwini Ghuge <aghuge@nvidia.com>2012-04-17 17:28:06 +0530
committerSimone Willett <swillett@nvidia.com>2012-04-18 18:30:09 -0700
commitfd5af65bc99c11f65fd400f08d67e9d2470c9d9e (patch)
tree4c6bb6b04e60cae05ced059bd5f220bfb4712018 /drivers
parent56499875cb807e9485ea5ff6d0e9b50bb06196fa (diff)
mfd: max8907c: Disable Hard Reset with Power key
Disable Hard Reset on long press of power key. Bug 893517 Change-Id: Ic328a04e917aa1bed6780e6f9a2f1c575f84fb68 Signed-off-by: Ashwini Ghuge <aghuge@nvidia.com> Reviewed-on: http://git-master/r/96687 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mfd/max8907c.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/mfd/max8907c.c b/drivers/mfd/max8907c.c
index ba85a0091642..f8964cb92965 100644
--- a/drivers/mfd/max8907c.c
+++ b/drivers/mfd/max8907c.c
@@ -275,6 +275,7 @@ static int max8907c_i2c_probe(struct i2c_client *i2c,
struct max8907c_platform_data *pdata = i2c->dev.platform_data;
int ret;
int i;
+ u8 tmp;
max8907c = kzalloc(sizeof(struct max8907c), GFP_KERNEL);
if (max8907c == NULL)
@@ -298,7 +299,7 @@ static int max8907c_i2c_probe(struct i2c_client *i2c,
ret = mfd_add_devices(max8907c->dev, -1, cells, ARRAY_SIZE(cells),
NULL, 0);
if (ret != 0) {
- i2c_unregister_device(max8907c->i2c_rtc);
+ i2c_unregister_device(max8907c->i2c_rtc);
kfree(max8907c);
pr_debug("max8907c: failed to add MFD devices %X\n", ret);
return ret;
@@ -313,6 +314,18 @@ static int max8907c_i2c_probe(struct i2c_client *i2c,
if (pdata->use_power_off && !pm_power_off)
pm_power_off = max8907c_power_off;
+ ret = max8907c_i2c_read(i2c, MAX8907C_REG_SYSENSEL, 1, &tmp);
+ /*Mask HARD RESET, if enabled */
+ if (ret == 0) {
+ tmp &= ~(BIT(7));
+ ret = max8907c_i2c_write(i2c, MAX8907C_REG_SYSENSEL, 1, &tmp);
+ }
+
+ if (ret != 0) {
+ pr_err("Failed to write max8907c I2C driver: %d\n", ret);
+ return ret;
+ }
+
if (pdata->max8907c_setup)
return pdata->max8907c_setup();