aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavikumar Kattekola2017-05-30 04:12:52 -0500
committerSekhar Nori2017-05-31 01:31:27 -0500
commit2d1a3449e55ad2084cb9d082f7e0f354c3edaa32 (patch)
treebc14f4117165ac5465c663a327f0f8209c409094
parent4276f25ae82676506948cd49691c07a8198e1ac5 (diff)
downloadkernel-audio-2d1a3449e55ad2084cb9d082f7e0f354c3edaa32.tar.gz
kernel-audio-2d1a3449e55ad2084cb9d082f7e0f354c3edaa32.tar.xz
kernel-audio-2d1a3449e55ad2084cb9d082f7e0f354c3edaa32.zip
regulator: pbias: Select voltage table based on max-voltage
Reference manuals of OMAP5x and DRA7x have been updated to reflect the PBIAS regulator max-voltage as 3.3V instead of 3.0V, while OMAP3x and OMAP4x are still quoting 3.0V. So, as of now, the pbias driver needs to support both 3.0V and 3.3V IO voltage based on the max-voltage supported by the PBIAS regulator. Document reference: SWPU249AF - OMAP543x Technical reference manual - August 2016 SPRUI30C – DRA75x, DRA74x Technical reference manual November 2016 Tested on: DRA75x PG 2.0 REV H EVM Signed-off-by: Ravikumar Kattekola <rk@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
-rw-r--r--drivers/regulator/pbias-regulator.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/regulator/pbias-regulator.c b/drivers/regulator/pbias-regulator.c
index f9d74d63be7c..1f81f0a30527 100644
--- a/drivers/regulator/pbias-regulator.c
+++ b/drivers/regulator/pbias-regulator.c
@@ -34,6 +34,8 @@ struct pbias_reg_info {
34 u32 vmode; 34 u32 vmode;
35 unsigned int enable_time; 35 unsigned int enable_time;
36 char *name; 36 char *name;
37 const unsigned int *pbias_volt_table;
38 int n_voltages;
37}; 39};
38 40
39struct pbias_regulator_data { 41struct pbias_regulator_data {
@@ -49,11 +51,16 @@ struct pbias_of_data {
49 unsigned int offset; 51 unsigned int offset;
50}; 52};
51 53
52static const unsigned int pbias_volt_table[] = { 54static const unsigned int pbias_volt_table_3_0V[] = {
53 1800000, 55 1800000,
54 3000000 56 3000000
55}; 57};
56 58
59static const unsigned int pbias_volt_table_3_3V[] = {
60 1800000,
61 3300000
62};
63
57static struct regulator_ops pbias_regulator_voltage_ops = { 64static struct regulator_ops pbias_regulator_voltage_ops = {
58 .list_voltage = regulator_list_voltage_table, 65 .list_voltage = regulator_list_voltage_table,
59 .get_voltage_sel = regulator_get_voltage_sel_regmap, 66 .get_voltage_sel = regulator_get_voltage_sel_regmap,
@@ -69,6 +76,8 @@ static const struct pbias_reg_info pbias_mmc_omap2430 = {
69 .vmode = BIT(0), 76 .vmode = BIT(0),
70 .disable_val = 0, 77 .disable_val = 0,
71 .enable_time = 100, 78 .enable_time = 100,
79 .pbias_volt_table = pbias_volt_table_3_0V,
80 .n_voltages = 2,
72 .name = "pbias_mmc_omap2430" 81 .name = "pbias_mmc_omap2430"
73}; 82};
74 83
@@ -77,6 +86,8 @@ static const struct pbias_reg_info pbias_sim_omap3 = {
77 .enable_mask = BIT(9), 86 .enable_mask = BIT(9),
78 .vmode = BIT(8), 87 .vmode = BIT(8),
79 .enable_time = 100, 88 .enable_time = 100,
89 .pbias_volt_table = pbias_volt_table_3_0V,
90 .n_voltages = 2,
80 .name = "pbias_sim_omap3" 91 .name = "pbias_sim_omap3"
81}; 92};
82 93
@@ -86,6 +97,8 @@ static const struct pbias_reg_info pbias_mmc_omap4 = {
86 .disable_val = BIT(25), 97 .disable_val = BIT(25),
87 .vmode = BIT(21), 98 .vmode = BIT(21),
88 .enable_time = 100, 99 .enable_time = 100,
100 .pbias_volt_table = pbias_volt_table_3_0V,
101 .n_voltages = 2,
89 .name = "pbias_mmc_omap4" 102 .name = "pbias_mmc_omap4"
90}; 103};
91 104
@@ -95,6 +108,8 @@ static const struct pbias_reg_info pbias_mmc_omap5 = {
95 .disable_val = BIT(25), 108 .disable_val = BIT(25),
96 .vmode = BIT(21), 109 .vmode = BIT(21),
97 .enable_time = 100, 110 .enable_time = 100,
111 .pbias_volt_table = pbias_volt_table_3_3V,
112 .n_voltages = 2,
98 .name = "pbias_mmc_omap5" 113 .name = "pbias_mmc_omap5"
99}; 114};
100 115
@@ -199,8 +214,8 @@ static int pbias_regulator_probe(struct platform_device *pdev)
199 drvdata[data_idx].desc.owner = THIS_MODULE; 214 drvdata[data_idx].desc.owner = THIS_MODULE;
200 drvdata[data_idx].desc.type = REGULATOR_VOLTAGE; 215 drvdata[data_idx].desc.type = REGULATOR_VOLTAGE;
201 drvdata[data_idx].desc.ops = &pbias_regulator_voltage_ops; 216 drvdata[data_idx].desc.ops = &pbias_regulator_voltage_ops;
202 drvdata[data_idx].desc.volt_table = pbias_volt_table; 217 drvdata[data_idx].desc.volt_table = info->pbias_volt_table;
203 drvdata[data_idx].desc.n_voltages = 2; 218 drvdata[data_idx].desc.n_voltages = info->n_voltages;
204 drvdata[data_idx].desc.enable_time = info->enable_time; 219 drvdata[data_idx].desc.enable_time = info->enable_time;
205 drvdata[data_idx].desc.vsel_reg = offset; 220 drvdata[data_idx].desc.vsel_reg = offset;
206 drvdata[data_idx].desc.vsel_mask = info->vmode; 221 drvdata[data_idx].desc.vsel_mask = info->vmode;