summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSubbaraman Narayanamurthy <subbaram@codeaurora.org>2015-12-14 16:49:05 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:23:08 -0700
commit09a0e43d7804f95189834ab14150ad76a91a766e (patch)
tree4fc2e708c57a3f72f5dbe93cf670b58af04962e7 /drivers
parent073de5c5c3c6dd1408a332736f2a932a339f19fe (diff)
regulator: fan53555: add support to disable suspend voltage configuration
Currently, fan53555 regulator driver always registers for set_suspend_voltage. This force configures the regulator to set suspend voltage switching to a different voltage selector. However, this might not be preferred for certain applications. Add a device tree parameter "fcs,disable-suspend" for the regulator which when specified will disable suspend voltage configuration. CRs-Fixed: 968575 Change-Id: Ib9f450126482e606f3e057857b7a58800583519a Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/regulator/fan53555.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
index 0b6ed1cf6a83..28a2619b965d 100644
--- a/drivers/regulator/fan53555.c
+++ b/drivers/regulator/fan53555.c
@@ -92,6 +92,8 @@ struct fan53555_device_info {
unsigned int slew_rate;
/* Sleep voltage cache */
unsigned int sleep_vol_cache;
+ /* Disable suspend */
+ bool disable_suspend;
};
static int fan53555_set_suspend_voltage(struct regulator_dev *rdev, int uV)
@@ -99,6 +101,8 @@ static int fan53555_set_suspend_voltage(struct regulator_dev *rdev, int uV)
struct fan53555_device_info *di = rdev_get_drvdata(rdev);
int ret;
+ if (di->disable_suspend)
+ return 0;
if (di->sleep_vol_cache == uV)
return 0;
ret = regulator_map_voltage_linear(rdev, uV, uV);
@@ -326,6 +330,8 @@ static int fan53555_parse_dt(struct fan53555_device_info *di,
if (!ret)
pdata->sleep_vsel_id = tmp;
+ di->disable_suspend = of_property_read_bool(np, "fcs,disable-suspend");
+
return ret;
}