devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2 v2] Add support for cpcap regulators on Tegra devices.
@ 2018-07-23 19:38 Peter Geis
  2018-07-23 19:38 ` [PATCH 1/2 v2] Add sw2_sw4 voltage table to cpcap regulator Peter Geis
  2018-07-23 19:38 ` [PATCH 2/2 v2] Add support for CPCAP regulators on Tegra devices Peter Geis
  0 siblings, 2 replies; 6+ messages in thread
From: Peter Geis @ 2018-07-23 19:38 UTC (permalink / raw)
  To: broonie
  Cc: lgirdwood, robh+dt, linux-kernel, devicetree, linux-tegra, Peter Geis

Good Afternoon,

I am re-sending the whole patch set again.
I have sent this to myself, and confirmed it still patches cleanly.

I apologize once again.

The CPCAP regulator driver can support various devices, but currently only supports Omap4 devices.
Adds the sw2 and sw4 voltage tables, which power the Tegra core, and a DT match for the Tegra device.
Tested on the Motorola Xoom MZ602.

v2:
Stopped reinventing the wheel, using git email now.
Rebased against regulator for-next branch.

v1:
Fix conversion of tabulation to spaces.

Peter Geis (2):
  Add sw2_sw4 voltage table to cpcap regulator.
  Add support for CPCAP regulators on Tegra devices.

 .../bindings/regulator/cpcap-regulator.txt    |   1 +
 drivers/regulator/cpcap-regulator.c           | 103 ++++++++++++++++++
 2 files changed, 104 insertions(+)

-- 
2.17.1

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

* [PATCH 1/2 v2] Add sw2_sw4 voltage table to cpcap regulator.
  2018-07-23 19:38 [PATCH 0/2 v2] Add support for cpcap regulators on Tegra devices Peter Geis
@ 2018-07-23 19:38 ` Peter Geis
  2018-07-23 19:38 ` [PATCH 2/2 v2] Add support for CPCAP regulators on Tegra devices Peter Geis
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Geis @ 2018-07-23 19:38 UTC (permalink / raw)
  To: broonie
  Cc: lgirdwood, robh+dt, linux-kernel, devicetree, linux-tegra, Peter Geis

SW2 and SW4 use a shared table to provide voltage to the cpu core and
devices on Tegra hardware.
Added this table to the cpcap regulator driver as the first step to
supporting this device on Tegra.

Signed-off-by: Peter Geis <pgwipeout@gmail.com>
---
 drivers/regulator/cpcap-regulator.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/regulator/cpcap-regulator.c b/drivers/regulator/cpcap-regulator.c
index bd910fe123d9..c0b1e04bd90f 100644
--- a/drivers/regulator/cpcap-regulator.c
+++ b/drivers/regulator/cpcap-regulator.c
@@ -271,6 +271,29 @@ static struct regulator_ops cpcap_regulator_ops = {
 };
 
 static const unsigned int unknown_val_tbl[] = { 0, };
+static const unsigned int sw2_sw4_val_tbl[] = { 612500, 625000, 637500,
+						650000, 662500, 675000,
+						687500, 700000, 712500,
+						725000, 737500, 750000,
+						762500, 775000, 787500,
+						800000, 812500, 825000,
+						837500, 850000, 862500,
+						875000, 887500, 900000,
+						912500, 925000, 937500,
+						950000, 962500, 975000,
+						987500, 1000000, 1012500,
+						1025000, 1037500, 1050000,
+						1062500, 1075000, 1087500,
+						1100000, 1112500, 1125000,
+						1137500, 1150000, 1162500,
+						1175000, 1187500, 1200000,
+						1212500, 1225000, 1237500,
+						1250000, 1262500, 1275000,
+						1287500, 1300000, 1312500,
+						1325000, 1337500, 1350000,
+						1362500, 1375000, 1387500,
+						1400000, 1412500, 1425000,
+						1437500, 1450000, 1462500, };
 static const unsigned int sw5_val_tbl[] = { 0, 5050000, };
 static const unsigned int vcam_val_tbl[] = { 2600000, 2700000, 2800000,
 					     2900000, };
-- 
2.17.1

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

* [PATCH 2/2 v2] Add support for CPCAP regulators on Tegra devices.
  2018-07-23 19:38 [PATCH 0/2 v2] Add support for cpcap regulators on Tegra devices Peter Geis
  2018-07-23 19:38 ` [PATCH 1/2 v2] Add sw2_sw4 voltage table to cpcap regulator Peter Geis
@ 2018-07-23 19:38 ` Peter Geis
  2018-07-24  0:27   ` Dmitry Osipenko
  1 sibling, 1 reply; 6+ messages in thread
From: Peter Geis @ 2018-07-23 19:38 UTC (permalink / raw)
  To: broonie
  Cc: lgirdwood, robh+dt, linux-kernel, devicetree, linux-tegra, Peter Geis

Added support for the CPCAP power management regulator functions on
Tegra devices.
Added sw2_sw4 value tables, which provide power to the Tegra core and
aux devices.
Added the Tegra init tables and device tree compatibility match.

Signed-off-by: Peter Geis <pgwipeout@gmail.com>
---
 .../bindings/regulator/cpcap-regulator.txt    |  1 +
 drivers/regulator/cpcap-regulator.c           | 80 +++++++++++++++++++
 2 files changed, 81 insertions(+)

diff --git a/Documentation/devicetree/bindings/regulator/cpcap-regulator.txt b/Documentation/devicetree/bindings/regulator/cpcap-regulator.txt
index 675f4437ce92..3e2d33ab1731 100644
--- a/Documentation/devicetree/bindings/regulator/cpcap-regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/cpcap-regulator.txt
@@ -4,6 +4,7 @@ Motorola CPCAP PMIC voltage regulators
 Requires node properties:
 - "compatible" value one of:
     "motorola,cpcap-regulator"
+    "motorola,tegra-cpcap-regulator"
     "motorola,mapphone-cpcap-regulator"
 
 Required regulator properties:
diff --git a/drivers/regulator/cpcap-regulator.c b/drivers/regulator/cpcap-regulator.c
index c0b1e04bd90f..cb3774be445d 100644
--- a/drivers/regulator/cpcap-regulator.c
+++ b/drivers/regulator/cpcap-regulator.c
@@ -412,6 +412,82 @@ static struct cpcap_regulator omap4_regulators[] = {
 	{ /* sentinel */ },
 };
 
+static struct cpcap_regulator tegra_regulators[] = {
+	CPCAP_REG(SW1, CPCAP_REG_S1C1, CPCAP_REG_ASSIGN2,
+		  CPCAP_BIT_SW1_SEL, unknown_val_tbl,
+		  0, 0, 0, 0, 0, 0),
+	CPCAP_REG(SW2, CPCAP_REG_S2C1, CPCAP_REG_ASSIGN2,
+		  CPCAP_BIT_SW2_SEL, sw2_sw4_val_tbl,
+		  0xf00, 0x7f, 0, 0x800, 0, 120),
+	CPCAP_REG(SW3, CPCAP_REG_S3C, CPCAP_REG_ASSIGN2,
+		  CPCAP_BIT_SW3_SEL, unknown_val_tbl,
+		  0, 0, 0, 0, 0, 0),
+	CPCAP_REG(SW4, CPCAP_REG_S4C1, CPCAP_REG_ASSIGN2,
+		  CPCAP_BIT_SW4_SEL, sw2_sw4_val_tbl,
+		  0xf00, 0x7f, 0, 0x900, 0, 100),
+	CPCAP_REG(SW5, CPCAP_REG_S5C, CPCAP_REG_ASSIGN2,
+		  CPCAP_BIT_SW5_SEL, sw5_val_tbl,
+		  0x2a, 0, 0, 0x22, 0, 0),
+	CPCAP_REG(SW6, CPCAP_REG_S6C, CPCAP_REG_ASSIGN2,
+		  CPCAP_BIT_SW6_SEL, unknown_val_tbl,
+		  0, 0, 0, 0, 0, 0),
+	CPCAP_REG(VCAM, CPCAP_REG_VCAMC, CPCAP_REG_ASSIGN2,
+		  CPCAP_BIT_VCAM_SEL, vcam_val_tbl,
+		  0x87, 0x30, 4, 0x7, 0, 420),
+	CPCAP_REG(VCSI, CPCAP_REG_VCSIC, CPCAP_REG_ASSIGN3,
+		  CPCAP_BIT_VCSI_SEL, vcsi_val_tbl,
+		  0x47, 0x10, 4, 0x7, 0, 350),
+	CPCAP_REG(VDAC, CPCAP_REG_VDACC, CPCAP_REG_ASSIGN3,
+		  CPCAP_BIT_VDAC_SEL, vdac_val_tbl,
+		  0x87, 0x30, 4, 0x3, 0, 420),
+	CPCAP_REG(VDIG, CPCAP_REG_VDIGC, CPCAP_REG_ASSIGN2,
+		  CPCAP_BIT_VDIG_SEL, vdig_val_tbl,
+		  0x87, 0x30, 4, 0x5, 0, 420),
+	CPCAP_REG(VFUSE, CPCAP_REG_VFUSEC, CPCAP_REG_ASSIGN3,
+		  CPCAP_BIT_VFUSE_SEL, vfuse_val_tbl,
+		  0x80, 0xf, 0, 0x80, 0, 420),
+	CPCAP_REG(VHVIO, CPCAP_REG_VHVIOC, CPCAP_REG_ASSIGN3,
+		  CPCAP_BIT_VHVIO_SEL, vhvio_val_tbl,
+		  0x17, 0, 0, 0x2, 0, 0),
+	CPCAP_REG(VSDIO, CPCAP_REG_VSDIOC, CPCAP_REG_ASSIGN2,
+		  CPCAP_BIT_VSDIO_SEL, vsdio_val_tbl,
+		  0x87, 0x38, 3, 0x2, 0, 420),
+	CPCAP_REG(VPLL, CPCAP_REG_VPLLC, CPCAP_REG_ASSIGN3,
+		  CPCAP_BIT_VPLL_SEL, vpll_val_tbl,
+		  0x43, 0x18, 3, 0x1, 0, 420),
+	CPCAP_REG(VRF1, CPCAP_REG_VRF1C, CPCAP_REG_ASSIGN3,
+		  CPCAP_BIT_VRF1_SEL, vrf1_val_tbl,
+		  0xac, 0x2, 1, 0xc, 0, 10),
+	CPCAP_REG(VRF2, CPCAP_REG_VRF2C, CPCAP_REG_ASSIGN3,
+		  CPCAP_BIT_VRF2_SEL, vrf2_val_tbl,
+		  0x23, 0x8, 3, 0x3, 0, 10),
+	CPCAP_REG(VRFREF, CPCAP_REG_VRFREFC, CPCAP_REG_ASSIGN3,
+		  CPCAP_BIT_VRFREF_SEL, vrfref_val_tbl,
+		  0x23, 0x8, 3, 0x3, 0, 420),
+	CPCAP_REG(VWLAN1, CPCAP_REG_VWLAN1C, CPCAP_REG_ASSIGN3,
+		  CPCAP_BIT_VWLAN1_SEL, vwlan1_val_tbl,
+		  0x47, 0x10, 4, 0x5, 0, 420),
+	CPCAP_REG(VWLAN2, CPCAP_REG_VWLAN2C, CPCAP_REG_ASSIGN3,
+		  CPCAP_BIT_VWLAN2_SEL, vwlan2_val_tbl,
+		  0x20c, 0xc0, 6, 0x8, 0, 420),
+	CPCAP_REG(VSIM, CPCAP_REG_VSIMC, CPCAP_REG_ASSIGN3,
+		  0xffff, vsim_val_tbl,
+		  0x23, 0x8, 3, 0x3, 0, 420),
+	CPCAP_REG(VSIMCARD, CPCAP_REG_VSIMC, CPCAP_REG_ASSIGN3,
+		  0xffff, vsimcard_val_tbl,
+		  0x1e80, 0x8, 3, 0x1e00, 0, 420),
+	CPCAP_REG(VVIB, CPCAP_REG_VVIBC, CPCAP_REG_ASSIGN3,
+		  CPCAP_BIT_VVIB_SEL, vvib_val_tbl,
+		  0x1, 0xc, 2, 0, 0x1, 500),
+	CPCAP_REG(VUSB, CPCAP_REG_VUSBC, CPCAP_REG_ASSIGN3,
+		  CPCAP_BIT_VUSB_SEL, vusb_val_tbl,
+		  0x11c, 0x40, 6, 0xc, 0, 0),
+	CPCAP_REG(VAUDIO, CPCAP_REG_VAUDIOC, CPCAP_REG_ASSIGN4,
+		  CPCAP_BIT_VAUDIO_SEL, vaudio_val_tbl,
+		  0x16, 0x1, 0, 0x4, 0, 0),
+	{ /* sentinel */ },
+};
+
 static const struct of_device_id cpcap_regulator_id_table[] = {
 	{
 		.compatible = "motorola,cpcap-regulator",
@@ -420,6 +496,10 @@ static const struct of_device_id cpcap_regulator_id_table[] = {
 		.compatible = "motorola,mapphone-cpcap-regulator",
 		.data = omap4_regulators,
 	},
+	{
+		.compatible = "motorola,tegra-cpcap-regulator",
+		.data = tegra_regulators,
+	},
 	{},
 };
 MODULE_DEVICE_TABLE(of, cpcap_regulator_id_table);
-- 
2.17.1

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

* Re: [PATCH 2/2 v2] Add support for CPCAP regulators on Tegra devices.
  2018-07-23 19:38 ` [PATCH 2/2 v2] Add support for CPCAP regulators on Tegra devices Peter Geis
@ 2018-07-24  0:27   ` Dmitry Osipenko
  2018-07-24  1:57     ` Peter Geis
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Osipenko @ 2018-07-24  0:27 UTC (permalink / raw)
  To: Peter Geis
  Cc: broonie, lgirdwood, robh+dt, linux-kernel, devicetree, linux-tegra

On Monday, 23 July 2018 22:38:48 MSK Peter Geis wrote:
> Added support for the CPCAP power management regulator functions on
> Tegra devices.
> Added sw2_sw4 value tables, which provide power to the Tegra core and
> aux devices.
> Added the Tegra init tables and device tree compatibility match.
> 
> Signed-off-by: Peter Geis <pgwipeout@gmail.com>
> ---
>  .../bindings/regulator/cpcap-regulator.txt    |  1 +
>  drivers/regulator/cpcap-regulator.c           | 80 +++++++++++++++++++
>  2 files changed, 81 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/regulator/cpcap-regulator.txt
> b/Documentation/devicetree/bindings/regulator/cpcap-regulator.txt index
> 675f4437ce92..3e2d33ab1731 100644
> --- a/Documentation/devicetree/bindings/regulator/cpcap-regulator.txt
> +++ b/Documentation/devicetree/bindings/regulator/cpcap-regulator.txt
> @@ -4,6 +4,7 @@ Motorola CPCAP PMIC voltage regulators
>  Requires node properties:
>  - "compatible" value one of:
>      "motorola,cpcap-regulator"
> +    "motorola,tegra-cpcap-regulator"
>      "motorola,mapphone-cpcap-regulator"
> 
>  Required regulator properties:
> diff --git a/drivers/regulator/cpcap-regulator.c
> b/drivers/regulator/cpcap-regulator.c index c0b1e04bd90f..cb3774be445d
> 100644
> --- a/drivers/regulator/cpcap-regulator.c
> +++ b/drivers/regulator/cpcap-regulator.c
> @@ -412,6 +412,82 @@ static struct cpcap_regulator omap4_regulators[] = {
>  	{ /* sentinel */ },
>  };
> 
> +static struct cpcap_regulator tegra_regulators[] = {
> +	CPCAP_REG(SW1, CPCAP_REG_S1C1, CPCAP_REG_ASSIGN2,
> +		  CPCAP_BIT_SW1_SEL, unknown_val_tbl,
> +		  0, 0, 0, 0, 0, 0),
> +	CPCAP_REG(SW2, CPCAP_REG_S2C1, CPCAP_REG_ASSIGN2,
> +		  CPCAP_BIT_SW2_SEL, sw2_sw4_val_tbl,
> +		  0xf00, 0x7f, 0, 0x800, 0, 120),
> +	CPCAP_REG(SW3, CPCAP_REG_S3C, CPCAP_REG_ASSIGN2,
> +		  CPCAP_BIT_SW3_SEL, unknown_val_tbl,
> +		  0, 0, 0, 0, 0, 0),
> +	CPCAP_REG(SW4, CPCAP_REG_S4C1, CPCAP_REG_ASSIGN2,
> +		  CPCAP_BIT_SW4_SEL, sw2_sw4_val_tbl,
> +		  0xf00, 0x7f, 0, 0x900, 0, 100),
> +	CPCAP_REG(SW5, CPCAP_REG_S5C, CPCAP_REG_ASSIGN2,
> +		  CPCAP_BIT_SW5_SEL, sw5_val_tbl,
> +		  0x2a, 0, 0, 0x22, 0, 0),
> +	CPCAP_REG(SW6, CPCAP_REG_S6C, CPCAP_REG_ASSIGN2,
> +		  CPCAP_BIT_SW6_SEL, unknown_val_tbl,
> +		  0, 0, 0, 0, 0, 0),
> +	CPCAP_REG(VCAM, CPCAP_REG_VCAMC, CPCAP_REG_ASSIGN2,
> +		  CPCAP_BIT_VCAM_SEL, vcam_val_tbl,
> +		  0x87, 0x30, 4, 0x7, 0, 420),
> +	CPCAP_REG(VCSI, CPCAP_REG_VCSIC, CPCAP_REG_ASSIGN3,
> +		  CPCAP_BIT_VCSI_SEL, vcsi_val_tbl,
> +		  0x47, 0x10, 4, 0x7, 0, 350),
> +	CPCAP_REG(VDAC, CPCAP_REG_VDACC, CPCAP_REG_ASSIGN3,
> +		  CPCAP_BIT_VDAC_SEL, vdac_val_tbl,
> +		  0x87, 0x30, 4, 0x3, 0, 420),
> +	CPCAP_REG(VDIG, CPCAP_REG_VDIGC, CPCAP_REG_ASSIGN2,
> +		  CPCAP_BIT_VDIG_SEL, vdig_val_tbl,
> +		  0x87, 0x30, 4, 0x5, 0, 420),
> +	CPCAP_REG(VFUSE, CPCAP_REG_VFUSEC, CPCAP_REG_ASSIGN3,
> +		  CPCAP_BIT_VFUSE_SEL, vfuse_val_tbl,
> +		  0x80, 0xf, 0, 0x80, 0, 420),
> +	CPCAP_REG(VHVIO, CPCAP_REG_VHVIOC, CPCAP_REG_ASSIGN3,
> +		  CPCAP_BIT_VHVIO_SEL, vhvio_val_tbl,
> +		  0x17, 0, 0, 0x2, 0, 0),
> +	CPCAP_REG(VSDIO, CPCAP_REG_VSDIOC, CPCAP_REG_ASSIGN2,
> +		  CPCAP_BIT_VSDIO_SEL, vsdio_val_tbl,
> +		  0x87, 0x38, 3, 0x2, 0, 420),
> +	CPCAP_REG(VPLL, CPCAP_REG_VPLLC, CPCAP_REG_ASSIGN3,
> +		  CPCAP_BIT_VPLL_SEL, vpll_val_tbl,
> +		  0x43, 0x18, 3, 0x1, 0, 420),
> +	CPCAP_REG(VRF1, CPCAP_REG_VRF1C, CPCAP_REG_ASSIGN3,
> +		  CPCAP_BIT_VRF1_SEL, vrf1_val_tbl,
> +		  0xac, 0x2, 1, 0xc, 0, 10),
> +	CPCAP_REG(VRF2, CPCAP_REG_VRF2C, CPCAP_REG_ASSIGN3,
> +		  CPCAP_BIT_VRF2_SEL, vrf2_val_tbl,
> +		  0x23, 0x8, 3, 0x3, 0, 10),
> +	CPCAP_REG(VRFREF, CPCAP_REG_VRFREFC, CPCAP_REG_ASSIGN3,
> +		  CPCAP_BIT_VRFREF_SEL, vrfref_val_tbl,
> +		  0x23, 0x8, 3, 0x3, 0, 420),
> +	CPCAP_REG(VWLAN1, CPCAP_REG_VWLAN1C, CPCAP_REG_ASSIGN3,
> +		  CPCAP_BIT_VWLAN1_SEL, vwlan1_val_tbl,
> +		  0x47, 0x10, 4, 0x5, 0, 420),
> +	CPCAP_REG(VWLAN2, CPCAP_REG_VWLAN2C, CPCAP_REG_ASSIGN3,
> +		  CPCAP_BIT_VWLAN2_SEL, vwlan2_val_tbl,
> +		  0x20c, 0xc0, 6, 0x8, 0, 420),
> +	CPCAP_REG(VSIM, CPCAP_REG_VSIMC, CPCAP_REG_ASSIGN3,
> +		  0xffff, vsim_val_tbl,
> +		  0x23, 0x8, 3, 0x3, 0, 420),
> +	CPCAP_REG(VSIMCARD, CPCAP_REG_VSIMC, CPCAP_REG_ASSIGN3,
> +		  0xffff, vsimcard_val_tbl,
> +		  0x1e80, 0x8, 3, 0x1e00, 0, 420),
> +	CPCAP_REG(VVIB, CPCAP_REG_VVIBC, CPCAP_REG_ASSIGN3,
> +		  CPCAP_BIT_VVIB_SEL, vvib_val_tbl,
> +		  0x1, 0xc, 2, 0, 0x1, 500),
> +	CPCAP_REG(VUSB, CPCAP_REG_VUSBC, CPCAP_REG_ASSIGN3,
> +		  CPCAP_BIT_VUSB_SEL, vusb_val_tbl,
> +		  0x11c, 0x40, 6, 0xc, 0, 0),
> +	CPCAP_REG(VAUDIO, CPCAP_REG_VAUDIOC, CPCAP_REG_ASSIGN4,
> +		  CPCAP_BIT_VAUDIO_SEL, vaudio_val_tbl,
> +		  0x16, 0x1, 0, 0x4, 0, 0),
> +	{ /* sentinel */ },
> +};
> +
>  static const struct of_device_id cpcap_regulator_id_table[] = {
>  	{
>  		.compatible = "motorola,cpcap-regulator",
> @@ -420,6 +496,10 @@ static const struct of_device_id
> cpcap_regulator_id_table[] = { .compatible =
> "motorola,mapphone-cpcap-regulator",
>  		.data = omap4_regulators,
>  	},
> +	{
> +		.compatible = "motorola,tegra-cpcap-regulator",
> +		.data = tegra_regulators,
> +	},
>  	{},
>  };
>  MODULE_DEVICE_TABLE(of, cpcap_regulator_id_table);

Are those cpcap_regulator values really common for all Tegra's? Probably 
better to name the DT compatible like "motorola,xoom-cpcap-regulator" or 
"motorola,mz602-cpcap-regulator".

The DT binding documentation should be updated with the new compatible value 
in the Documentation/devicetree/bindings/regulator/cpcap-regulator.txt

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

* Re: [PATCH 2/2 v2] Add support for CPCAP regulators on Tegra devices.
  2018-07-24  0:27   ` Dmitry Osipenko
@ 2018-07-24  1:57     ` Peter Geis
  2018-07-24 11:14       ` Dmitry Osipenko
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Geis @ 2018-07-24  1:57 UTC (permalink / raw)
  To: Dmitry Osipenko
  Cc: broonie, lgirdwood, robh+dt, linux-kernel, devicetree, linux-tegra



On 07/23/2018 08:27 PM, Dmitry Osipenko wrote:
> On Monday, 23 July 2018 22:38:48 MSK Peter Geis wrote:
>> Added support for the CPCAP power management regulator functions on
>> Tegra devices.
>> Added sw2_sw4 value tables, which provide power to the Tegra core and
>> aux devices.
>> Added the Tegra init tables and device tree compatibility match.
>>
>> Signed-off-by: Peter Geis <pgwipeout@gmail.com>
>> ---
>>   .../bindings/regulator/cpcap-regulator.txt    |  1 +
>>   drivers/regulator/cpcap-regulator.c           | 80 +++++++++++++++++++
>>   2 files changed, 81 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/regulator/cpcap-regulator.txt
>> b/Documentation/devicetree/bindings/regulator/cpcap-regulator.txt index
>> 675f4437ce92..3e2d33ab1731 100644
>> --- a/Documentation/devicetree/bindings/regulator/cpcap-regulator.txt
>> +++ b/Documentation/devicetree/bindings/regulator/cpcap-regulator.txt
>> @@ -4,6 +4,7 @@ Motorola CPCAP PMIC voltage regulators
>>   Requires node properties:
>>   - "compatible" value one of:
>>       "motorola,cpcap-regulator"
>> +    "motorola,tegra-cpcap-regulator"
>>       "motorola,mapphone-cpcap-regulator"
>>
>>   Required regulator properties:
>> diff --git a/drivers/regulator/cpcap-regulator.c
>> b/drivers/regulator/cpcap-regulator.c index c0b1e04bd90f..cb3774be445d
>> 100644
>> --- a/drivers/regulator/cpcap-regulator.c
>> +++ b/drivers/regulator/cpcap-regulator.c
>> @@ -412,6 +412,82 @@ static struct cpcap_regulator omap4_regulators[] = {
>>   	{ /* sentinel */ },
>>   };
>>
>> +static struct cpcap_regulator tegra_regulators[] = {
>> +	CPCAP_REG(SW1, CPCAP_REG_S1C1, CPCAP_REG_ASSIGN2,
>> +		  CPCAP_BIT_SW1_SEL, unknown_val_tbl,
>> +		  0, 0, 0, 0, 0, 0),
>> +	CPCAP_REG(SW2, CPCAP_REG_S2C1, CPCAP_REG_ASSIGN2,
>> +		  CPCAP_BIT_SW2_SEL, sw2_sw4_val_tbl,
>> +		  0xf00, 0x7f, 0, 0x800, 0, 120),
>> +	CPCAP_REG(SW3, CPCAP_REG_S3C, CPCAP_REG_ASSIGN2,
>> +		  CPCAP_BIT_SW3_SEL, unknown_val_tbl,
>> +		  0, 0, 0, 0, 0, 0),
>> +	CPCAP_REG(SW4, CPCAP_REG_S4C1, CPCAP_REG_ASSIGN2,
>> +		  CPCAP_BIT_SW4_SEL, sw2_sw4_val_tbl,
>> +		  0xf00, 0x7f, 0, 0x900, 0, 100),
>> +	CPCAP_REG(SW5, CPCAP_REG_S5C, CPCAP_REG_ASSIGN2,
>> +		  CPCAP_BIT_SW5_SEL, sw5_val_tbl,
>> +		  0x2a, 0, 0, 0x22, 0, 0),
>> +	CPCAP_REG(SW6, CPCAP_REG_S6C, CPCAP_REG_ASSIGN2,
>> +		  CPCAP_BIT_SW6_SEL, unknown_val_tbl,
>> +		  0, 0, 0, 0, 0, 0),
>> +	CPCAP_REG(VCAM, CPCAP_REG_VCAMC, CPCAP_REG_ASSIGN2,
>> +		  CPCAP_BIT_VCAM_SEL, vcam_val_tbl,
>> +		  0x87, 0x30, 4, 0x7, 0, 420),
>> +	CPCAP_REG(VCSI, CPCAP_REG_VCSIC, CPCAP_REG_ASSIGN3,
>> +		  CPCAP_BIT_VCSI_SEL, vcsi_val_tbl,
>> +		  0x47, 0x10, 4, 0x7, 0, 350),
>> +	CPCAP_REG(VDAC, CPCAP_REG_VDACC, CPCAP_REG_ASSIGN3,
>> +		  CPCAP_BIT_VDAC_SEL, vdac_val_tbl,
>> +		  0x87, 0x30, 4, 0x3, 0, 420),
>> +	CPCAP_REG(VDIG, CPCAP_REG_VDIGC, CPCAP_REG_ASSIGN2,
>> +		  CPCAP_BIT_VDIG_SEL, vdig_val_tbl,
>> +		  0x87, 0x30, 4, 0x5, 0, 420),
>> +	CPCAP_REG(VFUSE, CPCAP_REG_VFUSEC, CPCAP_REG_ASSIGN3,
>> +		  CPCAP_BIT_VFUSE_SEL, vfuse_val_tbl,
>> +		  0x80, 0xf, 0, 0x80, 0, 420),
>> +	CPCAP_REG(VHVIO, CPCAP_REG_VHVIOC, CPCAP_REG_ASSIGN3,
>> +		  CPCAP_BIT_VHVIO_SEL, vhvio_val_tbl,
>> +		  0x17, 0, 0, 0x2, 0, 0),
>> +	CPCAP_REG(VSDIO, CPCAP_REG_VSDIOC, CPCAP_REG_ASSIGN2,
>> +		  CPCAP_BIT_VSDIO_SEL, vsdio_val_tbl,
>> +		  0x87, 0x38, 3, 0x2, 0, 420),
>> +	CPCAP_REG(VPLL, CPCAP_REG_VPLLC, CPCAP_REG_ASSIGN3,
>> +		  CPCAP_BIT_VPLL_SEL, vpll_val_tbl,
>> +		  0x43, 0x18, 3, 0x1, 0, 420),
>> +	CPCAP_REG(VRF1, CPCAP_REG_VRF1C, CPCAP_REG_ASSIGN3,
>> +		  CPCAP_BIT_VRF1_SEL, vrf1_val_tbl,
>> +		  0xac, 0x2, 1, 0xc, 0, 10),
>> +	CPCAP_REG(VRF2, CPCAP_REG_VRF2C, CPCAP_REG_ASSIGN3,
>> +		  CPCAP_BIT_VRF2_SEL, vrf2_val_tbl,
>> +		  0x23, 0x8, 3, 0x3, 0, 10),
>> +	CPCAP_REG(VRFREF, CPCAP_REG_VRFREFC, CPCAP_REG_ASSIGN3,
>> +		  CPCAP_BIT_VRFREF_SEL, vrfref_val_tbl,
>> +		  0x23, 0x8, 3, 0x3, 0, 420),
>> +	CPCAP_REG(VWLAN1, CPCAP_REG_VWLAN1C, CPCAP_REG_ASSIGN3,
>> +		  CPCAP_BIT_VWLAN1_SEL, vwlan1_val_tbl,
>> +		  0x47, 0x10, 4, 0x5, 0, 420),
>> +	CPCAP_REG(VWLAN2, CPCAP_REG_VWLAN2C, CPCAP_REG_ASSIGN3,
>> +		  CPCAP_BIT_VWLAN2_SEL, vwlan2_val_tbl,
>> +		  0x20c, 0xc0, 6, 0x8, 0, 420),
>> +	CPCAP_REG(VSIM, CPCAP_REG_VSIMC, CPCAP_REG_ASSIGN3,
>> +		  0xffff, vsim_val_tbl,
>> +		  0x23, 0x8, 3, 0x3, 0, 420),
>> +	CPCAP_REG(VSIMCARD, CPCAP_REG_VSIMC, CPCAP_REG_ASSIGN3,
>> +		  0xffff, vsimcard_val_tbl,
>> +		  0x1e80, 0x8, 3, 0x1e00, 0, 420),
>> +	CPCAP_REG(VVIB, CPCAP_REG_VVIBC, CPCAP_REG_ASSIGN3,
>> +		  CPCAP_BIT_VVIB_SEL, vvib_val_tbl,
>> +		  0x1, 0xc, 2, 0, 0x1, 500),
>> +	CPCAP_REG(VUSB, CPCAP_REG_VUSBC, CPCAP_REG_ASSIGN3,
>> +		  CPCAP_BIT_VUSB_SEL, vusb_val_tbl,
>> +		  0x11c, 0x40, 6, 0xc, 0, 0),
>> +	CPCAP_REG(VAUDIO, CPCAP_REG_VAUDIOC, CPCAP_REG_ASSIGN4,
>> +		  CPCAP_BIT_VAUDIO_SEL, vaudio_val_tbl,
>> +		  0x16, 0x1, 0, 0x4, 0, 0),
>> +	{ /* sentinel */ },
>> +};
>> +
>>   static const struct of_device_id cpcap_regulator_id_table[] = {
>>   	{
>>   		.compatible = "motorola,cpcap-regulator",
>> @@ -420,6 +496,10 @@ static const struct of_device_id
>> cpcap_regulator_id_table[] = { .compatible =
>> "motorola,mapphone-cpcap-regulator",
>>   		.data = omap4_regulators,
>>   	},
>> +	{
>> +		.compatible = "motorola,tegra-cpcap-regulator",
>> +		.data = tegra_regulators,
>> +	},
>>   	{},
>>   };
>>   MODULE_DEVICE_TABLE(of, cpcap_regulator_id_table);
> 
> Are those cpcap_regulator values really common for all Tegra's? Probably
> better to name the DT compatible like "motorola,xoom-cpcap-regulator" or
> "motorola,mz602-cpcap-regulator".
> 
> The DT binding documentation should be updated with the new compatible value
> in the Documentation/devicetree/bindings/regulator/cpcap-regulator.txt
> 

I see your point, from my research the only other device that ever 
paired a Tegra with a cpcap was the Atrix 4g, and it has completely 
different values.
For now I will change the value to "motorola,xoom-cpcap-regulator", 
since these values are common across the entire Xoom line.
The DT binding documentation was updated as part of this patch, it will 
be adjusted to the new value.

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

* Re: [PATCH 2/2 v2] Add support for CPCAP regulators on Tegra devices.
  2018-07-24  1:57     ` Peter Geis
@ 2018-07-24 11:14       ` Dmitry Osipenko
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Osipenko @ 2018-07-24 11:14 UTC (permalink / raw)
  To: Peter Geis
  Cc: broonie, lgirdwood, robh+dt, linux-kernel, devicetree, linux-tegra

On Tuesday, 24 July 2018 04:57:24 MSK Peter Geis wrote:
> On 07/23/2018 08:27 PM, Dmitry Osipenko wrote:
> > On Monday, 23 July 2018 22:38:48 MSK Peter Geis wrote:
> >> Added support for the CPCAP power management regulator functions on
> >> Tegra devices.
> >> Added sw2_sw4 value tables, which provide power to the Tegra core and
> >> aux devices.
> >> Added the Tegra init tables and device tree compatibility match.
> >> 
> >> Signed-off-by: Peter Geis <pgwipeout@gmail.com>
> >> ---
> >> 
> >>   .../bindings/regulator/cpcap-regulator.txt    |  1 +
> >>   drivers/regulator/cpcap-regulator.c           | 80 +++++++++++++++++++
> >>   2 files changed, 81 insertions(+)
> >> 
> >> diff --git
> >> a/Documentation/devicetree/bindings/regulator/cpcap-regulator.txt
> >> b/Documentation/devicetree/bindings/regulator/cpcap-regulator.txt index
> >> 675f4437ce92..3e2d33ab1731 100644
> >> --- a/Documentation/devicetree/bindings/regulator/cpcap-regulator.txt
> >> +++ b/Documentation/devicetree/bindings/regulator/cpcap-regulator.txt
> >> @@ -4,6 +4,7 @@ Motorola CPCAP PMIC voltage regulators
> >> 
> >>   Requires node properties:
> >>   
> >>   - "compatible" value one of:
> >>       "motorola,cpcap-regulator"
> >> 
> >> +    "motorola,tegra-cpcap-regulator"
> >> 
> >>       "motorola,mapphone-cpcap-regulator"
> >>   
> >>   Required regulator properties:
> >> diff --git a/drivers/regulator/cpcap-regulator.c
> >> b/drivers/regulator/cpcap-regulator.c index c0b1e04bd90f..cb3774be445d
> >> 100644
> >> --- a/drivers/regulator/cpcap-regulator.c
> >> +++ b/drivers/regulator/cpcap-regulator.c
> >> @@ -412,6 +412,82 @@ static struct cpcap_regulator omap4_regulators[] = {
> >> 
> >>   	{ /* sentinel */ },
> >>   
> >>   };
> >> 
> >> +static struct cpcap_regulator tegra_regulators[] = {
> >> +	CPCAP_REG(SW1, CPCAP_REG_S1C1, CPCAP_REG_ASSIGN2,
> >> +		  CPCAP_BIT_SW1_SEL, unknown_val_tbl,
> >> +		  0, 0, 0, 0, 0, 0),
> >> +	CPCAP_REG(SW2, CPCAP_REG_S2C1, CPCAP_REG_ASSIGN2,
> >> +		  CPCAP_BIT_SW2_SEL, sw2_sw4_val_tbl,
> >> +		  0xf00, 0x7f, 0, 0x800, 0, 120),
> >> +	CPCAP_REG(SW3, CPCAP_REG_S3C, CPCAP_REG_ASSIGN2,
> >> +		  CPCAP_BIT_SW3_SEL, unknown_val_tbl,
> >> +		  0, 0, 0, 0, 0, 0),
> >> +	CPCAP_REG(SW4, CPCAP_REG_S4C1, CPCAP_REG_ASSIGN2,
> >> +		  CPCAP_BIT_SW4_SEL, sw2_sw4_val_tbl,
> >> +		  0xf00, 0x7f, 0, 0x900, 0, 100),
> >> +	CPCAP_REG(SW5, CPCAP_REG_S5C, CPCAP_REG_ASSIGN2,
> >> +		  CPCAP_BIT_SW5_SEL, sw5_val_tbl,
> >> +		  0x2a, 0, 0, 0x22, 0, 0),
> >> +	CPCAP_REG(SW6, CPCAP_REG_S6C, CPCAP_REG_ASSIGN2,
> >> +		  CPCAP_BIT_SW6_SEL, unknown_val_tbl,
> >> +		  0, 0, 0, 0, 0, 0),
> >> +	CPCAP_REG(VCAM, CPCAP_REG_VCAMC, CPCAP_REG_ASSIGN2,
> >> +		  CPCAP_BIT_VCAM_SEL, vcam_val_tbl,
> >> +		  0x87, 0x30, 4, 0x7, 0, 420),
> >> +	CPCAP_REG(VCSI, CPCAP_REG_VCSIC, CPCAP_REG_ASSIGN3,
> >> +		  CPCAP_BIT_VCSI_SEL, vcsi_val_tbl,
> >> +		  0x47, 0x10, 4, 0x7, 0, 350),
> >> +	CPCAP_REG(VDAC, CPCAP_REG_VDACC, CPCAP_REG_ASSIGN3,
> >> +		  CPCAP_BIT_VDAC_SEL, vdac_val_tbl,
> >> +		  0x87, 0x30, 4, 0x3, 0, 420),
> >> +	CPCAP_REG(VDIG, CPCAP_REG_VDIGC, CPCAP_REG_ASSIGN2,
> >> +		  CPCAP_BIT_VDIG_SEL, vdig_val_tbl,
> >> +		  0x87, 0x30, 4, 0x5, 0, 420),
> >> +	CPCAP_REG(VFUSE, CPCAP_REG_VFUSEC, CPCAP_REG_ASSIGN3,
> >> +		  CPCAP_BIT_VFUSE_SEL, vfuse_val_tbl,
> >> +		  0x80, 0xf, 0, 0x80, 0, 420),
> >> +	CPCAP_REG(VHVIO, CPCAP_REG_VHVIOC, CPCAP_REG_ASSIGN3,
> >> +		  CPCAP_BIT_VHVIO_SEL, vhvio_val_tbl,
> >> +		  0x17, 0, 0, 0x2, 0, 0),
> >> +	CPCAP_REG(VSDIO, CPCAP_REG_VSDIOC, CPCAP_REG_ASSIGN2,
> >> +		  CPCAP_BIT_VSDIO_SEL, vsdio_val_tbl,
> >> +		  0x87, 0x38, 3, 0x2, 0, 420),
> >> +	CPCAP_REG(VPLL, CPCAP_REG_VPLLC, CPCAP_REG_ASSIGN3,
> >> +		  CPCAP_BIT_VPLL_SEL, vpll_val_tbl,
> >> +		  0x43, 0x18, 3, 0x1, 0, 420),
> >> +	CPCAP_REG(VRF1, CPCAP_REG_VRF1C, CPCAP_REG_ASSIGN3,
> >> +		  CPCAP_BIT_VRF1_SEL, vrf1_val_tbl,
> >> +		  0xac, 0x2, 1, 0xc, 0, 10),
> >> +	CPCAP_REG(VRF2, CPCAP_REG_VRF2C, CPCAP_REG_ASSIGN3,
> >> +		  CPCAP_BIT_VRF2_SEL, vrf2_val_tbl,
> >> +		  0x23, 0x8, 3, 0x3, 0, 10),
> >> +	CPCAP_REG(VRFREF, CPCAP_REG_VRFREFC, CPCAP_REG_ASSIGN3,
> >> +		  CPCAP_BIT_VRFREF_SEL, vrfref_val_tbl,
> >> +		  0x23, 0x8, 3, 0x3, 0, 420),
> >> +	CPCAP_REG(VWLAN1, CPCAP_REG_VWLAN1C, CPCAP_REG_ASSIGN3,
> >> +		  CPCAP_BIT_VWLAN1_SEL, vwlan1_val_tbl,
> >> +		  0x47, 0x10, 4, 0x5, 0, 420),
> >> +	CPCAP_REG(VWLAN2, CPCAP_REG_VWLAN2C, CPCAP_REG_ASSIGN3,
> >> +		  CPCAP_BIT_VWLAN2_SEL, vwlan2_val_tbl,
> >> +		  0x20c, 0xc0, 6, 0x8, 0, 420),
> >> +	CPCAP_REG(VSIM, CPCAP_REG_VSIMC, CPCAP_REG_ASSIGN3,
> >> +		  0xffff, vsim_val_tbl,
> >> +		  0x23, 0x8, 3, 0x3, 0, 420),
> >> +	CPCAP_REG(VSIMCARD, CPCAP_REG_VSIMC, CPCAP_REG_ASSIGN3,
> >> +		  0xffff, vsimcard_val_tbl,
> >> +		  0x1e80, 0x8, 3, 0x1e00, 0, 420),
> >> +	CPCAP_REG(VVIB, CPCAP_REG_VVIBC, CPCAP_REG_ASSIGN3,
> >> +		  CPCAP_BIT_VVIB_SEL, vvib_val_tbl,
> >> +		  0x1, 0xc, 2, 0, 0x1, 500),
> >> +	CPCAP_REG(VUSB, CPCAP_REG_VUSBC, CPCAP_REG_ASSIGN3,
> >> +		  CPCAP_BIT_VUSB_SEL, vusb_val_tbl,
> >> +		  0x11c, 0x40, 6, 0xc, 0, 0),
> >> +	CPCAP_REG(VAUDIO, CPCAP_REG_VAUDIOC, CPCAP_REG_ASSIGN4,
> >> +		  CPCAP_BIT_VAUDIO_SEL, vaudio_val_tbl,
> >> +		  0x16, 0x1, 0, 0x4, 0, 0),
> >> +	{ /* sentinel */ },
> >> +};
> >> +
> >> 
> >>   static const struct of_device_id cpcap_regulator_id_table[] = {
> >>   
> >>   	{
> >>   	
> >>   		.compatible = "motorola,cpcap-regulator",
> >> 
> >> @@ -420,6 +496,10 @@ static const struct of_device_id
> >> cpcap_regulator_id_table[] = { .compatible =
> >> "motorola,mapphone-cpcap-regulator",
> >> 
> >>   		.data = omap4_regulators,
> >>   	
> >>   	},
> >> 
> >> +	{
> >> +		.compatible = "motorola,tegra-cpcap-regulator",
> >> +		.data = tegra_regulators,
> >> +	},
> >> 
> >>   	{},
> >>   
> >>   };
> >>   MODULE_DEVICE_TABLE(of, cpcap_regulator_id_table);
> > 
> > Are those cpcap_regulator values really common for all Tegra's? Probably
> > better to name the DT compatible like "motorola,xoom-cpcap-regulator" or
> > "motorola,mz602-cpcap-regulator".
> > 
> > The DT binding documentation should be updated with the new compatible
> > value in the
> > Documentation/devicetree/bindings/regulator/cpcap-regulator.txt
> I see your point, from my research the only other device that ever
> paired a Tegra with a cpcap was the Atrix 4g, and it has completely
> different values.
> For now I will change the value to "motorola,xoom-cpcap-regulator",
> since these values are common across the entire Xoom line.
> The DT binding documentation was updated as part of this patch, it will
> be adjusted to the new value.

Now I see that you've updated the doc in this patch, thank you.

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

end of thread, other threads:[~2018-07-24 11:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-23 19:38 [PATCH 0/2 v2] Add support for cpcap regulators on Tegra devices Peter Geis
2018-07-23 19:38 ` [PATCH 1/2 v2] Add sw2_sw4 voltage table to cpcap regulator Peter Geis
2018-07-23 19:38 ` [PATCH 2/2 v2] Add support for CPCAP regulators on Tegra devices Peter Geis
2018-07-24  0:27   ` Dmitry Osipenko
2018-07-24  1:57     ` Peter Geis
2018-07-24 11:14       ` Dmitry Osipenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).