mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] regulator: TPS659038: Fixes for REGEN2 and REGEN3
@ 2015-03-17 10:26 Keerthy
  2015-03-17 10:26 ` [PATCH 1/2] regulator: palmas: Correct TPS659038 register definition for REGEN2 Keerthy
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Keerthy @ 2015-03-17 10:26 UTC (permalink / raw)
  To: broonie, sameo, lee.jones; +Cc: linux-kernel, linux-omap, j-keerthy

The series fixes couple of issues in the driver w.r.t TPS659038 PMICs.
1) Correcting the REGEN2_CTRL address.
2) REGEN3 is not present hence adding a check not to register for TPS659038.

Tested for the regulator enumerations on DRA7 and BEAGLE-X15 boards. 

Keerthy (2):
  regulator: palmas: Correct TPS659038 register definition for REGEN2
  regulator: Palmas: Add has_regen3 check for TPS659038

 drivers/regulator/palmas-regulator.c | 11 +++++++++++
 include/linux/mfd/palmas.h           |  4 ++++
 2 files changed, 15 insertions(+)

-- 
1.9.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] regulator: palmas: Correct TPS659038 register definition for REGEN2
  2015-03-17 10:26 [PATCH 0/2] regulator: TPS659038: Fixes for REGEN2 and REGEN3 Keerthy
@ 2015-03-17 10:26 ` Keerthy
  2015-03-17 10:26 ` [PATCH 2/2] regulator: Palmas: Add has_regen3 check for TPS659038 Keerthy
  2015-03-17 12:21 ` [PATCH 0/2] regulator: TPS659038: Fixes for REGEN2 and REGEN3 Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Keerthy @ 2015-03-17 10:26 UTC (permalink / raw)
  To: broonie, sameo, lee.jones; +Cc: linux-kernel, linux-omap, j-keerthy

The register offset for REGEN2_CTRL in different for TPS659038 chip as when
compared with other Palmas family PMICs. In the case of TPS659038 the wrong
offset pointed to PLLEN_CTRL and was causing a hang. Correcting the same.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
Tested for the regulator enumerations on DRA7 and BEAGLE-X15 boards.
No Hang observed.

 drivers/regulator/palmas-regulator.c | 4 ++++
 include/linux/mfd/palmas.h           | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
index 9205f43..1819831 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -1572,6 +1572,10 @@ static int palmas_regulators_probe(struct platform_device *pdev)
 	if (!pmic)
 		return -ENOMEM;
 
+	if (of_device_is_compatible(node, "ti,tps659038-pmic"))
+		palmas_generic_regs_info[PALMAS_REG_REGEN2].ctrl_addr =
+							TPS659038_REGEN2_CTRL;
+
 	pmic->dev = &pdev->dev;
 	pmic->palmas = palmas;
 	palmas->pmic = pmic;
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
index fb0390a..ee7b1ce 100644
--- a/include/linux/mfd/palmas.h
+++ b/include/linux/mfd/palmas.h
@@ -2999,6 +2999,9 @@ enum usb_irq_events {
 #define PALMAS_GPADC_TRIM15					0x0E
 #define PALMAS_GPADC_TRIM16					0x0F
 
+/* TPS659038 regen2_ctrl offset iss different from palmas */
+#define TPS659038_REGEN2_CTRL					0x12
+
 /* TPS65917 Interrupt registers */
 
 /* Registers for function INTERRUPT */
-- 
1.9.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] regulator: Palmas: Add has_regen3 check for TPS659038
  2015-03-17 10:26 [PATCH 0/2] regulator: TPS659038: Fixes for REGEN2 and REGEN3 Keerthy
  2015-03-17 10:26 ` [PATCH 1/2] regulator: palmas: Correct TPS659038 register definition for REGEN2 Keerthy
@ 2015-03-17 10:26 ` Keerthy
  2015-03-17 12:21 ` [PATCH 0/2] regulator: TPS659038: Fixes for REGEN2 and REGEN3 Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Keerthy @ 2015-03-17 10:26 UTC (permalink / raw)
  To: broonie, sameo, lee.jones; +Cc: linux-kernel, linux-omap, j-keerthy

Palmas driver is used to cater to even TPS659038 but TPS659038 does not have
REGEN3 resource. Adding another field in the driver data to check on that.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
Tested for the regulator enumerations on DRA7 and BEAGLE-X15 boards.

REGEN3 is rightly not registered on TPS659038.

 drivers/regulator/palmas-regulator.c | 9 ++++++++-
 include/linux/mfd/palmas.h           | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
index 1819831..a3c56b6 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -916,6 +916,9 @@ static int palmas_ldo_registration(struct palmas_pmic *pmic,
 			    (id == PALMAS_REG_LDO6))
 				desc->enable_time = 2000;
 		} else {
+			if (!ddata->has_regen3 && id == PALMAS_REG_REGEN3)
+				continue;
+
 			desc->n_voltages = 1;
 			if (reg_init && reg_init->roof_floor)
 				desc->ops = &palmas_ops_ext_control_extreg;
@@ -1398,6 +1401,7 @@ static struct palmas_pmic_driver_data palmas_ddata = {
 	.ldo_begin = PALMAS_REG_LDO1,
 	.ldo_end = PALMAS_REG_LDOUSB,
 	.max_reg = PALMAS_NUM_REGS,
+	.has_regen3 = true,
 	.palmas_regs_info = palmas_generic_regs_info,
 	.palmas_matches = palmas_matches,
 	.sleep_req_info = palma_sleep_req_info,
@@ -1411,6 +1415,7 @@ static struct palmas_pmic_driver_data tps65917_ddata = {
 	.ldo_begin = TPS65917_REG_LDO1,
 	.ldo_end = TPS65917_REG_LDO5,
 	.max_reg = TPS65917_NUM_REGS,
+	.has_regen3 = true,
 	.palmas_regs_info = tps65917_regs_info,
 	.palmas_matches = tps65917_matches,
 	.sleep_req_info = tps65917_sleep_req_info,
@@ -1572,9 +1577,11 @@ static int palmas_regulators_probe(struct platform_device *pdev)
 	if (!pmic)
 		return -ENOMEM;
 
-	if (of_device_is_compatible(node, "ti,tps659038-pmic"))
+	if (of_device_is_compatible(node, "ti,tps659038-pmic")) {
 		palmas_generic_regs_info[PALMAS_REG_REGEN2].ctrl_addr =
 							TPS659038_REGEN2_CTRL;
+		palmas_ddata.has_regen3 = false;
+	}
 
 	pmic->dev = &pdev->dev;
 	pmic->palmas = palmas;
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
index ee7b1ce..bb270bd 100644
--- a/include/linux/mfd/palmas.h
+++ b/include/linux/mfd/palmas.h
@@ -117,6 +117,7 @@ struct palmas_pmic_driver_data {
 	int ldo_begin;
 	int ldo_end;
 	int max_reg;
+	bool has_regen3;
 	struct palmas_regs_info *palmas_regs_info;
 	struct of_regulator_match *palmas_matches;
 	struct palmas_sleep_requestor_info *sleep_req_info;
-- 
1.9.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] regulator: TPS659038: Fixes for REGEN2 and REGEN3
  2015-03-17 10:26 [PATCH 0/2] regulator: TPS659038: Fixes for REGEN2 and REGEN3 Keerthy
  2015-03-17 10:26 ` [PATCH 1/2] regulator: palmas: Correct TPS659038 register definition for REGEN2 Keerthy
  2015-03-17 10:26 ` [PATCH 2/2] regulator: Palmas: Add has_regen3 check for TPS659038 Keerthy
@ 2015-03-17 12:21 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2015-03-17 12:21 UTC (permalink / raw)
  To: Keerthy; +Cc: sameo, lee.jones, linux-kernel, linux-omap

[-- Attachment #1: Type: text/plain, Size: 482 bytes --]

On Tue, Mar 17, 2015 at 03:56:03PM +0530, Keerthy wrote:
> The series fixes couple of issues in the driver w.r.t TPS659038 PMICs.
> 1) Correcting the REGEN2_CTRL address.
> 2) REGEN3 is not present hence adding a check not to register for TPS659038.

Applied both, thanks.  

>   regulator: palmas: Correct TPS659038 register definition for REGEN2
>   regulator: Palmas: Add has_regen3 check for TPS659038

Please try to keep the style of the subject lines consistent...

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-03-17 12:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-17 10:26 [PATCH 0/2] regulator: TPS659038: Fixes for REGEN2 and REGEN3 Keerthy
2015-03-17 10:26 ` [PATCH 1/2] regulator: palmas: Correct TPS659038 register definition for REGEN2 Keerthy
2015-03-17 10:26 ` [PATCH 2/2] regulator: Palmas: Add has_regen3 check for TPS659038 Keerthy
2015-03-17 12:21 ` [PATCH 0/2] regulator: TPS659038: Fixes for REGEN2 and REGEN3 Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®