diff options
| author | Kishon Vijay Abraham I <kishon@ti.com> | 2015-07-27 07:24:10 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2015-08-14 14:01:58 -0400 |
| commit | c329061be51bef655f28c9296093984c977aff85 (patch) | |
| tree | 105e1c08eff33caa32596f4ef23c4d765dffcaeb /drivers | |
| parent | bc0195aad0daa2ad5b0d76cce22b167bc3435590 (diff) | |
regulator: pbias: Fix broken pbias disable functionality
regulator_disable of pbias always writes '0' to the enable_reg.
However actual disable value of pbias regulator is not always '0'.
Fix it by populating the disable_val in pbias_reg_info for the
various platforms and assign it to the disable_val of
pbias regulator descriptor. This will be used by
regulator_disable_regmap while disabling pbias regulator.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/regulator/pbias-regulator.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/regulator/pbias-regulator.c b/drivers/regulator/pbias-regulator.c index bd2b75c0d1d1..4fa7bcaf454e 100644 --- a/drivers/regulator/pbias-regulator.c +++ b/drivers/regulator/pbias-regulator.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | struct pbias_reg_info { | 30 | struct pbias_reg_info { |
| 31 | u32 enable; | 31 | u32 enable; |
| 32 | u32 enable_mask; | 32 | u32 enable_mask; |
| 33 | u32 disable_val; | ||
| 33 | u32 vmode; | 34 | u32 vmode; |
| 34 | unsigned int enable_time; | 35 | unsigned int enable_time; |
| 35 | char *name; | 36 | char *name; |
| @@ -62,6 +63,7 @@ static const struct pbias_reg_info pbias_mmc_omap2430 = { | |||
| 62 | .enable = BIT(1), | 63 | .enable = BIT(1), |
| 63 | .enable_mask = BIT(1), | 64 | .enable_mask = BIT(1), |
| 64 | .vmode = BIT(0), | 65 | .vmode = BIT(0), |
| 66 | .disable_val = 0, | ||
| 65 | .enable_time = 100, | 67 | .enable_time = 100, |
| 66 | .name = "pbias_mmc_omap2430" | 68 | .name = "pbias_mmc_omap2430" |
| 67 | }; | 69 | }; |
| @@ -77,6 +79,7 @@ static const struct pbias_reg_info pbias_sim_omap3 = { | |||
| 77 | static const struct pbias_reg_info pbias_mmc_omap4 = { | 79 | static const struct pbias_reg_info pbias_mmc_omap4 = { |
| 78 | .enable = BIT(26) | BIT(22), | 80 | .enable = BIT(26) | BIT(22), |
| 79 | .enable_mask = BIT(26) | BIT(25) | BIT(22), | 81 | .enable_mask = BIT(26) | BIT(25) | BIT(22), |
| 82 | .disable_val = BIT(25), | ||
| 80 | .vmode = BIT(21), | 83 | .vmode = BIT(21), |
| 81 | .enable_time = 100, | 84 | .enable_time = 100, |
| 82 | .name = "pbias_mmc_omap4" | 85 | .name = "pbias_mmc_omap4" |
| @@ -85,6 +88,7 @@ static const struct pbias_reg_info pbias_mmc_omap4 = { | |||
| 85 | static const struct pbias_reg_info pbias_mmc_omap5 = { | 88 | static const struct pbias_reg_info pbias_mmc_omap5 = { |
| 86 | .enable = BIT(27) | BIT(26), | 89 | .enable = BIT(27) | BIT(26), |
| 87 | .enable_mask = BIT(27) | BIT(25) | BIT(26), | 90 | .enable_mask = BIT(27) | BIT(25) | BIT(26), |
| 91 | .disable_val = BIT(25), | ||
| 88 | .vmode = BIT(21), | 92 | .vmode = BIT(21), |
| 89 | .enable_time = 100, | 93 | .enable_time = 100, |
| 90 | .name = "pbias_mmc_omap5" | 94 | .name = "pbias_mmc_omap5" |
| @@ -159,6 +163,7 @@ static int pbias_regulator_probe(struct platform_device *pdev) | |||
| 159 | drvdata[data_idx].desc.enable_reg = res->start; | 163 | drvdata[data_idx].desc.enable_reg = res->start; |
| 160 | drvdata[data_idx].desc.enable_mask = info->enable_mask; | 164 | drvdata[data_idx].desc.enable_mask = info->enable_mask; |
| 161 | drvdata[data_idx].desc.enable_val = info->enable; | 165 | drvdata[data_idx].desc.enable_val = info->enable; |
| 166 | drvdata[data_idx].desc.disable_val = info->disable_val; | ||
| 162 | 167 | ||
| 163 | cfg.init_data = pbias_matches[idx].init_data; | 168 | cfg.init_data = pbias_matches[idx].init_data; |
| 164 | cfg.driver_data = &drvdata[data_idx]; | 169 | cfg.driver_data = &drvdata[data_idx]; |
