linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Add support for the Qualcomm PM8018 PMIC
@ 2016-06-17 10:22 Neil Armstrong
  2016-06-17 10:22 ` [PATCH 1/5] mfd: pm8921: Add support for pm8018 Neil Armstrong
                   ` (4 more replies)
  0 siblings, 5 replies; 20+ messages in thread
From: Neil Armstrong @ 2016-06-17 10:22 UTC (permalink / raw)
  To: dmitry.torokhov, andy.gross, david.brown, lee.jones, lgirdwood,
	broonie, a.zummo, alexandre.belloni
  Cc: Neil Armstrong, linux-input, linux-kernel, linux-arm-msm,
	linux-soc, rtc-linux

In order to support the Qualcomm MDM9615 in the Sierra Wireless WP8548
Modules, add the PM8018 PMIC support into MFD, Regulator, RTC and input.

This patchset is part of a global SoC + Module + Board support for the
Sierra Wireless mangOH Board support with the WP8548 module.

Neil Armstrong (5):
  mfd: pm8921: Add support for pm8018
  input: pmic8xxx-pwrkey: Add support for pm8018 pwrkey
  rtc: rtc-pm8xxx: Add support for pm8018 rtc
  mfd: qcom-rpm: Add support for pm8018 RPM Regulator
  regulator: qcom_rpm-regulator: Add support for pm8018 rpm regulator

 .../bindings/input/qcom,pm8xxx-pwrkey.txt          |   1 +
 .../devicetree/bindings/mfd/qcom-pm8xxx.txt        |   1 +
 Documentation/devicetree/bindings/mfd/qcom-rpm.txt |  15 +++
 drivers/input/misc/pmic8xxx-pwrkey.c               |   1 +
 drivers/mfd/pm8921-core.c                          |   1 +
 drivers/mfd/qcom_rpm.c                             |  45 +++++++
 drivers/regulator/qcom_rpm-regulator.c             | 134 +++++++++++++++++++++
 drivers/rtc/rtc-pm8xxx.c                           |  11 ++
 include/dt-bindings/mfd/qcom-rpm.h                 |  23 ++++
 9 files changed, 232 insertions(+)

-- 
1.9.1

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

* [PATCH 1/5] mfd: pm8921: Add support for pm8018
  2016-06-17 10:22 [PATCH 0/5] Add support for the Qualcomm PM8018 PMIC Neil Armstrong
@ 2016-06-17 10:22 ` Neil Armstrong
  2016-06-22  5:07   ` Bjorn Andersson
  2016-06-17 10:22 ` [PATCH 2/5] input: pmic8xxx-pwrkey: Add support for pm8018 pwrkey Neil Armstrong
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 20+ messages in thread
From: Neil Armstrong @ 2016-06-17 10:22 UTC (permalink / raw)
  To: dmitry.torokhov, andy.gross, david.brown, lee.jones, lgirdwood,
	broonie, a.zummo, alexandre.belloni
  Cc: Neil Armstrong, linux-input, linux-kernel, linux-arm-msm,
	linux-soc, rtc-linux

In order to support the Qualcomm MDM9615 PMIC, add support for the
pm8018 in pm8921 mfd driver.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/mfd/pm8921-core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mfd/pm8921-core.c b/drivers/mfd/pm8921-core.c
index 1b7ec08..0e3a2ea 100644
--- a/drivers/mfd/pm8921-core.c
+++ b/drivers/mfd/pm8921-core.c
@@ -309,6 +309,7 @@ static const struct regmap_config ssbi_regmap_config = {
 };
 
 static const struct of_device_id pm8921_id_table[] = {
+	{ .compatible = "qcom,pm8018", },
 	{ .compatible = "qcom,pm8058", },
 	{ .compatible = "qcom,pm8921", },
 	{ }
-- 
1.9.1

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

* [PATCH 2/5] input: pmic8xxx-pwrkey: Add support for pm8018 pwrkey
  2016-06-17 10:22 [PATCH 0/5] Add support for the Qualcomm PM8018 PMIC Neil Armstrong
  2016-06-17 10:22 ` [PATCH 1/5] mfd: pm8921: Add support for pm8018 Neil Armstrong
@ 2016-06-17 10:22 ` Neil Armstrong
  2016-06-18 16:21   ` Dmitry Torokhov
  2016-06-22  5:25   ` Bjorn Andersson
  2016-06-17 10:22 ` [PATCH 3/5] rtc: rtc-pm8xxx: Add support for pm8018 rtc Neil Armstrong
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 20+ messages in thread
From: Neil Armstrong @ 2016-06-17 10:22 UTC (permalink / raw)
  To: dmitry.torokhov, andy.gross, david.brown, lee.jones, lgirdwood,
	broonie, a.zummo, alexandre.belloni
  Cc: Neil Armstrong, linux-input, linux-kernel, linux-arm-msm,
	linux-soc, rtc-linux

In order to support pwrkey for Qualcomm MDM9615 SoC, add support
for the pm8018 pwrkey in pmic8xxx-pwrkey.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 Documentation/devicetree/bindings/input/qcom,pm8xxx-pwrkey.txt | 1 +
 drivers/input/misc/pmic8xxx-pwrkey.c                           | 1 +
 2 files changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/input/qcom,pm8xxx-pwrkey.txt b/Documentation/devicetree/bindings/input/qcom,pm8xxx-pwrkey.txt
index 588536c..9e530e2 100644
--- a/Documentation/devicetree/bindings/input/qcom,pm8xxx-pwrkey.txt
+++ b/Documentation/devicetree/bindings/input/qcom,pm8xxx-pwrkey.txt
@@ -8,6 +8,7 @@ PROPERTIES
 	Definition: must be one of:
 		    "qcom,pm8058-pwrkey"
 		    "qcom,pm8921-pwrkey"
+		    "qcom,pm8018-pwrkey"
 
 - reg:
 	Usage: required
diff --git a/drivers/input/misc/pmic8xxx-pwrkey.c b/drivers/input/misc/pmic8xxx-pwrkey.c
index 67aab86..f6f9b87 100644
--- a/drivers/input/misc/pmic8xxx-pwrkey.c
+++ b/drivers/input/misc/pmic8xxx-pwrkey.c
@@ -446,6 +446,7 @@ static int pmic8xxx_pwrkey_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id pm8xxx_pwr_key_id_table[] = {
+	{ .compatible = "qcom,pm8018-pwrkey", .data = &pm8921_pwrkey_shutdown },
 	{ .compatible = "qcom,pm8058-pwrkey", .data = &pm8058_pwrkey_shutdown },
 	{ .compatible = "qcom,pm8921-pwrkey", .data = &pm8921_pwrkey_shutdown },
 	{ }
-- 
1.9.1

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

* [PATCH 3/5] rtc: rtc-pm8xxx: Add support for pm8018 rtc
  2016-06-17 10:22 [PATCH 0/5] Add support for the Qualcomm PM8018 PMIC Neil Armstrong
  2016-06-17 10:22 ` [PATCH 1/5] mfd: pm8921: Add support for pm8018 Neil Armstrong
  2016-06-17 10:22 ` [PATCH 2/5] input: pmic8xxx-pwrkey: Add support for pm8018 pwrkey Neil Armstrong
@ 2016-06-17 10:22 ` Neil Armstrong
  2016-06-21 16:24   ` Alexandre Belloni
  2016-06-22  5:06   ` Bjorn Andersson
  2016-06-17 10:22 ` [PATCH 4/5] mfd: qcom-rpm: Add support for pm8018 RPM Regulator Neil Armstrong
  2016-06-17 10:22 ` [PATCH 5/5] regulator: qcom_rpm-regulator: Add support for pm8018 rpm regulator Neil Armstrong
  4 siblings, 2 replies; 20+ messages in thread
From: Neil Armstrong @ 2016-06-17 10:22 UTC (permalink / raw)
  To: dmitry.torokhov, andy.gross, david.brown, lee.jones, lgirdwood,
	broonie, a.zummo, alexandre.belloni
  Cc: Neil Armstrong, linux-input, linux-kernel, linux-arm-msm,
	linux-soc, rtc-linux

In order to support RTC on Qualcomm MDM9615 SoC, add support for
the pm8018 rtc in rtc-pm8xxx driver.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 Documentation/devicetree/bindings/mfd/qcom-pm8xxx.txt |  1 +
 drivers/rtc/rtc-pm8xxx.c                              | 11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.txt b/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.txt
index f24f334..37a088f 100644
--- a/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.txt
+++ b/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.txt
@@ -62,6 +62,7 @@ The below bindings specify the set of valid subnodes.
 		    "qcom,pm8058-rtc"
 		    "qcom,pm8921-rtc"
 		    "qcom,pm8941-rtc"
+		    "qcom,pm8018-rtc"
 
 - reg:
 	Usage: required
diff --git a/drivers/rtc/rtc-pm8xxx.c b/drivers/rtc/rtc-pm8xxx.c
index 795fcbd..976f5f6 100644
--- a/drivers/rtc/rtc-pm8xxx.c
+++ b/drivers/rtc/rtc-pm8xxx.c
@@ -393,6 +393,16 @@ static int pm8xxx_rtc_enable(struct pm8xxx_rtc *rtc_dd)
 	return 0;
 }
 
+static const struct pm8xxx_rtc_regs pm8018_regs = {
+	.ctrl		= 0x11d,
+	.write		= 0x11f,
+	.read		= 0x123,
+	.alarm_rw	= 0x127,
+	.alarm_ctrl	= 0x11d,
+	.alarm_ctrl2	= 0x11e,
+	.alarm_en	= BIT(1),
+};
+
 static const struct pm8xxx_rtc_regs pm8921_regs = {
 	.ctrl		= 0x11d,
 	.write		= 0x11f,
@@ -428,6 +438,7 @@ static const struct pm8xxx_rtc_regs pm8941_regs = {
  */
 static const struct of_device_id pm8xxx_id_table[] = {
 	{ .compatible = "qcom,pm8921-rtc", .data = &pm8921_regs },
+	{ .compatible = "qcom,pm8018-rtc", .data = &pm8018_regs },
 	{ .compatible = "qcom,pm8058-rtc", .data = &pm8058_regs },
 	{ .compatible = "qcom,pm8941-rtc", .data = &pm8941_regs },
 	{ },
-- 
1.9.1

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

* [PATCH 4/5] mfd: qcom-rpm: Add support for pm8018 RPM Regulator
  2016-06-17 10:22 [PATCH 0/5] Add support for the Qualcomm PM8018 PMIC Neil Armstrong
                   ` (2 preceding siblings ...)
  2016-06-17 10:22 ` [PATCH 3/5] rtc: rtc-pm8xxx: Add support for pm8018 rtc Neil Armstrong
@ 2016-06-17 10:22 ` Neil Armstrong
  2016-06-22  5:23   ` Bjorn Andersson
  2016-06-17 10:22 ` [PATCH 5/5] regulator: qcom_rpm-regulator: Add support for pm8018 rpm regulator Neil Armstrong
  4 siblings, 1 reply; 20+ messages in thread
From: Neil Armstrong @ 2016-06-17 10:22 UTC (permalink / raw)
  To: dmitry.torokhov, andy.gross, david.brown, lee.jones, lgirdwood,
	broonie, a.zummo, alexandre.belloni
  Cc: Neil Armstrong, linux-input, linux-kernel, linux-arm-msm,
	linux-soc, rtc-linux

In order to support the Qualcomm MDM9615 SoC, add support for the
RPM regulator entries in the qcom-rpm driver.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 Documentation/devicetree/bindings/mfd/qcom-rpm.txt |  1 +
 drivers/mfd/qcom_rpm.c                             | 45 ++++++++++++++++++++++
 include/dt-bindings/mfd/qcom-rpm.h                 | 23 +++++++++++
 3 files changed, 69 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/qcom-rpm.txt b/Documentation/devicetree/bindings/mfd/qcom-rpm.txt
index b98b291..72d68d4 100644
--- a/Documentation/devicetree/bindings/mfd/qcom-rpm.txt
+++ b/Documentation/devicetree/bindings/mfd/qcom-rpm.txt
@@ -13,6 +13,7 @@ frequencies.
 		    "qcom,rpm-msm8660"
 		    "qcom,rpm-msm8960"
 		    "qcom,rpm-ipq8064"
+		    "qcom,rpm-mdm9615"
 
 - reg:
 	Usage: required
diff --git a/drivers/mfd/qcom_rpm.c b/drivers/mfd/qcom_rpm.c
index 1be47ad..81d78fb 100644
--- a/drivers/mfd/qcom_rpm.c
+++ b/drivers/mfd/qcom_rpm.c
@@ -364,11 +364,56 @@ static const struct qcom_rpm_data ipq806x_template = {
 	.n_resources = ARRAY_SIZE(ipq806x_rpm_resource_table),
 };
 
+static const struct qcom_rpm_resource mdm9615_rpm_resource_table[] = {
+	[QCOM_RPM_CXO_CLK] =			{ 25, 9, 5, 1 },
+	[QCOM_RPM_SYS_FABRIC_CLK] =		{ 26, 10, 9, 1 },
+	[QCOM_RPM_DAYTONA_FABRIC_CLK] =		{ 27, 11, 11, 1 },
+	[QCOM_RPM_SFPB_CLK] =			{ 28, 12, 12, 1 },
+	[QCOM_RPM_CFPB_CLK] =			{ 29, 13, 13, 1 },
+	[QCOM_RPM_EBI1_CLK] =			{ 30, 14, 16, 1 },
+	[QCOM_RPM_APPS_FABRIC_HALT] =		{ 31, 15, 22, 2 },
+	[QCOM_RPM_APPS_FABRIC_MODE] =		{ 33, 16, 23, 3 },
+	[QCOM_RPM_APPS_FABRIC_IOCTL] =		{ 36, 17, 24, 1 },
+	[QCOM_RPM_APPS_FABRIC_ARB] =		{ 37, 18, 25, 27 },
+	[QCOM_RPM_PM8018_SMPS1] =		{ 64, 19, 30, 2 },
+	[QCOM_RPM_PM8018_SMPS2] =		{ 66, 21, 31, 2 },
+	[QCOM_RPM_PM8018_SMPS3] =		{ 68, 23, 32, 2 },
+	[QCOM_RPM_PM8018_SMPS4] =		{ 70, 25, 33, 2 },
+	[QCOM_RPM_PM8018_SMPS5] =		{ 72, 27, 34, 2 },
+	[QCOM_RPM_PM8018_LDO1] =		{ 74, 29, 35, 2 },
+	[QCOM_RPM_PM8018_LDO2] =		{ 76, 31, 36, 2 },
+	[QCOM_RPM_PM8018_LDO3] =		{ 78, 33, 37, 2 },
+	[QCOM_RPM_PM8018_LDO4] =		{ 80, 35, 38, 2 },
+	[QCOM_RPM_PM8018_LDO5] =		{ 82, 37, 39, 2 },
+	[QCOM_RPM_PM8018_LDO6] =		{ 84, 39, 40, 2 },
+	[QCOM_RPM_PM8018_LDO7] =		{ 86, 41, 41, 2 },
+	[QCOM_RPM_PM8018_LDO8] =		{ 88, 43, 42, 2 },
+	[QCOM_RPM_PM8018_LDO9] =		{ 90, 45, 43, 2 },
+	[QCOM_RPM_PM8018_LDO10] =		{ 92, 47, 44, 2 },
+	[QCOM_RPM_PM8018_LDO11] =		{ 94, 49, 45, 2 },
+	[QCOM_RPM_PM8018_LDO12] =		{ 96, 51, 46, 2 },
+	[QCOM_RPM_PM8018_LDO13] =		{ 98, 53, 47, 2 },
+	[QCOM_RPM_PM8018_LDO14] =		{ 100, 55, 48, 2 },
+	[QCOM_RPM_PM8018_LVS1] =		{ 102, 57, 49, 1 },
+	[QCOM_RPM_NCP] =			{ 103, 58, 80, 2 },
+	[QCOM_RPM_CXO_BUFFERS] =		{ 105, 60, 81, 1 },
+	[QCOM_RPM_USB_OTG_SWITCH] =		{ 106, 61, 82, 1 },
+	[QCOM_RPM_HDMI_SWITCH] =		{ 107, 62, 83, 1 },
+	[QCOM_RPM_VOLTAGE_CORNER] =		{ 109, 64, 87, 1 },
+};
+
+static const struct qcom_rpm_data mdm9615_template = {
+	.version = 3,
+	.resource_table = mdm9615_rpm_resource_table,
+	.n_resources = ARRAY_SIZE(mdm9615_rpm_resource_table),
+};
+
 static const struct of_device_id qcom_rpm_of_match[] = {
 	{ .compatible = "qcom,rpm-apq8064", .data = &apq8064_template },
 	{ .compatible = "qcom,rpm-msm8660", .data = &msm8660_template },
 	{ .compatible = "qcom,rpm-msm8960", .data = &msm8960_template },
 	{ .compatible = "qcom,rpm-ipq8064", .data = &ipq806x_template },
+	{ .compatible = "qcom,rpm-mdm9615", .data = &mdm9615_template },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, qcom_rpm_of_match);
diff --git a/include/dt-bindings/mfd/qcom-rpm.h b/include/dt-bindings/mfd/qcom-rpm.h
index 13a9d4b..db85912 100644
--- a/include/dt-bindings/mfd/qcom-rpm.h
+++ b/include/dt-bindings/mfd/qcom-rpm.h
@@ -148,6 +148,29 @@
 #define QCOM_RPM_SMB208_S2a			138
 #define QCOM_RPM_SMB208_S2b			139
 
+#define QCOM_RPM_PM8018_SMPS1			200
+#define QCOM_RPM_PM8018_SMPS2			201
+#define QCOM_RPM_PM8018_SMPS3			202
+#define QCOM_RPM_PM8018_SMPS4			203
+#define QCOM_RPM_PM8018_SMPS5			204
+#define QCOM_RPM_PM8018_LDO1			205
+#define QCOM_RPM_PM8018_LDO2			206
+#define QCOM_RPM_PM8018_LDO3			207
+#define QCOM_RPM_PM8018_LDO4			208
+#define QCOM_RPM_PM8018_LDO5			209
+#define QCOM_RPM_PM8018_LDO6			210
+#define QCOM_RPM_PM8018_LDO7			211
+#define QCOM_RPM_PM8018_LDO8			212
+#define QCOM_RPM_PM8018_LDO9			213
+#define QCOM_RPM_PM8018_LDO10			214
+#define QCOM_RPM_PM8018_LDO11			215
+#define QCOM_RPM_PM8018_LDO12			216
+#define QCOM_RPM_PM8018_LDO13			217
+#define QCOM_RPM_PM8018_LDO14			218
+#define QCOM_RPM_PM8018_LVS1			219
+#define QCOM_RPM_NCP				220
+#define QCOM_RPM_VOLTAGE_CORNER			221
+
 /*
  * Constants used to select force mode for regulators.
  */
-- 
1.9.1

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

* [PATCH 5/5] regulator: qcom_rpm-regulator: Add support for pm8018 rpm regulator
  2016-06-17 10:22 [PATCH 0/5] Add support for the Qualcomm PM8018 PMIC Neil Armstrong
                   ` (3 preceding siblings ...)
  2016-06-17 10:22 ` [PATCH 4/5] mfd: qcom-rpm: Add support for pm8018 RPM Regulator Neil Armstrong
@ 2016-06-17 10:22 ` Neil Armstrong
  2016-06-17 12:24   ` Mark Brown
  2016-06-17 16:53   ` Bjorn Andersson
  4 siblings, 2 replies; 20+ messages in thread
From: Neil Armstrong @ 2016-06-17 10:22 UTC (permalink / raw)
  To: dmitry.torokhov, andy.gross, david.brown, lee.jones, lgirdwood,
	broonie, a.zummo, alexandre.belloni
  Cc: Neil Armstrong, linux-input, linux-kernel, linux-arm-msm,
	linux-soc, rtc-linux

In order to support eh Qualcomm MDM9615 SoC, add support for the
PM8018 RPM regulator in the qcom_rpm-regulator driver.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 Documentation/devicetree/bindings/mfd/qcom-rpm.txt |  14 +++
 drivers/regulator/qcom_rpm-regulator.c             | 134 +++++++++++++++++++++
 2 files changed, 148 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/qcom-rpm.txt b/Documentation/devicetree/bindings/mfd/qcom-rpm.txt
index 72d68d4..d866a69 100644
--- a/Documentation/devicetree/bindings/mfd/qcom-rpm.txt
+++ b/Documentation/devicetree/bindings/mfd/qcom-rpm.txt
@@ -60,6 +60,7 @@ Regulator nodes are identified by their compatible:
 		    "qcom,rpm-pm8058-regulators"
 		    "qcom,rpm-pm8901-regulators"
 		    "qcom,rpm-pm8921-regulators"
+		    "qcom,rpm-pm8018-regulators"
 
 - vdd_l0_l1_lvs-supply:
 - vdd_l2_l11_l12-supply:
@@ -138,6 +139,15 @@ Regulator nodes are identified by their compatible:
 	Definition: reference to regulator supplying the input pin, as
 		    described in the data sheet
 
+- vin_lvs1-supply:
+- vdd_l7-supply:
+- vdd_l8-supply:
+- vdd_l9_l10_l11_l12-supply:
+	Usage: optional (pm8018 only)
+	Value type: <phandle>
+	Definition: reference to regulator supplying the input pin, as
+		    described in the data sheet
+
 The regulator node houses sub-nodes for each regulator within the device. Each
 sub-node is identified using the node's name, with valid values listed for each
 of the pmics below.
@@ -157,6 +167,10 @@ pm8921:
 	l29, lvs1, lvs2, lvs3, lvs4, lvs5, lvs6, lvs7, usb-switch, hdmi-switch,
 	ncp
 
+pm8018:
+	s1, s2, s3, s4, s5, , l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11,
+	l12, l14, lvs1, dig_corner
+
 The content of each sub-node is defined by the standard binding for regulators -
 see regulator.txt - with additional custom properties described below:
 
diff --git a/drivers/regulator/qcom_rpm-regulator.c b/drivers/regulator/qcom_rpm-regulator.c
index e254272..93ef130 100644
--- a/drivers/regulator/qcom_rpm-regulator.c
+++ b/drivers/regulator/qcom_rpm-regulator.c
@@ -70,6 +70,45 @@ struct qcom_rpm_reg {
 	bool supports_force_mode_bypass;
 };
 
+static struct rpm_reg_parts rpm8018_ldo_parts = {
+	.request_len	= 2,
+	.uV		= { 0, 0x007FFFFF,  0},
+	.pd		= { 0, 0x00800000, 23},
+	.pc		= { 0, 0x0F000000, 24},
+	.pf		= { 0, 0xF0000000, 28},
+	.ip		= { 1, 0x000003FF,  0},
+	.ia		= { 1, 0x000FFC00, 10},
+	.fm		= { 1, 0x00700000, 20},
+};
+
+static struct rpm_reg_parts rpm8018_smps_parts = {
+	.request_len	= 2,
+	.uV		= {  0, 0x007FFFFF,  0},
+	.pd		= {  0, 0x00800000, 23},
+	.pc		= {  0, 0x0F000000, 24},
+	.pf		= {  0, 0xF0000000, 28},
+	.ip		= {  1, 0x000003FF,  0},
+	.ia		= {  1, 0x000FFC00, 10},
+	.fm		= {  1, 0x00700000, 20},
+	.pm		= {  1, 0x00800000, 23},
+	.freq		= {  1, 0x1F000000, 24},
+	.freq_clk_src	= {  1, 0x60000000, 29},
+};
+
+static struct rpm_reg_parts rpm8018_switch_parts = {
+	.request_len	= 1,
+	.enable_state	= {  0, 0x00000001,  0},
+	.pd		= {  0, 0x00000002,  1},
+	.pc		= {  0, 0x0000003C,  2},
+	.pf		= {  0, 0x000003C0,  6},
+	.hpm		= {  0, 0x00000C00, 10},
+};
+
+static struct rpm_reg_parts rpm8018_corner_parts = {
+	.request_len	= 1,
+	.uV		= {  0, 0x00000003,  0},
+};
+
 static const struct rpm_reg_parts rpm8660_ldo_parts = {
 	.request_len    = 2,
 	.mV             = { 0, 0x00000FFF,  0 },
@@ -194,6 +233,24 @@ static const struct regulator_linear_range ncp_ranges[] = {
 	REGULATOR_LINEAR_RANGE(1500000,   0,  31, 50000),
 };
 
+/**
+ * enum rpm_vreg_voltage_corner - possible voltage corner values
+ *
+ * These should be used in regulator_set_voltage and rpm_vreg_set_voltage calls
+ * for corner type regulators as if they had units of uV.
+ */
+enum rpm_vreg_voltage_corner {
+	RPM_VREG_CORNER_NONE = 1,
+	RPM_VREG_CORNER_LOW,
+	RPM_VREG_CORNER_NOMINAL,
+	RPM_VREG_CORNER_HIGH,
+};
+
+static struct regulator_linear_range corner_ranges[] = {
+	REGULATOR_LINEAR_RANGE(RPM_VREG_CORNER_NONE, 0,
+				RPM_VREG_CORNER_HIGH, 1),
+};
+
 static int rpm_reg_write(struct qcom_rpm_reg *vreg,
 			 const struct request_member *req,
 			 const int value)
@@ -448,6 +505,52 @@ static struct regulator_ops switch_ops = {
 };
 
 /*
+ * PM8018 regulators
+ */
+static const struct qcom_rpm_reg pm8018_pldo = {
+	.desc.linear_ranges = pldo_ranges,
+	.desc.n_linear_ranges = ARRAY_SIZE(pldo_ranges),
+	.desc.n_voltages = 161,
+	.desc.ops = &uV_ops,
+	.parts = &rpm8018_ldo_parts,
+	.supports_force_mode_auto = false,
+	.supports_force_mode_bypass = false,
+};
+
+static const struct qcom_rpm_reg pm8018_nldo = {
+	.desc.linear_ranges = nldo_ranges,
+	.desc.n_linear_ranges = ARRAY_SIZE(nldo_ranges),
+	.desc.n_voltages = 64,
+	.desc.ops = &uV_ops,
+	.parts = &rpm8018_ldo_parts,
+	.supports_force_mode_auto = false,
+	.supports_force_mode_bypass = false,
+};
+
+static const struct qcom_rpm_reg pm8018_smps = {
+	.desc.linear_ranges = smps_ranges,
+	.desc.n_linear_ranges = ARRAY_SIZE(smps_ranges),
+	.desc.n_voltages = 154,
+	.desc.ops = &uV_ops,
+	.parts = &rpm8018_smps_parts,
+	.supports_force_mode_auto = false,
+	.supports_force_mode_bypass = false,
+};
+
+static const struct qcom_rpm_reg pm8018_switch = {
+	.desc.ops = &switch_ops,
+	.parts = &rpm8018_switch_parts,
+};
+
+static const struct qcom_rpm_reg pm8018_corner = {
+	.desc.linear_ranges = corner_ranges,
+	.desc.n_linear_ranges = ARRAY_SIZE(corner_ranges),
+	.desc.n_voltages = 4,
+	.desc.ops = &uV_ops,
+	.parts = &rpm8018_corner_parts,
+};
+
+/*
  * PM8058 regulators
  */
 static const struct qcom_rpm_reg pm8058_pldo = {
@@ -755,6 +858,35 @@ struct rpm_regulator_data {
 	const char *supply;
 };
 
+static const struct rpm_regulator_data rpm_pm8018_regulators[] = {
+	{ "s1",  QCOM_RPM_PM8018_SMPS1, &pm8018_smps, "vdd_s1" },
+	{ "s2",  QCOM_RPM_PM8018_SMPS2, &pm8018_smps, "vdd_s2" },
+	{ "s3",  QCOM_RPM_PM8018_SMPS3, &pm8018_smps, "vdd_s3" },
+	{ "s4",  QCOM_RPM_PM8018_SMPS4, &pm8018_smps, "vdd_s4" },
+	{ "s5",  QCOM_RPM_PM8018_SMPS5, &pm8018_smps, "vdd_s5" },
+
+	{ "l2",  QCOM_RPM_PM8018_LDO2,  &pm8018_pldo, "vdd_l2" },
+	{ "l3",  QCOM_RPM_PM8018_LDO3,  &pm8018_pldo, "vdd_l3" },
+	{ "l4",  QCOM_RPM_PM8018_LDO4,  &pm8018_pldo, "vdd_l4" },
+	{ "l5",  QCOM_RPM_PM8018_LDO5,  &pm8018_pldo, "vdd_l5" },
+	{ "l6",  QCOM_RPM_PM8018_LDO6,  &pm8018_pldo, "vdd_l7" },
+	{ "l7",  QCOM_RPM_PM8018_LDO7,  &pm8018_pldo, "vdd_l7" },
+	{ "l8",  QCOM_RPM_PM8018_LDO8,  &pm8018_nldo, "vdd_l8" },
+	{ "l9",  QCOM_RPM_PM8018_LDO9,  &pm8921_nldo1200,
+						      "vdd_l9_l10_l11_l12" },
+	{ "l10", QCOM_RPM_PM8018_LDO10, &pm8018_nldo, "vdd_l9_l10_l11_l12" },
+	{ "l11", QCOM_RPM_PM8018_LDO11, &pm8018_nldo, "vdd_l9_l10_l11_l12" },
+	{ "l12", QCOM_RPM_PM8018_LDO12, &pm8018_nldo, "vdd_l9_l10_l11_l12" },
+	{ "l14", QCOM_RPM_PM8018_LDO14, &pm8018_pldo, "vdd_l14" },
+
+	{ "lvs1", QCOM_RPM_PM8018_LVS1, &pm8018_switch, "lvs1_in" },
+
+	{ "dig_corner", QCOM_RPM_VOLTAGE_CORNER, &pm8018_corner,
+						      "vdd_dig_corner" },
+
+	{ }
+};
+
 static const struct rpm_regulator_data rpm_pm8058_regulators[] = {
 	{ "l0",   QCOM_RPM_PM8058_LDO0,   &pm8058_nldo, "vdd_l0_l1_lvs"	},
 	{ "l1",   QCOM_RPM_PM8058_LDO1,   &pm8058_nldo, "vdd_l0_l1_lvs" },
@@ -870,6 +1002,8 @@ static const struct rpm_regulator_data rpm_pm8921_regulators[] = {
 };
 
 static const struct of_device_id rpm_of_match[] = {
+	{ .compatible = "qcom,rpm-pm8018-regulators",
+		.data = &rpm_pm8018_regulators },
 	{ .compatible = "qcom,rpm-pm8058-regulators", .data = &rpm_pm8058_regulators },
 	{ .compatible = "qcom,rpm-pm8901-regulators", .data = &rpm_pm8901_regulators },
 	{ .compatible = "qcom,rpm-pm8921-regulators", .data = &rpm_pm8921_regulators },
-- 
1.9.1

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

* Re: [PATCH 5/5] regulator: qcom_rpm-regulator: Add support for pm8018 rpm regulator
  2016-06-17 10:22 ` [PATCH 5/5] regulator: qcom_rpm-regulator: Add support for pm8018 rpm regulator Neil Armstrong
@ 2016-06-17 12:24   ` Mark Brown
  2016-06-17 16:53   ` Bjorn Andersson
  1 sibling, 0 replies; 20+ messages in thread
From: Mark Brown @ 2016-06-17 12:24 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: dmitry.torokhov, andy.gross, david.brown, lee.jones, lgirdwood,
	a.zummo, alexandre.belloni, linux-input, linux-kernel,
	linux-arm-msm, linux-soc, rtc-linux

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

On Fri, Jun 17, 2016 at 12:22:09PM +0200, Neil Armstrong wrote:
> In order to support eh Qualcomm MDM9615 SoC, add support for the
> PM8018 RPM regulator in the qcom_rpm-regulator driver.

Acked-by: Mark Brown <broonie@kernel.org>

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

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

* Re: [PATCH 5/5] regulator: qcom_rpm-regulator: Add support for pm8018 rpm regulator
  2016-06-17 10:22 ` [PATCH 5/5] regulator: qcom_rpm-regulator: Add support for pm8018 rpm regulator Neil Armstrong
  2016-06-17 12:24   ` Mark Brown
@ 2016-06-17 16:53   ` Bjorn Andersson
  2016-06-18  9:47     ` Mark Brown
                       ` (2 more replies)
  1 sibling, 3 replies; 20+ messages in thread
From: Bjorn Andersson @ 2016-06-17 16:53 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: dmitry.torokhov, andy.gross, david.brown, lee.jones, lgirdwood,
	broonie, a.zummo, alexandre.belloni, linux-input, linux-kernel,
	linux-arm-msm, linux-soc, rtc-linux

On Fri 17 Jun 03:22 PDT 2016, Neil Armstrong wrote:

> In order to support eh Qualcomm MDM9615 SoC, add support for the
> PM8018 RPM regulator in the qcom_rpm-regulator driver.
> 
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
[..]
> diff --git a/drivers/regulator/qcom_rpm-regulator.c b/drivers/regulator/qcom_rpm-regulator.c
[..]
> +/**
> + * enum rpm_vreg_voltage_corner - possible voltage corner values
> + *
> + * These should be used in regulator_set_voltage and rpm_vreg_set_voltage calls
> + * for corner type regulators as if they had units of uV.
> + */
> +enum rpm_vreg_voltage_corner {
> +	RPM_VREG_CORNER_NONE = 1,
> +	RPM_VREG_CORNER_LOW,
> +	RPM_VREG_CORNER_NOMINAL,
> +	RPM_VREG_CORNER_HIGH,
> +};
> +
> +static struct regulator_linear_range corner_ranges[] = {
> +	REGULATOR_LINEAR_RANGE(RPM_VREG_CORNER_NONE, 0,
> +				RPM_VREG_CORNER_HIGH, 1),
> +};
> +
>  static int rpm_reg_write(struct qcom_rpm_reg *vreg,
[..]
> +
> +static const struct qcom_rpm_reg pm8018_corner = {
> +	.desc.linear_ranges = corner_ranges,
> +	.desc.n_linear_ranges = ARRAY_SIZE(corner_ranges),
> +	.desc.n_voltages = 4,
> +	.desc.ops = &uV_ops,
> +	.parts = &rpm8018_corner_parts,
> +};
> +
[..]
> +static const struct rpm_regulator_data rpm_pm8018_regulators[] = {
[..]
> +	{ "dig_corner", QCOM_RPM_VOLTAGE_CORNER, &pm8018_corner,
> +						      "vdd_dig_corner" },
> +
> +	{ }
> +};

We have discussed the corners for a long time and I think we've
concluded that they should be exposed as something like an OPP. What we
have agreed on is that they should not be exposed as a regulator with
voltages 1-4uV.

So please drop the corner for now.

Regards,
Bjorn

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

* Re: [PATCH 5/5] regulator: qcom_rpm-regulator: Add support for pm8018 rpm regulator
  2016-06-17 16:53   ` Bjorn Andersson
@ 2016-06-18  9:47     ` Mark Brown
  2016-06-20  9:03     ` Neil Armstrong
  2016-06-22  8:39     ` Neil Armstrong
  2 siblings, 0 replies; 20+ messages in thread
From: Mark Brown @ 2016-06-18  9:47 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Neil Armstrong, dmitry.torokhov, andy.gross, david.brown,
	lee.jones, lgirdwood, a.zummo, alexandre.belloni, linux-input,
	linux-kernel, linux-arm-msm, linux-soc, rtc-linux

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

On Fri, Jun 17, 2016 at 09:53:52AM -0700, Bjorn Andersson wrote:
> On Fri 17 Jun 03:22 PDT 2016, Neil Armstrong wrote:

> > +	{ "dig_corner", QCOM_RPM_VOLTAGE_CORNER, &pm8018_corner,
> > +						      "vdd_dig_corner" },
> > +
> > +	{ }
> > +};

> We have discussed the corners for a long time and I think we've
> concluded that they should be exposed as something like an OPP. What we
> have agreed on is that they should not be exposed as a regulator with
> voltages 1-4uV.

Oops, missed this - yes, that needs to go as it's definitely a complete
abuse of the API.

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

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

* Re: [PATCH 2/5] input: pmic8xxx-pwrkey: Add support for pm8018 pwrkey
  2016-06-17 10:22 ` [PATCH 2/5] input: pmic8xxx-pwrkey: Add support for pm8018 pwrkey Neil Armstrong
@ 2016-06-18 16:21   ` Dmitry Torokhov
  2016-06-22  5:25   ` Bjorn Andersson
  1 sibling, 0 replies; 20+ messages in thread
From: Dmitry Torokhov @ 2016-06-18 16:21 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: andy.gross, david.brown, lee.jones, lgirdwood, broonie, a.zummo,
	alexandre.belloni, linux-input, linux-kernel, linux-arm-msm,
	linux-soc, rtc-linux

Hi Neil,

On Fri, Jun 17, 2016 at 12:22:06PM +0200, Neil Armstrong wrote:
> In order to support pwrkey for Qualcomm MDM9615 SoC, add support
> for the pm8018 pwrkey in pmic8xxx-pwrkey.

Why do we need a new compat string if IP block is compatible with 8921?

> 
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> ---
>  Documentation/devicetree/bindings/input/qcom,pm8xxx-pwrkey.txt | 1 +
>  drivers/input/misc/pmic8xxx-pwrkey.c                           | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/input/qcom,pm8xxx-pwrkey.txt b/Documentation/devicetree/bindings/input/qcom,pm8xxx-pwrkey.txt
> index 588536c..9e530e2 100644
> --- a/Documentation/devicetree/bindings/input/qcom,pm8xxx-pwrkey.txt
> +++ b/Documentation/devicetree/bindings/input/qcom,pm8xxx-pwrkey.txt
> @@ -8,6 +8,7 @@ PROPERTIES
>  	Definition: must be one of:
>  		    "qcom,pm8058-pwrkey"
>  		    "qcom,pm8921-pwrkey"
> +		    "qcom,pm8018-pwrkey"
>  
>  - reg:
>  	Usage: required
> diff --git a/drivers/input/misc/pmic8xxx-pwrkey.c b/drivers/input/misc/pmic8xxx-pwrkey.c
> index 67aab86..f6f9b87 100644
> --- a/drivers/input/misc/pmic8xxx-pwrkey.c
> +++ b/drivers/input/misc/pmic8xxx-pwrkey.c
> @@ -446,6 +446,7 @@ static int pmic8xxx_pwrkey_remove(struct platform_device *pdev)
>  }
>  
>  static const struct of_device_id pm8xxx_pwr_key_id_table[] = {
> +	{ .compatible = "qcom,pm8018-pwrkey", .data = &pm8921_pwrkey_shutdown },
>  	{ .compatible = "qcom,pm8058-pwrkey", .data = &pm8058_pwrkey_shutdown },
>  	{ .compatible = "qcom,pm8921-pwrkey", .data = &pm8921_pwrkey_shutdown },
>  	{ }
> -- 
> 1.9.1
> 

Thanks.

-- 
Dmitry

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

* Re: [PATCH 5/5] regulator: qcom_rpm-regulator: Add support for pm8018 rpm regulator
  2016-06-17 16:53   ` Bjorn Andersson
  2016-06-18  9:47     ` Mark Brown
@ 2016-06-20  9:03     ` Neil Armstrong
  2016-06-22  8:39     ` Neil Armstrong
  2 siblings, 0 replies; 20+ messages in thread
From: Neil Armstrong @ 2016-06-20  9:03 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: dmitry.torokhov, andy.gross, david.brown, lee.jones, lgirdwood,
	broonie, a.zummo, alexandre.belloni, linux-input, linux-kernel,
	linux-arm-msm, linux-soc, rtc-linux

On 06/17/2016 06:53 PM, Bjorn Andersson wrote:
> On Fri 17 Jun 03:22 PDT 2016, Neil Armstrong wrote:
> 
>> In order to support eh Qualcomm MDM9615 SoC, add support for the
>> PM8018 RPM regulator in the qcom_rpm-regulator driver.
>>
>> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> [..]
>> diff --git a/drivers/regulator/qcom_rpm-regulator.c b/drivers/regulator/qcom_rpm-regulator.c
> [..]
>> +/**
>> + * enum rpm_vreg_voltage_corner - possible voltage corner values
>> + *
>> + * These should be used in regulator_set_voltage and rpm_vreg_set_voltage calls
>> + * for corner type regulators as if they had units of uV.
>> + */
>> +enum rpm_vreg_voltage_corner {
>> +	RPM_VREG_CORNER_NONE = 1,
>> +	RPM_VREG_CORNER_LOW,
>> +	RPM_VREG_CORNER_NOMINAL,
>> +	RPM_VREG_CORNER_HIGH,
>> +};
>> +
>> +static struct regulator_linear_range corner_ranges[] = {
>> +	REGULATOR_LINEAR_RANGE(RPM_VREG_CORNER_NONE, 0,
>> +				RPM_VREG_CORNER_HIGH, 1),
>> +};
>> +
>>  static int rpm_reg_write(struct qcom_rpm_reg *vreg,
> [..]
>> +
>> +static const struct qcom_rpm_reg pm8018_corner = {
>> +	.desc.linear_ranges = corner_ranges,
>> +	.desc.n_linear_ranges = ARRAY_SIZE(corner_ranges),
>> +	.desc.n_voltages = 4,
>> +	.desc.ops = &uV_ops,
>> +	.parts = &rpm8018_corner_parts,
>> +};
>> +
> [..]
>> +static const struct rpm_regulator_data rpm_pm8018_regulators[] = {
> [..]
>> +	{ "dig_corner", QCOM_RPM_VOLTAGE_CORNER, &pm8018_corner,
>> +						      "vdd_dig_corner" },
>> +
>> +	{ }
>> +};
> 
> We have discussed the corners for a long time and I think we've
> concluded that they should be exposed as something like an OPP. What we
> have agreed on is that they should not be exposed as a regulator with
> voltages 1-4uV.
> 
> So please drop the corner for now.

OK,

Thanks,
Neil

> 
> Regards,
> Bjorn
> 

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

* Re: [PATCH 3/5] rtc: rtc-pm8xxx: Add support for pm8018 rtc
  2016-06-17 10:22 ` [PATCH 3/5] rtc: rtc-pm8xxx: Add support for pm8018 rtc Neil Armstrong
@ 2016-06-21 16:24   ` Alexandre Belloni
  2016-06-22  5:06   ` Bjorn Andersson
  1 sibling, 0 replies; 20+ messages in thread
From: Alexandre Belloni @ 2016-06-21 16:24 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: dmitry.torokhov, andy.gross, david.brown, lee.jones, lgirdwood,
	broonie, a.zummo, linux-input, linux-kernel, linux-arm-msm,
	linux-soc, rtc-linux

On 17/06/2016 at 12:22:07 +0200, Neil Armstrong wrote :
> In order to support RTC on Qualcomm MDM9615 SoC, add support for
> the pm8018 rtc in rtc-pm8xxx driver.
> 
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* Re: [PATCH 3/5] rtc: rtc-pm8xxx: Add support for pm8018 rtc
  2016-06-17 10:22 ` [PATCH 3/5] rtc: rtc-pm8xxx: Add support for pm8018 rtc Neil Armstrong
  2016-06-21 16:24   ` Alexandre Belloni
@ 2016-06-22  5:06   ` Bjorn Andersson
  1 sibling, 0 replies; 20+ messages in thread
From: Bjorn Andersson @ 2016-06-22  5:06 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: dmitry.torokhov, andy.gross, david.brown, lee.jones, lgirdwood,
	broonie, a.zummo, alexandre.belloni, linux-input, linux-kernel,
	linux-arm-msm, linux-soc, rtc-linux

On Fri 17 Jun 03:22 PDT 2016, Neil Armstrong wrote:

> In order to support RTC on Qualcomm MDM9615 SoC, add support for
> the pm8018 rtc in rtc-pm8xxx driver.
> 
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> ---
>  Documentation/devicetree/bindings/mfd/qcom-pm8xxx.txt |  1 +
>  drivers/rtc/rtc-pm8xxx.c                              | 11 +++++++++++
>  2 files changed, 12 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.txt b/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.txt
> index f24f334..37a088f 100644
> --- a/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.txt
> +++ b/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.txt
> @@ -62,6 +62,7 @@ The below bindings specify the set of valid subnodes.
>  		    "qcom,pm8058-rtc"
>  		    "qcom,pm8921-rtc"
>  		    "qcom,pm8941-rtc"
> +		    "qcom,pm8018-rtc"

Would be nice if we kept this sorted, but the patch looks good.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

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

* Re: [PATCH 1/5] mfd: pm8921: Add support for pm8018
  2016-06-17 10:22 ` [PATCH 1/5] mfd: pm8921: Add support for pm8018 Neil Armstrong
@ 2016-06-22  5:07   ` Bjorn Andersson
  0 siblings, 0 replies; 20+ messages in thread
From: Bjorn Andersson @ 2016-06-22  5:07 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: dmitry.torokhov, andy.gross, david.brown, lee.jones, lgirdwood,
	broonie, a.zummo, alexandre.belloni, linux-input, linux-kernel,
	linux-arm-msm, linux-soc, rtc-linux

On Fri 17 Jun 03:22 PDT 2016, Neil Armstrong wrote:

> In order to support the Qualcomm MDM9615 PMIC, add support for the
> pm8018 in pm8921 mfd driver.
> 
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

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

* Re: [PATCH 4/5] mfd: qcom-rpm: Add support for pm8018 RPM Regulator
  2016-06-17 10:22 ` [PATCH 4/5] mfd: qcom-rpm: Add support for pm8018 RPM Regulator Neil Armstrong
@ 2016-06-22  5:23   ` Bjorn Andersson
  2016-06-22  8:34     ` Neil Armstrong
  0 siblings, 1 reply; 20+ messages in thread
From: Bjorn Andersson @ 2016-06-22  5:23 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: linus.walleij, dmitry.torokhov, andy.gross, david.brown,
	lee.jones, lgirdwood, broonie, a.zummo, alexandre.belloni,
	linux-input, linux-kernel, linux-arm-msm, linux-soc, rtc-linux

On Fri 17 Jun 03:22 PDT 2016, Neil Armstrong wrote:

[..]
> diff --git a/drivers/mfd/qcom_rpm.c b/drivers/mfd/qcom_rpm.c
[..]
> +
> +static const struct qcom_rpm_data mdm9615_template = {
> +	.version = 3,
> +	.resource_table = mdm9615_rpm_resource_table,
> +	.n_resources = ARRAY_SIZE(mdm9615_rpm_resource_table),
> +};

Please see:
https://patchwork.kernel.org/patch/9177159/

You should set the new .sel_size to 4 here, please either rebase ontop
of Linus patch or send an update after both are merged.

> +
>  static const struct of_device_id qcom_rpm_of_match[] = {
>  	{ .compatible = "qcom,rpm-apq8064", .data = &apq8064_template },
>  	{ .compatible = "qcom,rpm-msm8660", .data = &msm8660_template },
>  	{ .compatible = "qcom,rpm-msm8960", .data = &msm8960_template },
>  	{ .compatible = "qcom,rpm-ipq8064", .data = &ipq806x_template },
> +	{ .compatible = "qcom,rpm-mdm9615", .data = &mdm9615_template },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(of, qcom_rpm_of_match);
> diff --git a/include/dt-bindings/mfd/qcom-rpm.h b/include/dt-bindings/mfd/qcom-rpm.h
> index 13a9d4b..db85912 100644
> --- a/include/dt-bindings/mfd/qcom-rpm.h
> +++ b/include/dt-bindings/mfd/qcom-rpm.h
> @@ -148,6 +148,29 @@
>  #define QCOM_RPM_SMB208_S2a			138
>  #define QCOM_RPM_SMB208_S2b			139
>  
> +#define QCOM_RPM_PM8018_SMPS1			200

These numbers are a logical identifier and as such you shouldn't skip
140-199.

> +#define QCOM_RPM_PM8018_SMPS2			201
> +#define QCOM_RPM_PM8018_SMPS3			202
> +#define QCOM_RPM_PM8018_SMPS4			203
> +#define QCOM_RPM_PM8018_SMPS5			204
> +#define QCOM_RPM_PM8018_LDO1			205
> +#define QCOM_RPM_PM8018_LDO2			206
> +#define QCOM_RPM_PM8018_LDO3			207
> +#define QCOM_RPM_PM8018_LDO4			208
> +#define QCOM_RPM_PM8018_LDO5			209
> +#define QCOM_RPM_PM8018_LDO6			210
> +#define QCOM_RPM_PM8018_LDO7			211
> +#define QCOM_RPM_PM8018_LDO8			212
> +#define QCOM_RPM_PM8018_LDO9			213
> +#define QCOM_RPM_PM8018_LDO10			214
> +#define QCOM_RPM_PM8018_LDO11			215
> +#define QCOM_RPM_PM8018_LDO12			216
> +#define QCOM_RPM_PM8018_LDO13			217
> +#define QCOM_RPM_PM8018_LDO14			218
> +#define QCOM_RPM_PM8018_LVS1			219
> +#define QCOM_RPM_NCP				220

We already have PM8921_NCP and PM8058_NCP, so better make this
QCOM_RPM_PM8018_NCP for consistency.

> +#define QCOM_RPM_VOLTAGE_CORNER			221
> +

Other then these details
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

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

* Re: [PATCH 2/5] input: pmic8xxx-pwrkey: Add support for pm8018 pwrkey
  2016-06-17 10:22 ` [PATCH 2/5] input: pmic8xxx-pwrkey: Add support for pm8018 pwrkey Neil Armstrong
  2016-06-18 16:21   ` Dmitry Torokhov
@ 2016-06-22  5:25   ` Bjorn Andersson
  2016-06-22  5:33     ` Dmitry Torokhov
  1 sibling, 1 reply; 20+ messages in thread
From: Bjorn Andersson @ 2016-06-22  5:25 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: dmitry.torokhov, andy.gross, david.brown, lee.jones, lgirdwood,
	broonie, a.zummo, alexandre.belloni, linux-input, linux-kernel,
	linux-arm-msm, linux-soc, rtc-linux

On Fri 17 Jun 03:22 PDT 2016, Neil Armstrong wrote:

> In order to support pwrkey for Qualcomm MDM9615 SoC, add support
> for the pm8018 pwrkey in pmic8xxx-pwrkey.
> 
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

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

* Re: [PATCH 2/5] input: pmic8xxx-pwrkey: Add support for pm8018 pwrkey
  2016-06-22  5:25   ` Bjorn Andersson
@ 2016-06-22  5:33     ` Dmitry Torokhov
  0 siblings, 0 replies; 20+ messages in thread
From: Dmitry Torokhov @ 2016-06-22  5:33 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Neil Armstrong, Andy Gross, David Brown, Lee Jones,
	Liam Girdwood, Mark Brown, Alessandro Zummo, Alexandre Belloni,
	linux-input, lkml, linux-arm-msm, linux-soc, RTCLINUX

On Tue, Jun 21, 2016 at 10:25 PM, Bjorn Andersson
<bjorn.andersson@linaro.org> wrote:
> On Fri 17 Jun 03:22 PDT 2016, Neil Armstrong wrote:
>
>> In order to support pwrkey for Qualcomm MDM9615 SoC, add support
>> for the pm8018 pwrkey in pmic8xxx-pwrkey.
>>
>> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
>
> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

But why? What does this new compat string gives us if the behavior is
exactly the same as 8921?

Thanks.

-- 
Dmitry

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

* Re: [PATCH 4/5] mfd: qcom-rpm: Add support for pm8018 RPM Regulator
  2016-06-22  5:23   ` Bjorn Andersson
@ 2016-06-22  8:34     ` Neil Armstrong
  2016-06-22 15:52       ` Bjorn Andersson
  0 siblings, 1 reply; 20+ messages in thread
From: Neil Armstrong @ 2016-06-22  8:34 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: linus.walleij, dmitry.torokhov, andy.gross, david.brown,
	lee.jones, lgirdwood, broonie, a.zummo, alexandre.belloni,
	linux-input, linux-kernel, linux-arm-msm, linux-soc, rtc-linux

On 06/22/2016 07:23 AM, Bjorn Andersson wrote:
> On Fri 17 Jun 03:22 PDT 2016, Neil Armstrong wrote:
> 
> [..]
>> diff --git a/drivers/mfd/qcom_rpm.c b/drivers/mfd/qcom_rpm.c
> [..]
>> +
>> +static const struct qcom_rpm_data mdm9615_template = {
>> +	.version = 3,
>> +	.resource_table = mdm9615_rpm_resource_table,
>> +	.n_resources = ARRAY_SIZE(mdm9615_rpm_resource_table),
>> +};
> 
> Please see:
> https://patchwork.kernel.org/patch/9177159/
> 
> You should set the new .sel_size to 4 here, please either rebase ontop
> of Linus patch or send an update after both are merged.
> 
>> +
>>  static const struct of_device_id qcom_rpm_of_match[] = {
>>  	{ .compatible = "qcom,rpm-apq8064", .data = &apq8064_template },
>>  	{ .compatible = "qcom,rpm-msm8660", .data = &msm8660_template },
>>  	{ .compatible = "qcom,rpm-msm8960", .data = &msm8960_template },
>>  	{ .compatible = "qcom,rpm-ipq8064", .data = &ipq806x_template },
>> +	{ .compatible = "qcom,rpm-mdm9615", .data = &mdm9615_template },
>>  	{ }
>>  };
>>  MODULE_DEVICE_TABLE(of, qcom_rpm_of_match);
>> diff --git a/include/dt-bindings/mfd/qcom-rpm.h b/include/dt-bindings/mfd/qcom-rpm.h
>> index 13a9d4b..db85912 100644
>> --- a/include/dt-bindings/mfd/qcom-rpm.h
>> +++ b/include/dt-bindings/mfd/qcom-rpm.h
>> @@ -148,6 +148,29 @@
>>  #define QCOM_RPM_SMB208_S2a			138
>>  #define QCOM_RPM_SMB208_S2b			139
>>  
>> +#define QCOM_RPM_PM8018_SMPS1			200
> 
> These numbers are a logical identifier and as such you shouldn't skip
> 140-199.
> 
>> +#define QCOM_RPM_PM8018_SMPS2			201
>> +#define QCOM_RPM_PM8018_SMPS3			202
>> +#define QCOM_RPM_PM8018_SMPS4			203
>> +#define QCOM_RPM_PM8018_SMPS5			204
>> +#define QCOM_RPM_PM8018_LDO1			205
>> +#define QCOM_RPM_PM8018_LDO2			206
>> +#define QCOM_RPM_PM8018_LDO3			207
>> +#define QCOM_RPM_PM8018_LDO4			208
>> +#define QCOM_RPM_PM8018_LDO5			209
>> +#define QCOM_RPM_PM8018_LDO6			210
>> +#define QCOM_RPM_PM8018_LDO7			211
>> +#define QCOM_RPM_PM8018_LDO8			212
>> +#define QCOM_RPM_PM8018_LDO9			213
>> +#define QCOM_RPM_PM8018_LDO10			214
>> +#define QCOM_RPM_PM8018_LDO11			215
>> +#define QCOM_RPM_PM8018_LDO12			216
>> +#define QCOM_RPM_PM8018_LDO13			217
>> +#define QCOM_RPM_PM8018_LDO14			218
>> +#define QCOM_RPM_PM8018_LVS1			219
>> +#define QCOM_RPM_NCP				220
> 
> We already have PM8921_NCP and PM8058_NCP, so better make this
> QCOM_RPM_PM8018_NCP for consistency.
> 
>> +#define QCOM_RPM_VOLTAGE_CORNER			221
>> +
> 
> Other then these details
> Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> 
> Regards,
> Bjorn
> 
Thanks,

I rebased on Linus two patches ("fix offset error for msm8660" and "parametrize also ack selector size")

I suppose I should also drop the QCOM_RPM_VOLTAGE_CORNER rpm entry also ?

Neil

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

* Re: [PATCH 5/5] regulator: qcom_rpm-regulator: Add support for pm8018 rpm regulator
  2016-06-17 16:53   ` Bjorn Andersson
  2016-06-18  9:47     ` Mark Brown
  2016-06-20  9:03     ` Neil Armstrong
@ 2016-06-22  8:39     ` Neil Armstrong
  2 siblings, 0 replies; 20+ messages in thread
From: Neil Armstrong @ 2016-06-22  8:39 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: dmitry.torokhov, andy.gross, david.brown, lee.jones, lgirdwood,
	broonie, a.zummo, alexandre.belloni, linux-input, linux-kernel,
	linux-arm-msm, linux-soc, rtc-linux

On 06/17/2016 06:53 PM, Bjorn Andersson wrote:
> On Fri 17 Jun 03:22 PDT 2016, Neil Armstrong wrote:
> 
>> In order to support eh Qualcomm MDM9615 SoC, add support for the
>> PM8018 RPM regulator in the qcom_rpm-regulator driver.
>>
>> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> [..]
>> diff --git a/drivers/regulator/qcom_rpm-regulator.c b/drivers/regulator/qcom_rpm-regulator.c
> [..]
>> +/**
>> + * enum rpm_vreg_voltage_corner - possible voltage corner values
>> + *
>> + * These should be used in regulator_set_voltage and rpm_vreg_set_voltage calls
>> + * for corner type regulators as if they had units of uV.
>> + */
>> +enum rpm_vreg_voltage_corner {
>> +	RPM_VREG_CORNER_NONE = 1,
>> +	RPM_VREG_CORNER_LOW,
>> +	RPM_VREG_CORNER_NOMINAL,
>> +	RPM_VREG_CORNER_HIGH,
>> +};
>> +
>> +static struct regulator_linear_range corner_ranges[] = {
>> +	REGULATOR_LINEAR_RANGE(RPM_VREG_CORNER_NONE, 0,
>> +				RPM_VREG_CORNER_HIGH, 1),
>> +};
>> +
>>  static int rpm_reg_write(struct qcom_rpm_reg *vreg,
> [..]
>> +
>> +static const struct qcom_rpm_reg pm8018_corner = {
>> +	.desc.linear_ranges = corner_ranges,
>> +	.desc.n_linear_ranges = ARRAY_SIZE(corner_ranges),
>> +	.desc.n_voltages = 4,
>> +	.desc.ops = &uV_ops,
>> +	.parts = &rpm8018_corner_parts,
>> +};
>> +
> [..]
>> +static const struct rpm_regulator_data rpm_pm8018_regulators[] = {
> [..]
>> +	{ "dig_corner", QCOM_RPM_VOLTAGE_CORNER, &pm8018_corner,
>> +						      "vdd_dig_corner" },
>> +
>> +	{ }
>> +};
> 
> We have discussed the corners for a long time and I think we've
> concluded that they should be exposed as something like an OPP. What we
> have agreed on is that they should not be exposed as a regulator with
> voltages 1-4uV.
> 
> So please drop the corner for now.
> 
> Regards,
> Bjorn
> 
OK, dropped.

Thanks,
Neil

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

* Re: [PATCH 4/5] mfd: qcom-rpm: Add support for pm8018 RPM Regulator
  2016-06-22  8:34     ` Neil Armstrong
@ 2016-06-22 15:52       ` Bjorn Andersson
  0 siblings, 0 replies; 20+ messages in thread
From: Bjorn Andersson @ 2016-06-22 15:52 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: linus.walleij, dmitry.torokhov, andy.gross, david.brown,
	lee.jones, lgirdwood, broonie, a.zummo, alexandre.belloni,
	linux-input, linux-kernel, linux-arm-msm, linux-soc, rtc-linux

On Wed 22 Jun 01:34 PDT 2016, Neil Armstrong wrote:

> On 06/22/2016 07:23 AM, Bjorn Andersson wrote:
> > On Fri 17 Jun 03:22 PDT 2016, Neil Armstrong wrote:
> > 
> > [..]
> >> diff --git a/drivers/mfd/qcom_rpm.c b/drivers/mfd/qcom_rpm.c
> > [..]
> >> +
> >> +static const struct qcom_rpm_data mdm9615_template = {
> >> +	.version = 3,
> >> +	.resource_table = mdm9615_rpm_resource_table,
> >> +	.n_resources = ARRAY_SIZE(mdm9615_rpm_resource_table),
> >> +};
> > 
> > Please see:
> > https://patchwork.kernel.org/patch/9177159/
> > 
> > You should set the new .sel_size to 4 here, please either rebase ontop
> > of Linus patch or send an update after both are merged.
> > 
> >> +
> >>  static const struct of_device_id qcom_rpm_of_match[] = {
> >>  	{ .compatible = "qcom,rpm-apq8064", .data = &apq8064_template },
> >>  	{ .compatible = "qcom,rpm-msm8660", .data = &msm8660_template },
> >>  	{ .compatible = "qcom,rpm-msm8960", .data = &msm8960_template },
> >>  	{ .compatible = "qcom,rpm-ipq8064", .data = &ipq806x_template },
> >> +	{ .compatible = "qcom,rpm-mdm9615", .data = &mdm9615_template },
> >>  	{ }
> >>  };
> >>  MODULE_DEVICE_TABLE(of, qcom_rpm_of_match);
> >> diff --git a/include/dt-bindings/mfd/qcom-rpm.h b/include/dt-bindings/mfd/qcom-rpm.h
> >> index 13a9d4b..db85912 100644
> >> --- a/include/dt-bindings/mfd/qcom-rpm.h
> >> +++ b/include/dt-bindings/mfd/qcom-rpm.h
> >> @@ -148,6 +148,29 @@
> >>  #define QCOM_RPM_SMB208_S2a			138
> >>  #define QCOM_RPM_SMB208_S2b			139
> >>  
> >> +#define QCOM_RPM_PM8018_SMPS1			200
> > 
> > These numbers are a logical identifier and as such you shouldn't skip
> > 140-199.
> > 
> >> +#define QCOM_RPM_PM8018_SMPS2			201
> >> +#define QCOM_RPM_PM8018_SMPS3			202
> >> +#define QCOM_RPM_PM8018_SMPS4			203
> >> +#define QCOM_RPM_PM8018_SMPS5			204
> >> +#define QCOM_RPM_PM8018_LDO1			205
> >> +#define QCOM_RPM_PM8018_LDO2			206
> >> +#define QCOM_RPM_PM8018_LDO3			207
> >> +#define QCOM_RPM_PM8018_LDO4			208
> >> +#define QCOM_RPM_PM8018_LDO5			209
> >> +#define QCOM_RPM_PM8018_LDO6			210
> >> +#define QCOM_RPM_PM8018_LDO7			211
> >> +#define QCOM_RPM_PM8018_LDO8			212
> >> +#define QCOM_RPM_PM8018_LDO9			213
> >> +#define QCOM_RPM_PM8018_LDO10			214
> >> +#define QCOM_RPM_PM8018_LDO11			215
> >> +#define QCOM_RPM_PM8018_LDO12			216
> >> +#define QCOM_RPM_PM8018_LDO13			217
> >> +#define QCOM_RPM_PM8018_LDO14			218
> >> +#define QCOM_RPM_PM8018_LVS1			219
> >> +#define QCOM_RPM_NCP				220
> > 
> > We already have PM8921_NCP and PM8058_NCP, so better make this
> > QCOM_RPM_PM8018_NCP for consistency.
> > 
> >> +#define QCOM_RPM_VOLTAGE_CORNER			221
> >> +
> > 
> > Other then these details
> > Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> > 
> > Regards,
> > Bjorn
> > 
> Thanks,
> 
> I rebased on Linus two patches ("fix offset error for msm8660" and "parametrize also ack selector size")
> 
> I suppose I should also drop the QCOM_RPM_VOLTAGE_CORNER rpm entry also ?

The open question is how we expose the corner to client drivers, but
it's still part of the rpm protocol. So please leave it here.

Regards,
Bjorn

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

end of thread, other threads:[~2016-06-22 15:52 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-17 10:22 [PATCH 0/5] Add support for the Qualcomm PM8018 PMIC Neil Armstrong
2016-06-17 10:22 ` [PATCH 1/5] mfd: pm8921: Add support for pm8018 Neil Armstrong
2016-06-22  5:07   ` Bjorn Andersson
2016-06-17 10:22 ` [PATCH 2/5] input: pmic8xxx-pwrkey: Add support for pm8018 pwrkey Neil Armstrong
2016-06-18 16:21   ` Dmitry Torokhov
2016-06-22  5:25   ` Bjorn Andersson
2016-06-22  5:33     ` Dmitry Torokhov
2016-06-17 10:22 ` [PATCH 3/5] rtc: rtc-pm8xxx: Add support for pm8018 rtc Neil Armstrong
2016-06-21 16:24   ` Alexandre Belloni
2016-06-22  5:06   ` Bjorn Andersson
2016-06-17 10:22 ` [PATCH 4/5] mfd: qcom-rpm: Add support for pm8018 RPM Regulator Neil Armstrong
2016-06-22  5:23   ` Bjorn Andersson
2016-06-22  8:34     ` Neil Armstrong
2016-06-22 15:52       ` Bjorn Andersson
2016-06-17 10:22 ` [PATCH 5/5] regulator: qcom_rpm-regulator: Add support for pm8018 rpm regulator Neil Armstrong
2016-06-17 12:24   ` Mark Brown
2016-06-17 16:53   ` Bjorn Andersson
2016-06-18  9:47     ` Mark Brown
2016-06-20  9:03     ` Neil Armstrong
2016-06-22  8:39     ` Neil Armstrong

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).