diff options
author | Yen Lin <yelin@nvidia.com> | 2012-11-29 14:39:44 -0800 |
---|---|---|
committer | Mrutyunjay Sawant <msawant@nvidia.com> | 2012-12-04 22:23:54 -0800 |
commit | 42ecb574a175cc32d5ebdf5eb5d56065008fcbbd (patch) | |
tree | a4f34ea4865b023ee55dfffb53208c8e5236b8d5 /drivers/regulator | |
parent | d271477568cd7447f2a065d0792001df3a9f270e (diff) |
regulator: tps65090: add wait_timeout support for FETx
Add platform data for wait_timeout value for FETx.
bug 1178161
Signed-off-by: Yen Lin <yelin@nvidia.com>
Change-Id: I12eedd48dd4bfcabfe3fa9ae08afff6399e94abf
Reviewed-on: http://git-master/r/167476
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Allen Martin <amartin@nvidia.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/tps65090-regulator.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/regulator/tps65090-regulator.c b/drivers/regulator/tps65090-regulator.c index 4d28dc1e73c4..003024091aa4 100644 --- a/drivers/regulator/tps65090-regulator.c +++ b/drivers/regulator/tps65090-regulator.c @@ -45,6 +45,7 @@ struct tps65090_regulator { bool enable_ext_control; int gpio; int gpio_state; + int wait_timeout_us; }; static inline struct device *to_tps65090_dev(struct regulator_dev *rdev) @@ -97,6 +98,27 @@ static int tps65090_reg_enable(struct regulator_dev *rdev) return 0; } + /* Setup wait_time for current limited timeout, WTFET[1:0]@bits[3:2] */ + if (ri->wait_timeout_us > 0) { + int wait_timeout = ri->wait_timeout_us; + u8 en_reg = ri->rinfo->reg_en_reg; + + if (wait_timeout <= 200) + ret = tps65090_update_bits(parent, en_reg, 0xc, 0x0); + else if (wait_timeout <= 800) + ret = tps65090_update_bits(parent, en_reg, 0xc, 0x4); + else if (wait_timeout <= 1600) + ret = tps65090_update_bits(parent, en_reg, 0xc, 0x8); + else + ret = tps65090_update_bits(parent, en_reg, 0xc, 0xc); + + if (ret < 0) { + dev_err(&rdev->dev, "Error updating reg 0x%x WTFET\n", + en_reg); + return ret; + } + } + ret = tps65090_set_bits(parent, ri->rinfo->reg_en_reg, ri->rinfo->en_bit); if (ret < 0) @@ -289,6 +311,7 @@ static int __devinit tps65090_regulator_probe(struct platform_device *pdev) ri = &pmic[num]; ri->dev = &pdev->dev; ri->rinfo = rinfo; + ri->wait_timeout_us = tps_pdata->wait_timeout_us; if (is_dcdc(id)) { ret = tps65090_regulator_preinit(id, ri, tps_pdata); |