linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Support for Qualcomm QPNP PMIC's
@ 2014-07-17 16:17 Stanimir Varbanov
  2014-07-17 16:17 ` [PATCH v2 1/4] mfd: pm8xxx-spmi: add support for Qualcomm SPMI PMICs Stanimir Varbanov
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Stanimir Varbanov @ 2014-07-17 16:17 UTC (permalink / raw)
  To: linux-arm-kernel

Hello everyone,

Here is the continuation of patch sets sent recently about Qualcomm
QPNP SPMI PMICs.

The previous version of the patch set can be found at [1].

Changes since v1:
 - removed completely custom *of* parser
 - renamed the mfd driver from qpnp-spmi to pm8xxx-spmi
 - now MFD_PM8XXX_SPMI Kconfig option depends on SPMI

Removing of the custom *of* parser leads to that that the *reg* devicetree
property cannot exist and therefore cannot be parsed to get PMIC peripheral
resources. I took this step aside because no one from mfd drivers does this
parsing. This will lead to inconvenience in the peripheral drivers to define
internally the SPMI base addresses depending on the compatible property
i.e. PMIC version. 

Comments are welcome!

regards,
Stan

[1] https://lkml.org/lkml/2014/7/8/428

Josh Cartwright (1):
  mfd: pm8xxx-spmi: add support for Qualcomm SPMI PMICs

Stanimir Varbanov (3):
  mfd: pm8xxx-spmi: document DT bindings for Qualcomm SPMI PMICs
  ARM: DT: qcom: add pm8941 and pm8841 device nodes
  mfd: pm8921: rename pm8921-core driver

 .../devicetree/bindings/mfd/qcom,pm8xxx-spmi.txt   |   49 +++++++++++++++
 arch/arm/boot/dts/qcom-msm8974.dtsi                |   37 ++++++++++++
 drivers/mfd/Kconfig                                |   30 +++++++--
 drivers/mfd/Makefile                               |    3 +-
 drivers/mfd/pm8xxx-spmi.c                          |   63 ++++++++++++++++++++
 drivers/mfd/{pm8921-core.c => pm8xxx-ssbi.c}       |   38 ++++++------
 6 files changed, 193 insertions(+), 27 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mfd/qcom,pm8xxx-spmi.txt
 create mode 100644 drivers/mfd/pm8xxx-spmi.c
 rename drivers/mfd/{pm8921-core.c => pm8xxx-ssbi.c} (92%)

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

* [PATCH v2 1/4] mfd: pm8xxx-spmi: add support for Qualcomm SPMI PMICs
  2014-07-17 16:17 [PATCH v2 0/4] Support for Qualcomm QPNP PMIC's Stanimir Varbanov
@ 2014-07-17 16:17 ` Stanimir Varbanov
  2014-07-22 11:03   ` Lee Jones
  2014-07-17 16:17 ` [PATCH v2 2/4] mfd: pm8xxx-spmi: document DT bindings " Stanimir Varbanov
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Stanimir Varbanov @ 2014-07-17 16:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Josh Cartwright <joshc@codeaurora.org>

The Qualcomm SPMI PMIC chips are components used with the
Snapdragon 800 series SoC family.  This driver exists
largely as a glue mfd component, it exists to be an owner
of an SPMI regmap for children devices described in
device tree.

Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
---
 drivers/mfd/Kconfig       |   16 +++++++++++
 drivers/mfd/Makefile      |    1 +
 drivers/mfd/pm8xxx-spmi.c |   63 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 80 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mfd/pm8xxx-spmi.c

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 6cc4b6a..122e2d9 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -524,6 +524,22 @@ config MFD_PM8921_CORE
 	  Say M here if you want to include support for PM8921 chip as a module.
 	  This will build a module called "pm8921-core".
 
+config MFD_PM8XXX_SPMI
+	tristate "Qualcomm PM8XXX SPMI PMICs"
+	depends on ARCH_QCOM || COMPILE_TEST
+	depends on OF
+	depends on SPMI
+	select MFD_PM8XXX
+	select REGMAP_SPMI
+	help
+	  This enables support for the Qualcomm PM8XXX SPMI PMICs.
+	  These PMICs are currently used with the Snapdragon 800 series of
+	  SoCs.  Note, that this will only be useful paired with descriptions
+	  of the independent functions as children nodes in the device tree.
+
+	  Say M here if you want to include support for the PM8XXX SPMI PMIC
+	  series as a module.  The module will be called "pm8xxx-spmi".
+
 config MFD_RDC321X
 	tristate "RDC R-321x southbridge"
 	select MFD_CORE
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 8afedba..93d82cc 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -153,6 +153,7 @@ obj-$(CONFIG_MFD_SI476X_CORE)	+= si476x-core.o
 obj-$(CONFIG_MFD_CS5535)	+= cs5535-mfd.o
 obj-$(CONFIG_MFD_OMAP_USB_HOST)	+= omap-usb-host.o omap-usb-tll.o
 obj-$(CONFIG_MFD_PM8921_CORE) 	+= pm8921-core.o ssbi.o
+obj-$(CONFIG_MFD_PM8XXX_SPMI)	+= pm8xxx-spmi.o
 obj-$(CONFIG_TPS65911_COMPARATOR)	+= tps65911-comparator.o
 obj-$(CONFIG_MFD_TPS65090)	+= tps65090.o
 obj-$(CONFIG_MFD_AAT2870_CORE)	+= aat2870-core.o
diff --git a/drivers/mfd/pm8xxx-spmi.c b/drivers/mfd/pm8xxx-spmi.c
new file mode 100644
index 0000000..882da5e
--- /dev/null
+++ b/drivers/mfd/pm8xxx-spmi.c
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2014, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/spmi.h>
+#include <linux/regmap.h>
+#include <linux/of_platform.h>
+
+static const struct regmap_config pm8xxx_regmap_config = {
+	.reg_bits	= 16,
+	.val_bits	= 8,
+	.max_register	= 0xffff,
+};
+
+static int pm8xxx_probe(struct spmi_device *sdev)
+{
+	struct device_node *root = sdev->dev.of_node;
+	struct regmap *regmap;
+
+	regmap = devm_regmap_init_spmi_ext(sdev, &pm8xxx_regmap_config);
+	if (IS_ERR(regmap))
+		return PTR_ERR(regmap);
+
+	return of_platform_populate(root, NULL, NULL, &sdev->dev);
+}
+
+static void pm8xxx_remove(struct spmi_device *sdev)
+{
+	of_platform_depopulate(&sdev->dev);
+}
+
+static const struct of_device_id pm8xxx_id_table[] = {
+	{ .compatible = "qcom,pm8941" },
+	{ .compatible = "qcom,pm8841" },
+	{ .compatible = "qcom,pma8084" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, pm8xxx_id_table);
+
+static struct spmi_driver pm8xxx_driver = {
+	.probe = pm8xxx_probe,
+	.remove = pm8xxx_remove,
+	.driver = {
+		.name = "pm8xxx-spmi",
+		.of_match_table = pm8xxx_id_table,
+	},
+};
+module_spmi_driver(pm8xxx_driver);
+
+MODULE_DESCRIPTION("PM8XXX SPMI PMIC driver");
+MODULE_ALIAS("platform:" KBUILD_MODNAME);
+MODULE_AUTHOR("The Linux Foundation");
+MODULE_LICENSE("GPL v2");
-- 
1.7.0.4

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

* [PATCH v2 2/4] mfd: pm8xxx-spmi: document DT bindings for Qualcomm SPMI PMICs
  2014-07-17 16:17 [PATCH v2 0/4] Support for Qualcomm QPNP PMIC's Stanimir Varbanov
  2014-07-17 16:17 ` [PATCH v2 1/4] mfd: pm8xxx-spmi: add support for Qualcomm SPMI PMICs Stanimir Varbanov
@ 2014-07-17 16:17 ` Stanimir Varbanov
  2014-07-17 16:17 ` [PATCH v2 3/4] ARM: DT: qcom: add pm8941 and pm8841 device nodes Stanimir Varbanov
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 15+ messages in thread
From: Stanimir Varbanov @ 2014-07-17 16:17 UTC (permalink / raw)
  To: linux-arm-kernel

Document DT bindings used to describe the Qualcomm SPMI PMICs.
Currently the SPMI PMICs supported are pm8941, pm8841 and pma8084.

Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
---
 .../devicetree/bindings/mfd/qcom,pm8xxx-spmi.txt   |   49 ++++++++++++++++++++
 1 files changed, 49 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mfd/qcom,pm8xxx-spmi.txt

diff --git a/Documentation/devicetree/bindings/mfd/qcom,pm8xxx-spmi.txt b/Documentation/devicetree/bindings/mfd/qcom,pm8xxx-spmi.txt
new file mode 100644
index 0000000..2b7f5b6
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/qcom,pm8xxx-spmi.txt
@@ -0,0 +1,49 @@
+          Qualcomm PM8XXX SPMI PMICs multi-function device bindings
+
+The Qualcomm PM8XXX series presently includes PM8941, PM8841 and PMA8084
+PMICs.  These PMICs use a QPNP scheme through SPMI interface.
+QPNP is effectively a partitioning scheme for dividing the SPMI extended
+register space up into logical pieces, and set of fixed register
+locations/definitions within these regions, with some of these regions
+specifically used for interrupt handling.
+
+The QPNP PMICs are used with the Qualcomm Snapdragon series SoCs, and are
+interfaced to the chip via the SPMI (System Power Management Interface) bus.
+Support for multiple independent functions are implemented by splitting the
+16-bit SPMI slave address space into 256 smaller fixed-size regions, 256 bytes
+each. A function can consume one or more of these fixed-size register regions.
+
+Required properties:
+- compatible:      Should contain one of:
+                     "qcom,pm8941"
+                     "qcom,pm8841"
+                     "qcom,pma8084"
+- reg:             Specifies the SPMI USID slave address for this device.
+                   For more information see:
+                   Documentation/devicetree/bindings/spmi/spmi.txt
+
+Required properties for peripheral child nodes:
+- compatible:      Should contain "qcom,pm8xxx-xxx", where "xxx" is
+                   peripheral name. The "pm8xxx" can be any of supported PMICs,
+                   see example below.
+
+Optional properties for peripheral child nodes:
+- interrupts:      Interrupts are specified as a 4-tuple. For more information
+                   see:
+                   Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb.txt
+- interrupt-names: Corresponding interrupt name to the interrupts property
+
+Each child node represents a function of the PMIC.
+
+Example:
+
+	pm8941 at 0 {
+		compatible = "qcom,pm8941";
+		reg = <0x0 SPMI_USID>;
+
+		rtc {
+			compatible = "qcom,pm8941-rtc";
+			interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
+			interrupt-names = "alarm";
+		};
+	};
-- 
1.7.0.4

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

* [PATCH v2 3/4] ARM: DT: qcom: add pm8941 and pm8841 device nodes
  2014-07-17 16:17 [PATCH v2 0/4] Support for Qualcomm QPNP PMIC's Stanimir Varbanov
  2014-07-17 16:17 ` [PATCH v2 1/4] mfd: pm8xxx-spmi: add support for Qualcomm SPMI PMICs Stanimir Varbanov
  2014-07-17 16:17 ` [PATCH v2 2/4] mfd: pm8xxx-spmi: document DT bindings " Stanimir Varbanov
@ 2014-07-17 16:17 ` Stanimir Varbanov
  2014-07-17 16:17 ` [PATCH v2 4/4] mfd: pm8921: rename pm8921-core driver Stanimir Varbanov
  2014-07-17 23:10 ` [PATCH v2 0/4] Support for Qualcomm QPNP PMIC's Stephen Boyd
  4 siblings, 0 replies; 15+ messages in thread
From: Stanimir Varbanov @ 2014-07-17 16:17 UTC (permalink / raw)
  To: linux-arm-kernel

The pm8941 and pm8841 spmi devicetree nodes are childrens of
spmi pmic arbiter. The msm8974 SoC uses two PMIC chips
pm8941 and pm8841. Every PMIC chip has two spmi bus slave id's.

Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
---
 arch/arm/boot/dts/qcom-msm8974.dtsi |   37 +++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi
index 69dca2a..cb05603 100644
--- a/arch/arm/boot/dts/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8974.dtsi
@@ -3,6 +3,7 @@
 #include "skeleton.dtsi"
 
 #include <dt-bindings/clock/qcom,gcc-msm8974.h>
+#include <dt-bindings/spmi/spmi.h>
 
 / {
 	model = "Qualcomm MSM8974";
@@ -236,5 +237,41 @@
 			#interrupt-cells = <2>;
 			interrupts = <0 208 0>;
 		};
+
+		spmi at fc4cf000 {
+			compatible = "qcom,spmi-pmic-arb";
+			reg-names = "core", "intr", "cnfg";
+			reg = <0xfc4cf000 0x1000>,
+			      <0xfc4cb000 0x1000>,
+			      <0xfc4ca000 0x1000>;
+			interrupt-names = "periph_irq";
+			interrupts = <0 190 0>;
+			qcom,ee = <0>;
+			qcom,channel = <0>;
+			#address-cells = <2>;
+			#size-cells = <0>;
+			interrupt-controller;
+			#interrupt-cells = <4>;
+
+			usid0: pm8941 at 0 {
+				compatible = "qcom,pm8941";
+				reg = <0x0 SPMI_USID>;
+			};
+
+			usid1: pm8941 at 1 {
+				compatible = "qcom,pm8941";
+				reg = <0x1 SPMI_USID>;
+			};
+
+			usid4: pm8841 at 4 {
+				compatible = "qcom,pm8841";
+				reg = <0x4 SPMI_USID>;
+			};
+
+			usid5: pm8841 at 5 {
+				compatible = "qcom,pm8841";
+				reg = <0x5 SPMI_USID>;
+			};
+		};
 	};
 };
-- 
1.7.0.4

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

* [PATCH v2 4/4] mfd: pm8921: rename pm8921-core driver
  2014-07-17 16:17 [PATCH v2 0/4] Support for Qualcomm QPNP PMIC's Stanimir Varbanov
                   ` (2 preceding siblings ...)
  2014-07-17 16:17 ` [PATCH v2 3/4] ARM: DT: qcom: add pm8941 and pm8841 device nodes Stanimir Varbanov
@ 2014-07-17 16:17 ` Stanimir Varbanov
  2014-07-18 13:15   ` Prakash Burla
  2014-07-22 10:32   ` Lee Jones
  2014-07-17 23:10 ` [PATCH v2 0/4] Support for Qualcomm QPNP PMIC's Stephen Boyd
  4 siblings, 2 replies; 15+ messages in thread
From: Stanimir Varbanov @ 2014-07-17 16:17 UTC (permalink / raw)
  To: linux-arm-kernel

The pm8921-core driver presently supports pm8921 and pm8058
Qualcomm PMICs.  To avoid confusion with new generation PMICs
(like pm8941) rename the pm8921-core driver to more
appropriate name pm8xxx-ssbi, which reflects better that
those chips use SSBI interface.

Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
---
 drivers/mfd/Kconfig                          |   14 +++++-----
 drivers/mfd/Makefile                         |    2 +-
 drivers/mfd/{pm8921-core.c => pm8xxx-ssbi.c} |   38 +++++++++++++-------------
 3 files changed, 27 insertions(+), 27 deletions(-)
 rename drivers/mfd/{pm8921-core.c => pm8xxx-ssbi.c} (92%)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 122e2d9..884bc32 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -507,8 +507,8 @@ config UCB1400_CORE
 config MFD_PM8XXX
 	tristate
 
-config MFD_PM8921_CORE
-	tristate "Qualcomm PM8921 PMIC chip"
+config MFD_PM8XXX_SSBI
+	tristate "Qualcomm PM8XXX SSBI PMICs"
 	depends on (ARM || HEXAGON)
 	select IRQ_DOMAIN
 	select MFD_CORE
@@ -516,13 +516,13 @@ config MFD_PM8921_CORE
 	select REGMAP
 	help
 	  If you say yes to this option, support will be included for the
-	  built-in PM8921 PMIC chip.
+	  built-in PM8921 and PM8058 PMIC chips.
 
-	  This is required if your board has a PM8921 and uses its features,
-	  such as: MPPs, GPIOs, regulators, interrupts, and PWM.
+	  This is required if your board has a PM8921 or PM8058 and uses
+	  its features, such as: MPPs, GPIOs, regulators, interrupts, and PWM.
 
-	  Say M here if you want to include support for PM8921 chip as a module.
-	  This will build a module called "pm8921-core".
+	  Say M here if you want to include support for PM8921 or PM8058 chip
+	  as a module. This will build a module called "pm8xxx-ssbi".
 
 config MFD_PM8XXX_SPMI
 	tristate "Qualcomm PM8XXX SPMI PMICs"
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 93d82cc..d332085 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -152,7 +152,7 @@ obj-$(CONFIG_MFD_SI476X_CORE)	+= si476x-core.o
 
 obj-$(CONFIG_MFD_CS5535)	+= cs5535-mfd.o
 obj-$(CONFIG_MFD_OMAP_USB_HOST)	+= omap-usb-host.o omap-usb-tll.o
-obj-$(CONFIG_MFD_PM8921_CORE) 	+= pm8921-core.o ssbi.o
+obj-$(CONFIG_MFD_PM8XXX_SSBI) 	+= pm8xxx-ssbi.o ssbi.o
 obj-$(CONFIG_MFD_PM8XXX_SPMI)	+= pm8xxx-spmi.o
 obj-$(CONFIG_TPS65911_COMPARATOR)	+= tps65911-comparator.o
 obj-$(CONFIG_MFD_TPS65090)	+= tps65090.o
diff --git a/drivers/mfd/pm8921-core.c b/drivers/mfd/pm8xxx-ssbi.c
similarity index 92%
rename from drivers/mfd/pm8921-core.c
rename to drivers/mfd/pm8xxx-ssbi.c
index 9595138..102d7fb 100644
--- a/drivers/mfd/pm8921-core.c
+++ b/drivers/mfd/pm8xxx-ssbi.c
@@ -277,14 +277,14 @@ static const struct regmap_config ssbi_regmap_config = {
 	.reg_write = ssbi_reg_write
 };
 
-static const struct of_device_id pm8921_id_table[] = {
+static const struct of_device_id pm8xxx_id_table[] = {
 	{ .compatible = "qcom,pm8058", },
 	{ .compatible = "qcom,pm8921", },
 	{ }
 };
-MODULE_DEVICE_TABLE(of, pm8921_id_table);
+MODULE_DEVICE_TABLE(of, pm8xxx_id_table);
 
-static int pm8921_probe(struct platform_device *pdev)
+static int pm8xxx_probe(struct platform_device *pdev)
 {
 	struct regmap *regmap;
 	int irq, rc;
@@ -354,18 +354,18 @@ static int pm8921_probe(struct platform_device *pdev)
 	return rc;
 }
 
-static int pm8921_remove_child(struct device *dev, void *unused)
+static int pm8xxx_remove_child(struct device *dev, void *unused)
 {
 	platform_device_unregister(to_platform_device(dev));
 	return 0;
 }
 
-static int pm8921_remove(struct platform_device *pdev)
+static int pm8xxx_remove(struct platform_device *pdev)
 {
 	int irq = platform_get_irq(pdev, 0);
 	struct pm_irq_chip *chip = platform_get_drvdata(pdev);
 
-	device_for_each_child(&pdev->dev, NULL, pm8921_remove_child);
+	device_for_each_child(&pdev->dev, NULL, pm8xxx_remove_child);
 	irq_set_chained_handler(irq, NULL);
 	irq_set_handler_data(irq, NULL);
 	irq_domain_remove(chip->irqdomain);
@@ -373,29 +373,29 @@ static int pm8921_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static struct platform_driver pm8921_driver = {
-	.probe		= pm8921_probe,
-	.remove		= pm8921_remove,
+static struct platform_driver pm8xxx_driver = {
+	.probe		= pm8xxx_probe,
+	.remove		= pm8xxx_remove,
 	.driver		= {
-		.name	= "pm8921-core",
+		.name	= "pm8xxx-ssbi",
 		.owner	= THIS_MODULE,
-		.of_match_table = pm8921_id_table,
+		.of_match_table = pm8xxx_id_table,
 	},
 };
 
-static int __init pm8921_init(void)
+static int __init pm8xxx_init(void)
 {
-	return platform_driver_register(&pm8921_driver);
+	return platform_driver_register(&pm8xxx_driver);
 }
-subsys_initcall(pm8921_init);
+subsys_initcall(pm8xxx_init);
 
-static void __exit pm8921_exit(void)
+static void __exit pm8xxx_exit(void)
 {
-	platform_driver_unregister(&pm8921_driver);
+	platform_driver_unregister(&pm8xxx_driver);
 }
-module_exit(pm8921_exit);
+module_exit(pm8xxx_exit);
 
 MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("PMIC 8921 core driver");
+MODULE_DESCRIPTION("PMIC PM8XXX SSBI driver");
 MODULE_VERSION("1.0");
-MODULE_ALIAS("platform:pm8921-core");
+MODULE_ALIAS("platform:pm8xxx-ssbi");
-- 
1.7.0.4

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

* [PATCH v2 0/4] Support for Qualcomm QPNP PMIC's
  2014-07-17 16:17 [PATCH v2 0/4] Support for Qualcomm QPNP PMIC's Stanimir Varbanov
                   ` (3 preceding siblings ...)
  2014-07-17 16:17 ` [PATCH v2 4/4] mfd: pm8921: rename pm8921-core driver Stanimir Varbanov
@ 2014-07-17 23:10 ` Stephen Boyd
  2014-07-18 16:13   ` Stanimir Varbanov
  4 siblings, 1 reply; 15+ messages in thread
From: Stephen Boyd @ 2014-07-17 23:10 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/17/14 09:17, Stanimir Varbanov wrote:
> Hello everyone,
>
> Here is the continuation of patch sets sent recently about Qualcomm
> QPNP SPMI PMICs.
>
> The previous version of the patch set can be found at [1].
>
> Changes since v1:
>  - removed completely custom *of* parser
>  - renamed the mfd driver from qpnp-spmi to pm8xxx-spmi
>  - now MFD_PM8XXX_SPMI Kconfig option depends on SPMI
>
> Removing of the custom *of* parser leads to that that the *reg* devicetree
> property cannot exist and therefore cannot be parsed to get PMIC peripheral
> resources. I took this step aside because no one from mfd drivers does this
> parsing. This will lead to inconvenience in the peripheral drivers to define
> internally the SPMI base addresses depending on the compatible property
> i.e. PMIC version. 

We should teach the of platform layer to translate reg properties up
until the point that they can't be translated anymore. If they can't be
translated all the way back to cpu addresses we can make the resource
have IORESOURCE_REG instead of IORESOURCE_MEM and then said pmic
platform drivers can use platform_get_resource() with IORESOURCE_REG
instead of IORESOURCE_MEM to get the addresses.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

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

* [PATCH v2 4/4] mfd: pm8921: rename pm8921-core driver
  2014-07-17 16:17 ` [PATCH v2 4/4] mfd: pm8921: rename pm8921-core driver Stanimir Varbanov
@ 2014-07-18 13:15   ` Prakash Burla
  2014-07-21  7:46     ` Lee Jones
  2014-07-22 10:32   ` Lee Jones
  1 sibling, 1 reply; 15+ messages in thread
From: Prakash Burla @ 2014-07-18 13:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 17, 2014 at 9:47 PM, Stanimir Varbanov <svarbanov@mm-sol.com> wrote:
> The pm8921-core driver presently supports pm8921 and pm8058
> Qualcomm PMICs.  To avoid confusion with new generation PMICs
> (like pm8941) rename the pm8921-core driver to more
> appropriate name pm8xxx-ssbi, which reflects better that
> those chips use SSBI interface.
>
> Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
> ---
>  drivers/mfd/Kconfig                          |   14 +++++-----
>  drivers/mfd/Makefile                         |    2 +-
>  drivers/mfd/{pm8921-core.c => pm8xxx-ssbi.c} |   38 +++++++++++++-------------
>  3 files changed, 27 insertions(+), 27 deletions(-)
>  rename drivers/mfd/{pm8921-core.c => pm8xxx-ssbi.c} (92%)
 .
 [Nope]
>  MODULE_LICENSE("GPL v2");
> -MODULE_DESCRIPTION("PMIC 8921 core driver");
> +MODULE_DESCRIPTION("PMIC PM8XXX SSBI driver");
>  MODULE_VERSION("1.0");
> -MODULE_ALIAS("platform:pm8921-core");
> +MODULE_ALIAS("platform:pm8xxx-ssbi");
 >How about adding the module author as svarbanov at mm-sol.com/qcom?
      MODULE_AUTHOR("SVARBANOV<svarbanov@mm-sol.com>");
> --
> 1.7.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* [PATCH v2 0/4] Support for Qualcomm QPNP PMIC's
  2014-07-17 23:10 ` [PATCH v2 0/4] Support for Qualcomm QPNP PMIC's Stephen Boyd
@ 2014-07-18 16:13   ` Stanimir Varbanov
  2014-07-30  0:56     ` Grant Likely
  0 siblings, 1 reply; 15+ messages in thread
From: Stanimir Varbanov @ 2014-07-18 16:13 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/18/2014 02:10 AM, Stephen Boyd wrote:
> On 07/17/14 09:17, Stanimir Varbanov wrote:
>> Hello everyone,
>>
>> Here is the continuation of patch sets sent recently about Qualcomm
>> QPNP SPMI PMICs.
>>
>> The previous version of the patch set can be found at [1].
>>
>> Changes since v1:
>>  - removed completely custom *of* parser
>>  - renamed the mfd driver from qpnp-spmi to pm8xxx-spmi
>>  - now MFD_PM8XXX_SPMI Kconfig option depends on SPMI
>>
>> Removing of the custom *of* parser leads to that that the *reg* devicetree
>> property cannot exist and therefore cannot be parsed to get PMIC peripheral
>> resources. I took this step aside because no one from mfd drivers does this
>> parsing. This will lead to inconvenience in the peripheral drivers to define
>> internally the SPMI base addresses depending on the compatible property
>> i.e. PMIC version. 
> 
> We should teach the of platform layer to translate reg properties up
> until the point that they can't be translated anymore. If they can't be
> translated all the way back to cpu addresses we can make the resource
> have IORESOURCE_REG instead of IORESOURCE_MEM and then said pmic
> platform drivers can use platform_get_resource() with IORESOURCE_REG
> instead of IORESOURCE_MEM to get the addresses.
> 

I considered this as an option, if it is acceptable by OF maintainers it
will be awesome.

Rob, Grant, is that feasible?

-- 
regards,
Stan

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

* [PATCH v2 4/4] mfd: pm8921: rename pm8921-core driver
  2014-07-18 13:15   ` Prakash Burla
@ 2014-07-21  7:46     ` Lee Jones
  0 siblings, 0 replies; 15+ messages in thread
From: Lee Jones @ 2014-07-21  7:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 18 Jul 2014, Prakash Burla wrote:
> On Thu, Jul 17, 2014 at 9:47 PM, Stanimir Varbanov <svarbanov@mm-sol.com> wrote:
> > The pm8921-core driver presently supports pm8921 and pm8058
> > Qualcomm PMICs.  To avoid confusion with new generation PMICs
> > (like pm8941) rename the pm8921-core driver to more
> > appropriate name pm8xxx-ssbi, which reflects better that
> > those chips use SSBI interface.
> >
> > Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
> > ---
> >  drivers/mfd/Kconfig                          |   14 +++++-----
> >  drivers/mfd/Makefile                         |    2 +-
> >  drivers/mfd/{pm8921-core.c => pm8xxx-ssbi.c} |   38 +++++++++++++-------------
> >  3 files changed, 27 insertions(+), 27 deletions(-)
> >  rename drivers/mfd/{pm8921-core.c => pm8xxx-ssbi.c} (92%)
>  .
>  [Nope]

What does this mean?

> >  MODULE_LICENSE("GPL v2");
> > -MODULE_DESCRIPTION("PMIC 8921 core driver");
> > +MODULE_DESCRIPTION("PMIC PM8XXX SSBI driver");
> >  MODULE_VERSION("1.0");
> > -MODULE_ALIAS("platform:pm8921-core");
> > +MODULE_ALIAS("platform:pm8xxx-ssbi");
>  >How about adding the module author as svarbanov at mm-sol.com/qcom?
>       MODULE_AUTHOR("SVARBANOV<svarbanov@mm-sol.com>");

Module author has the same standards as Git author.

MODULE_AUTHOR("Stanimir Varbanov <svarbanov@mm-sol.com>");

-- 
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] 15+ messages in thread

* [PATCH v2 4/4] mfd: pm8921: rename pm8921-core driver
  2014-07-17 16:17 ` [PATCH v2 4/4] mfd: pm8921: rename pm8921-core driver Stanimir Varbanov
  2014-07-18 13:15   ` Prakash Burla
@ 2014-07-22 10:32   ` Lee Jones
  2014-07-22 11:54     ` Stanimir Varbanov
  1 sibling, 1 reply; 15+ messages in thread
From: Lee Jones @ 2014-07-22 10:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 17 Jul 2014, Stanimir Varbanov wrote:

> The pm8921-core driver presently supports pm8921 and pm8058
> Qualcomm PMICs.  To avoid confusion with new generation PMICs
> (like pm8941) rename the pm8921-core driver to more
> appropriate name pm8xxx-ssbi, which reflects better that
> those chips use SSBI interface.
> 
> Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
> ---
>  drivers/mfd/Kconfig                          |   14 +++++-----
>  drivers/mfd/Makefile                         |    2 +-
>  drivers/mfd/{pm8921-core.c => pm8xxx-ssbi.c} |   38 +++++++++++++-------------
>  3 files changed, 27 insertions(+), 27 deletions(-)
>  rename drivers/mfd/{pm8921-core.c => pm8xxx-ssbi.c} (92%)

Patch looks fine to me.

  Acked-by: Lee Jones <lee.jones@linaro.org>

I'm assuming we want to wait for the others in the set to be ready
before applying?

[...]

-- 
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] 15+ messages in thread

* [PATCH v2 1/4] mfd: pm8xxx-spmi: add support for Qualcomm SPMI PMICs
  2014-07-17 16:17 ` [PATCH v2 1/4] mfd: pm8xxx-spmi: add support for Qualcomm SPMI PMICs Stanimir Varbanov
@ 2014-07-22 11:03   ` Lee Jones
  2014-07-22 11:51     ` Stanimir Varbanov
  0 siblings, 1 reply; 15+ messages in thread
From: Lee Jones @ 2014-07-22 11:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 17 Jul 2014, Stanimir Varbanov wrote:

> From: Josh Cartwright <joshc@codeaurora.org>
> 
> The Qualcomm SPMI PMIC chips are components used with the
> Snapdragon 800 series SoC family.  This driver exists
> largely as a glue mfd component, it exists to be an owner
> of an SPMI regmap for children devices described in
> device tree.
> 
> Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>

Needs to be signed off by the author.

> ---
>  drivers/mfd/Kconfig       |   16 +++++++++++
>  drivers/mfd/Makefile      |    1 +
>  drivers/mfd/pm8xxx-spmi.c |   63 +++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 80 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/mfd/pm8xxx-spmi.c

[...]

> +++ b/drivers/mfd/pm8xxx-spmi.c
> @@ -0,0 +1,63 @@
> +/*
> + * Copyright (c) 2014, The Linux Foundation. All rights reserved.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 and
> + * only version 2 as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */

There should be a '\n' here.

> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/spmi.h>
> +#include <linux/regmap.h>
> +#include <linux/of_platform.h>

[...]

> +MODULE_DESCRIPTION("PM8XXX SPMI PMIC driver");
> +MODULE_ALIAS("platform:" KBUILD_MODNAME);
> +MODULE_AUTHOR("The Linux Foundation");

The Linux Foundation did not write this patch.

> +MODULE_LICENSE("GPL v2");

Appart from that:

Acked-by: Lee Jones <lee.jones@linaro.org>

-- 
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] 15+ messages in thread

* [PATCH v2 1/4] mfd: pm8xxx-spmi: add support for Qualcomm SPMI PMICs
  2014-07-22 11:03   ` Lee Jones
@ 2014-07-22 11:51     ` Stanimir Varbanov
  0 siblings, 0 replies; 15+ messages in thread
From: Stanimir Varbanov @ 2014-07-22 11:51 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/22/2014 02:03 PM, Lee Jones wrote:
> On Thu, 17 Jul 2014, Stanimir Varbanov wrote:
> 
>> From: Josh Cartwright <joshc@codeaurora.org>
>>
>> The Qualcomm SPMI PMIC chips are components used with the
>> Snapdragon 800 series SoC family.  This driver exists
>> largely as a glue mfd component, it exists to be an owner
>> of an SPMI regmap for children devices described in
>> device tree.
>>
>> Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
> 
> Needs to be signed off by the author.
> 
>> ---
>>  drivers/mfd/Kconfig       |   16 +++++++++++
>>  drivers/mfd/Makefile      |    1 +
>>  drivers/mfd/pm8xxx-spmi.c |   63 +++++++++++++++++++++++++++++++++++++++++++++
>>  3 files changed, 80 insertions(+), 0 deletions(-)
>>  create mode 100644 drivers/mfd/pm8xxx-spmi.c
> 
> [...]
> 
>> +++ b/drivers/mfd/pm8xxx-spmi.c
>> @@ -0,0 +1,63 @@
>> +/*
>> + * Copyright (c) 2014, The Linux Foundation. All rights reserved.
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 and
>> + * only version 2 as published by the Free Software Foundation.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + * GNU General Public License for more details.
>> + */
> 
> There should be a '\n' here.

OK.

> 
>> +#include <linux/kernel.h>
>> +#include <linux/module.h>
>> +#include <linux/spmi.h>
>> +#include <linux/regmap.h>
>> +#include <linux/of_platform.h>
> 
> [...]
> 
>> +MODULE_DESCRIPTION("PM8XXX SPMI PMIC driver");
>> +MODULE_ALIAS("platform:" KBUILD_MODNAME);

I will change this to:

MODULE_ALIAS("spmi:pm8xxx-spmi");

>> +MODULE_AUTHOR("The Linux Foundation");
> 
> The Linux Foundation did not write this patch.

OK, I will change the author or remove the tag completely.

> 
>> +MODULE_LICENSE("GPL v2");
> 
> Appart from that:
> 
> Acked-by: Lee Jones <lee.jones@linaro.org>
> 

Thanks. I will resend the whole patch set with your acks.

-- 
regards,
Stan

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

* [PATCH v2 4/4] mfd: pm8921: rename pm8921-core driver
  2014-07-22 10:32   ` Lee Jones
@ 2014-07-22 11:54     ` Stanimir Varbanov
  2014-07-22 12:17       ` Lee Jones
  0 siblings, 1 reply; 15+ messages in thread
From: Stanimir Varbanov @ 2014-07-22 11:54 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/22/2014 01:32 PM, Lee Jones wrote:
> On Thu, 17 Jul 2014, Stanimir Varbanov wrote:
> 
>> The pm8921-core driver presently supports pm8921 and pm8058
>> Qualcomm PMICs.  To avoid confusion with new generation PMICs
>> (like pm8941) rename the pm8921-core driver to more
>> appropriate name pm8xxx-ssbi, which reflects better that
>> those chips use SSBI interface.
>>
>> Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
>> ---
>>  drivers/mfd/Kconfig                          |   14 +++++-----
>>  drivers/mfd/Makefile                         |    2 +-
>>  drivers/mfd/{pm8921-core.c => pm8xxx-ssbi.c} |   38 +++++++++++++-------------
>>  3 files changed, 27 insertions(+), 27 deletions(-)
>>  rename drivers/mfd/{pm8921-core.c => pm8xxx-ssbi.c} (92%)
> 
> Patch looks fine to me.
> 
>   Acked-by: Lee Jones <lee.jones@linaro.org>
> 
> I'm assuming we want to wait for the others in the set to be ready
> before applying?

yes, I think you will need an ack for the DT binding document?

-- 
regards,
Stan

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

* [PATCH v2 4/4] mfd: pm8921: rename pm8921-core driver
  2014-07-22 11:54     ` Stanimir Varbanov
@ 2014-07-22 12:17       ` Lee Jones
  0 siblings, 0 replies; 15+ messages in thread
From: Lee Jones @ 2014-07-22 12:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 22 Jul 2014, Stanimir Varbanov wrote:

> On 07/22/2014 01:32 PM, Lee Jones wrote:
> > On Thu, 17 Jul 2014, Stanimir Varbanov wrote:
> > 
> >> The pm8921-core driver presently supports pm8921 and pm8058
> >> Qualcomm PMICs.  To avoid confusion with new generation PMICs
> >> (like pm8941) rename the pm8921-core driver to more
> >> appropriate name pm8xxx-ssbi, which reflects better that
> >> those chips use SSBI interface.
> >>
> >> Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
> >> ---
> >>  drivers/mfd/Kconfig                          |   14 +++++-----
> >>  drivers/mfd/Makefile                         |    2 +-
> >>  drivers/mfd/{pm8921-core.c => pm8xxx-ssbi.c} |   38 +++++++++++++-------------
> >>  3 files changed, 27 insertions(+), 27 deletions(-)
> >>  rename drivers/mfd/{pm8921-core.c => pm8xxx-ssbi.c} (92%)
> > 
> > Patch looks fine to me.
> > 
> >   Acked-by: Lee Jones <lee.jones@linaro.org>
> > 
> > I'm assuming we want to wait for the others in the set to be ready
> > before applying?
> 
> yes, I think you will need an ack for the DT binding document?

I prefer to leave these to the DT guys.

-- 
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] 15+ messages in thread

* [PATCH v2 0/4] Support for Qualcomm QPNP PMIC's
  2014-07-18 16:13   ` Stanimir Varbanov
@ 2014-07-30  0:56     ` Grant Likely
  0 siblings, 0 replies; 15+ messages in thread
From: Grant Likely @ 2014-07-30  0:56 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 18 Jul 2014 19:13:52 +0300, Stanimir Varbanov <svarbanov@mm-sol.com> wrote:
> On 07/18/2014 02:10 AM, Stephen Boyd wrote:
> > On 07/17/14 09:17, Stanimir Varbanov wrote:
> >> Hello everyone,
> >>
> >> Here is the continuation of patch sets sent recently about Qualcomm
> >> QPNP SPMI PMICs.
> >>
> >> The previous version of the patch set can be found at [1].
> >>
> >> Changes since v1:
> >>  - removed completely custom *of* parser
> >>  - renamed the mfd driver from qpnp-spmi to pm8xxx-spmi
> >>  - now MFD_PM8XXX_SPMI Kconfig option depends on SPMI
> >>
> >> Removing of the custom *of* parser leads to that that the *reg* devicetree
> >> property cannot exist and therefore cannot be parsed to get PMIC peripheral
> >> resources. I took this step aside because no one from mfd drivers does this
> >> parsing. This will lead to inconvenience in the peripheral drivers to define
> >> internally the SPMI base addresses depending on the compatible property
> >> i.e. PMIC version. 
> > 
> > We should teach the of platform layer to translate reg properties up
> > until the point that they can't be translated anymore. If they can't be
> > translated all the way back to cpu addresses we can make the resource
> > have IORESOURCE_REG instead of IORESOURCE_MEM and then said pmic
> > platform drivers can use platform_get_resource() with IORESOURCE_REG
> > instead of IORESOURCE_MEM to get the addresses.
> > 
> 
> I considered this as an option, if it is acceptable by OF maintainers it
> will be awesome.
> 
> Rob, Grant, is that feasible?

It doesn't really make sense to do that kind of translation because the
resulting address only makes sense if you also know which node the
translation stopped at.

A better solution is a new api for retrieving bus-local addresses
instead of a global physical address. That would requires passing in a
node or device to use as the translation root. If the child isn't a
descended of that node, or if translation isn't possible then it should
straight out fail instead of providing a partially translated value.

g.

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

end of thread, other threads:[~2014-07-30  0:56 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-17 16:17 [PATCH v2 0/4] Support for Qualcomm QPNP PMIC's Stanimir Varbanov
2014-07-17 16:17 ` [PATCH v2 1/4] mfd: pm8xxx-spmi: add support for Qualcomm SPMI PMICs Stanimir Varbanov
2014-07-22 11:03   ` Lee Jones
2014-07-22 11:51     ` Stanimir Varbanov
2014-07-17 16:17 ` [PATCH v2 2/4] mfd: pm8xxx-spmi: document DT bindings " Stanimir Varbanov
2014-07-17 16:17 ` [PATCH v2 3/4] ARM: DT: qcom: add pm8941 and pm8841 device nodes Stanimir Varbanov
2014-07-17 16:17 ` [PATCH v2 4/4] mfd: pm8921: rename pm8921-core driver Stanimir Varbanov
2014-07-18 13:15   ` Prakash Burla
2014-07-21  7:46     ` Lee Jones
2014-07-22 10:32   ` Lee Jones
2014-07-22 11:54     ` Stanimir Varbanov
2014-07-22 12:17       ` Lee Jones
2014-07-17 23:10 ` [PATCH v2 0/4] Support for Qualcomm QPNP PMIC's Stephen Boyd
2014-07-18 16:13   ` Stanimir Varbanov
2014-07-30  0:56     ` Grant Likely

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