* [PATCH v2 1/2] regulator: tps6586x: Prepare supporting fixed regulators
@ 2014-05-20 10:14 Alban Bedel
2014-05-20 10:14 ` [PATCH v2 2/2] regulator: tps6586x: Add support for the TPS658640 Alban Bedel
0 siblings, 1 reply; 4+ messages in thread
From: Alban Bedel @ 2014-05-20 10:14 UTC (permalink / raw)
To: linux-kernel
Cc: Mark Brown, Liam Girdwood, Lee Jones, Samuel Ortiz, Alban Bedel
Add the required definitions and macros to allow easily adding fixed
regulators. This required for the TPS658640 that doesn't allow setting
the LDO_RTC output voltage.
Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
---
drivers/regulator/tps6586x-regulator.c | 27 ++++++++++++++++++++++-----
1 file changed, 22 insertions(+), 5 deletions(-)
diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c
index 32f38a6..da8ee02 100644
--- a/drivers/regulator/tps6586x-regulator.c
+++ b/drivers/regulator/tps6586x-regulator.c
@@ -68,7 +68,7 @@ static inline struct device *to_tps6586x_dev(struct regulator_dev *rdev)
return rdev_get_dev(rdev)->parent;
}
-static struct regulator_ops tps6586x_regulator_ops = {
+static struct regulator_ops tps6586x_rw_regulator_ops = {
.list_voltage = regulator_list_voltage_table,
.map_voltage = regulator_map_voltage_ascend,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
@@ -79,6 +79,16 @@ static struct regulator_ops tps6586x_regulator_ops = {
.disable = regulator_disable_regmap,
};
+static struct regulator_ops tps6586x_ro_regulator_ops = {
+ .list_voltage = regulator_list_voltage_table,
+ .map_voltage = regulator_map_voltage_ascend,
+ .get_voltage_sel = regulator_get_voltage_sel_regmap,
+
+ .is_enabled = regulator_is_enabled_regmap,
+ .enable = regulator_enable_regmap,
+ .disable = regulator_disable_regmap,
+};
+
static struct regulator_ops tps6586x_sys_regulator_ops = {
};
@@ -120,12 +130,12 @@ static const unsigned int tps6586x_dvm_voltages[] = {
1325000, 1350000, 1375000, 1400000, 1425000, 1450000, 1475000, 1500000,
};
-#define TPS6586X_REGULATOR(_id, _pin_name, vdata, vreg, shift, nbits, \
+#define TPS6586X_REGULATOR(_id, _ops, _pin_name, vdata, vreg, shift, nbits, \
ereg0, ebit0, ereg1, ebit1, goreg, gobit) \
.desc = { \
.supply_name = _pin_name, \
.name = "REG-" #_id, \
- .ops = &tps6586x_regulator_ops, \
+ .ops = &tps6586x_## _ops ## _regulator_ops, \
.type = REGULATOR_VOLTAGE, \
.id = TPS6586X_ID_##_id, \
.n_voltages = ARRAY_SIZE(vdata##_voltages), \
@@ -146,14 +156,21 @@ static const unsigned int tps6586x_dvm_voltages[] = {
#define TPS6586X_LDO(_id, _pname, vdata, vreg, shift, nbits, \
ereg0, ebit0, ereg1, ebit1) \
{ \
- TPS6586X_REGULATOR(_id, _pname, vdata, vreg, shift, nbits, \
+ TPS6586X_REGULATOR(_id, rw, _pname, vdata, vreg, shift, nbits, \
+ ereg0, ebit0, ereg1, ebit1, 0, 0) \
+}
+
+#define TPS6586X_FIXED_LDO(_id, _pname, vdata, vreg, shift, nbits, \
+ ereg0, ebit0, ereg1, ebit1) \
+{ \
+ TPS6586X_REGULATOR(_id, ro, _pname, vdata, vreg, shift, nbits, \
ereg0, ebit0, ereg1, ebit1, 0, 0) \
}
#define TPS6586X_DVM(_id, _pname, vdata, vreg, shift, nbits, \
ereg0, ebit0, ereg1, ebit1, goreg, gobit) \
{ \
- TPS6586X_REGULATOR(_id, _pname, vdata, vreg, shift, nbits, \
+ TPS6586X_REGULATOR(_id, rw, _pname, vdata, vreg, shift, nbits, \
ereg0, ebit0, ereg1, ebit1, goreg, gobit) \
}
--
1.9.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] regulator: tps6586x: Add support for the TPS658640
2014-05-20 10:14 [PATCH v2 1/2] regulator: tps6586x: Prepare supporting fixed regulators Alban Bedel
@ 2014-05-20 10:14 ` Alban Bedel
2014-05-20 12:14 ` Lee Jones
0 siblings, 1 reply; 4+ messages in thread
From: Alban Bedel @ 2014-05-20 10:14 UTC (permalink / raw)
To: linux-kernel
Cc: Mark Brown, Liam Girdwood, Lee Jones, Samuel Ortiz, Alban Bedel
The TPS658640 has a different set of output voltage for most LDO and
the RTC LDO isn't settable. This chip also report 2 different version
ID, as the datasheet doesn't list the possible values the second ID
has simply been named TPS658640v2.
Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
---
v2: Fixed the number of bits for the voltage selection of LDO_RTC
Removed superflous whitspace after the tps658640_regulator array
---
drivers/mfd/tps6586x.c | 4 ++++
drivers/regulator/tps6586x-regulator.c | 36 ++++++++++++++++++++++++++++++++++
include/linux/mfd/tps6586x.h | 2 ++
3 files changed, 42 insertions(+)
diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
index bbd5441..835e554 100644
--- a/drivers/mfd/tps6586x.c
+++ b/drivers/mfd/tps6586x.c
@@ -495,6 +495,10 @@ static void tps6586x_print_version(struct i2c_client *client, int version)
case TPS658623:
name = "TPS658623";
break;
+ case TPS658640:
+ case TPS658640v2:
+ name = "TPS658640";
+ break;
case TPS658643:
name = "TPS658643";
break;
diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c
index da8ee02..e045b7f 100644
--- a/drivers/regulator/tps6586x-regulator.c
+++ b/drivers/regulator/tps6586x-regulator.c
@@ -116,6 +116,13 @@ static const unsigned int tps6586x_sm2_voltages[] = {
4200000, 4250000, 4300000, 4350000, 4400000, 4450000, 4500000, 4550000,
};
+static int tps658640_sm2_voltages[] = {
+ 2150000, 2200000, 2250000, 2300000, 2350000, 2400000, 2450000, 2500000,
+ 2550000, 2600000, 2650000, 2700000, 2750000, 2800000, 2850000, 2900000,
+ 2950000, 3000000, 3050000, 3100000, 3150000, 3200000, 3250000, 3300000,
+ 3350000, 3400000, 3450000, 3500000, 3550000, 3600000, 3650000, 3700000,
+};
+
static const unsigned int tps658643_sm2_voltages[] = {
1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, 1200000,
1225000, 1250000, 1275000, 1300000, 1325000, 1350000, 1375000, 1400000,
@@ -130,6 +137,10 @@ static const unsigned int tps6586x_dvm_voltages[] = {
1325000, 1350000, 1375000, 1400000, 1425000, 1450000, 1475000, 1500000,
};
+static int tps658640_rtc_voltages[] = {
+ 2500000, 2850000, 3100000, 3300000,
+};
+
#define TPS6586X_REGULATOR(_id, _ops, _pin_name, vdata, vreg, shift, nbits, \
ereg0, ebit0, ereg1, ebit1, goreg, gobit) \
.desc = { \
@@ -224,6 +235,26 @@ static struct tps6586x_regulator tps658623_regulator[] = {
END, 7),
};
+static struct tps6586x_regulator tps658640_regulator[] = {
+ TPS6586X_LDO(LDO_3, "vinldo23", tps6586x_ldo0, SUPPLYV4, 0, 3,
+ ENC, 2, END, 2),
+ TPS6586X_LDO(LDO_5, "REG-SYS", tps6586x_ldo0, SUPPLYV6, 0, 3,
+ ENE, 6, ENE, 6),
+ TPS6586X_LDO(LDO_6, "vinldo678", tps6586x_ldo0, SUPPLYV3, 0, 3,
+ ENC, 4, END, 4),
+ TPS6586X_LDO(LDO_7, "vinldo678", tps6586x_ldo0, SUPPLYV3, 3, 3,
+ ENC, 5, END, 5),
+ TPS6586X_LDO(LDO_8, "vinldo678", tps6586x_ldo0, SUPPLYV2, 5, 3,
+ ENC, 6, END, 6),
+ TPS6586X_LDO(LDO_9, "vinldo9", tps6586x_ldo0, SUPPLYV6, 3, 3,
+ ENE, 7, ENE, 7),
+ TPS6586X_LDO(SM_2, "vin-sm2", tps658640_sm2, SUPPLYV2, 0, 5,
+ ENC, 7, END, 7),
+
+ TPS6586X_FIXED_LDO(LDO_RTC, "REG-SYS", tps658640_rtc, SUPPLYV4, 3, 2,
+ V4, 7, V4, 7),
+};
+
static struct tps6586x_regulator tps658643_regulator[] = {
TPS6586X_LDO(SM_2, "vin-sm2", tps658643_sm2, SUPPLYV2, 0, 5, ENC, 7,
END, 7),
@@ -312,6 +343,11 @@ static struct tps6586x_regulator *find_regulator_info(int id, int version)
table = tps658623_regulator;
num = ARRAY_SIZE(tps658623_regulator);
break;
+ case TPS658640:
+ case TPS658640v2:
+ table = tps658640_regulator;
+ num = ARRAY_SIZE(tps658640_regulator);
+ break;
case TPS658643:
table = tps658643_regulator;
num = ARRAY_SIZE(tps658643_regulator);
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h
index cbecec2..96187ed 100644
--- a/include/linux/mfd/tps6586x.h
+++ b/include/linux/mfd/tps6586x.h
@@ -17,6 +17,8 @@
#define TPS658621A 0x15
#define TPS658621CD 0x2c
#define TPS658623 0x1b
+#define TPS658640 0x01
+#define TPS658640v2 0x02
#define TPS658643 0x03
enum {
--
1.9.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 2/2] regulator: tps6586x: Add support for the TPS658640
2014-05-20 10:14 ` [PATCH v2 2/2] regulator: tps6586x: Add support for the TPS658640 Alban Bedel
@ 2014-05-20 12:14 ` Lee Jones
2014-05-26 15:54 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Lee Jones @ 2014-05-20 12:14 UTC (permalink / raw)
To: Alban Bedel; +Cc: linux-kernel, Mark Brown, Liam Girdwood, Samuel Ortiz
> The TPS658640 has a different set of output voltage for most LDO and
> the RTC LDO isn't settable. This chip also report 2 different version
> ID, as the datasheet doesn't list the possible values the second ID
> has simply been named TPS658640v2.
>
> Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
> ---
> v2: Fixed the number of bits for the voltage selection of LDO_RTC
> Removed superflous whitspace after the tps658640_regulator array
> ---
> drivers/mfd/tps6586x.c | 4 ++++
> drivers/regulator/tps6586x-regulator.c | 36 ++++++++++++++++++++++++++++++++++
> include/linux/mfd/tps6586x.h | 2 ++
> 3 files changed, 42 insertions(+)
MFD parts look okay to me.
Mark can you tag the branch and ping it over to me please?
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 2/2] regulator: tps6586x: Add support for the TPS658640
2014-05-20 12:14 ` Lee Jones
@ 2014-05-26 15:54 ` Mark Brown
0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2014-05-26 15:54 UTC (permalink / raw)
To: Lee Jones; +Cc: Alban Bedel, linux-kernel, Liam Girdwood, Samuel Ortiz
[-- Attachment #1: Type: text/plain, Size: 1198 bytes --]
On Tue, May 20, 2014 at 01:14:39PM +0100, Lee Jones wrote:
> MFD parts look okay to me.
> Mark can you tag the branch and ping it over to me please?
The following changes since commit c9eaa447e77efe77b7fa4c953bd62de8297fd6c5:
Linux 3.15-rc1 (2014-04-13 14:18:35 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git regulator-tps658640
for you to fetch changes up to 6c46ccc8bb0660c1805f6662d4646eb5405dcb2d:
regulator: tps6586x: Add support for the TPS658640 (2014-05-26 16:48:02 +0100)
----------------------------------------------------------------
regulator: Support newer revisions of tps658640
There are two different variants of the tps658640 with slightly
different feature sets.
----------------------------------------------------------------
Alban Bedel (2):
regulator: tps6586x: Prepare supporting fixed regulators
regulator: tps6586x: Add support for the TPS658640
drivers/mfd/tps6586x.c | 4 +++
drivers/regulator/tps6586x-regulator.c | 63 +++++++++++++++++++++++++++++++---
include/linux/mfd/tps6586x.h | 2 ++
3 files changed, 64 insertions(+), 5 deletions(-)
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-05-26 15:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-20 10:14 [PATCH v2 1/2] regulator: tps6586x: Prepare supporting fixed regulators Alban Bedel
2014-05-20 10:14 ` [PATCH v2 2/2] regulator: tps6586x: Add support for the TPS658640 Alban Bedel
2014-05-20 12:14 ` Lee Jones
2014-05-26 15:54 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome