Skip to contentSkip to conversation

ARM: dts: qcom: Add binding for the qcom coincell charger

PATCH In review Tim Bird 4 participants 9 messages Jul 16, 2015 – Jul 29, 2015

Subsystems (3)
lore
Share & tools
lore

Tim Bird

author
#0 lore raw

PATCH v3 1/3 ARM: dts: qcom: Add binding for the qcom coincell charger

This binding is used to configure the driver for the coincell charger found in Qualcomm PMICs.

---

Changes in v3:
- change charge-enable property to charger-disable
Changes in v2:
- remove 'qcom,' from example node name
- Added reference to parent node pm8941@0 and binding doc for it

 .../bindings/power/qcom,coincell-charger.txt       | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/qcom,coincell-charger.txt
Documentation/devicetree/bindings/power/qcom,coincell-charger.txt new file +48 -0
new file mode 100644
index 0000000..0e6d875
@@ -0,0 +1,48 @@
+Qualcomm Coincell Charger:
+
+The hardware block controls charging for a coincell or capacitor that is
+used to provide power backup for certain features of the power management
+IC (PMIC)
+
+- compatible:
+	Usage: required
+	Value type: <string>
+	Definition: must be: "qcom,pm8941-coincell"
+
+- reg:
+	Usage: required
+	Value type: <u32>
+	Definition: base address of the coincell charger registers
+
+- qcom,rset-ohms:
+	Usage: required
+	Value type: <u32>
+	Definition: resistance (in ohms) for current-limiting resistor
+		must be one of: 800, 1200, 1700, 2100
+
+- qcom,vset-millivolts:
+	Usage: required
+	Value type: <u32>
+	Definition: voltage (in millivolts) to apply for charging
+		must be one of: 2500, 3000, 3100, 3200
+
+- qcom,charger-disable:
+	Usage: optional
+	Value type: <boolean>
+	Definition: definining this property disables charging
+
+This charger is a sub-node of one of the 8941 PMIC blocks, and is specified
+as a child node in DTS of that node.  See ../mfd/qcom,spmi-pmic.txt and
+../mfd/qcom-pm8xxx.txt
+
+Example:
+
+	pm8941@0 {
+		coincell@2800 {
+			compatible = "qcom,pm8941-coincell";
+			reg = <0x2800>;
+
+			qcom,rset-ohms = <2100>;
+			qcom,vset-millivolts = <3000>;
+		};
+	};
Signature · 6 lines
1.8.2.2

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#1 lore raw

PATCH v3 2/3 ARM: qcom: Add coincell charger driver

This driver is used to configure the coincell charger found in Qualcomm PMICs.

The driver allows configuring the current-limiting resistor for the charger, as well as the voltage to apply to the coincell (or capacitor) when charging.

---

Changes in v3:
- change 'depends on' in Kconfig
- remove 'select REGMAP' in Kconfig
- put spaces in map lists
- use 'bool' type for enable variable
- remove some printks
- add missing braces in error handling in qcom_coincell_chgr_config
- eliminate of_node NULL check in probe routine
- rename driver to qcom-spmi-coincell
- put struct qcom_coincell on stack, instead of allocating it
- return the result of a function directly (in a few places)
- reorder operations to avoid partial register update

 drivers/misc/Kconfig         |  10 +++
 drivers/misc/Makefile        |   1 +
 drivers/misc/qcom-coincell.c | 152 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 163 insertions(+)
 create mode 100644 drivers/misc/qcom-coincell.c
drivers/misc/Kconfig +10 -0
index 42c3852..ccccc29 100644
@@ -271,6 +271,16 @@ config HP_ILO
 	  To compile this driver as a module, choose M here: the
 	  module will be called hpilo.
 
+config QCOM_COINCELL
+	tristate "Qualcomm coincell charger support"
+	depends on MFD_SPMI_PMIC || COMPILE_TEST
+	help
+	  This driver supports the coincell block found inside of
+	  Qualcomm PMICs.  The coincell charger provides a means to
+	  charge a coincell battery or backup capacitor which is used
+	  to maintain PMIC register and RTC state in the absence of
+	  external power.
+
 config SGI_GRU
 	tristate "SGI GRU driver"
 	depends on X86_UV && SMP
drivers/misc/Makefile +1 -0
index d056fb7..537d7f3 100644
@@ -18,6 +18,7 @@ obj-$(CONFIG_LKDTM)		+= lkdtm.o
 obj-$(CONFIG_TIFM_CORE)       	+= tifm_core.o
 obj-$(CONFIG_TIFM_7XX1)       	+= tifm_7xx1.o
 obj-$(CONFIG_PHANTOM)		+= phantom.o
+obj-$(CONFIG_QCOM_COINCELL)	+= qcom-coincell.o
 obj-$(CONFIG_SENSORS_BH1780)	+= bh1780gli.o
 obj-$(CONFIG_SENSORS_BH1770)	+= bh1770glc.o
 obj-$(CONFIG_SENSORS_APDS990X)	+= apds990x.o
drivers/misc/qcom-coincell.c new file +152 -0

152 lines not on this page · raw message

Signature · 1 line
1.8.2.2
author
#3 lore raw

PATCH v3 3/3 ARM: dts: qcom: Add dts changes for qcom coincell charger

In reply to Tim Bird

Add framework for the coincell charger DT block in pm8941 file, and actual values for honami battery in the honami dts file.

---

Changes in v3:
- change charge-enable property to charger-disable
Changes in v2:
- change coincell node name to remove 'qcom,' prefix

 arch/arm/boot/dts/qcom-msm8974-sony-xperia-honami.dts | 10 ++++++++++
 arch/arm/boot/dts/qcom-pm8941.dtsi                    |  6 ++++++
 2 files changed, 16 insertions(+)
arch/arm/boot/dts/qcom-msm8974-sony-xperia-honami.dts +10 -0
index bd35b06..9bc72a3 100644
@@ -17,3 +17,13 @@
 		status = "ok";
 	};
 };
+
+&spmi_bus {
+	pm8941@0 {
+		coincell@2800 {
+			status = "ok";
+			qcom,rset-ohms = <2100>;
+			qcom,vset-millivolts = <3000>;
+		};
+	};
+};
arch/arm/boot/dts/qcom-pm8941.dtsi +6 -0
index aa774e6..968f104 100644
@@ -125,6 +125,12 @@
 			interrupts = <0x0 0x36 0x0 IRQ_TYPE_EDGE_RISING>;
 			qcom,external-resistor-micro-ohms = <10000>;
 		};
+
+		coincell@2800 {
+			compatible = "qcom,pm8941-coincell";
+			reg = <0x2800>;
+			status = "disabled";
+		};
 	};
 
 	usid1: pm8941@1 {
Signature · 1 line
1.8.2.2
Reviewed-by on v3 1/3
#5 lore raw
In reply to Tim Bird
Quoted 4 lines · Tim Bird

This binding is used to configure the driver for the coincell charger found in Qualcomm PMICs.

Quoted 69 lines

---

Changes in v3:
- change charge-enable property to charger-disable
Changes in v2:
- remove 'qcom,' from example node name
- Added reference to parent node pm8941@0 and binding doc for it

 .../bindings/power/qcom,coincell-charger.txt       | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/qcom,coincell-charger.txt
Documentation/devicetree/bindings/power/qcom,coincell-charger.txt new file +48 -1
new file mode 100644
index 0000000..0e6d875
@@ -0,0 +1,48 @@
+Qualcomm Coincell Charger:
+
+The hardware block controls charging for a coincell or capacitor that is
+used to provide power backup for certain features of the power management
+IC (PMIC)
+
+- compatible:
+       Usage: required
+       Value type: <string>
+       Definition: must be: "qcom,pm8941-coincell"
+
+- reg:
+       Usage: required
+       Value type: <u32>
+       Definition: base address of the coincell charger registers
+
+- qcom,rset-ohms:
+       Usage: required
+       Value type: <u32>
+       Definition: resistance (in ohms) for current-limiting resistor
+               must be one of: 800, 1200, 1700, 2100
+
+- qcom,vset-millivolts:
+       Usage: required
+       Value type: <u32>
+       Definition: voltage (in millivolts) to apply for charging
+               must be one of: 2500, 3000, 3100, 3200
+
+- qcom,charger-disable:
+       Usage: optional
+       Value type: <boolean>
+       Definition: definining this property disables charging
+
+This charger is a sub-node of one of the 8941 PMIC blocks, and is specified
+as a child node in DTS of that node.  See ../mfd/qcom,spmi-pmic.txt and
+../mfd/qcom-pm8xxx.txt
+
+Example:
+
+       pm8941@0 {
+               coincell@2800 {
+                       compatible = "qcom,pm8941-coincell";
+                       reg = <0x2800>;
+
+                       qcom,rset-ohms = <2100>;
+                       qcom,vset-millivolts = <3000>;
+               };
+       };
--

1.8.2.2

Reviewed-by on v3 3/3
#4 lore raw

Re: [PATCH v3 3/3] ARM: dts: qcom: Add dts changes for qcom coincell charger

In reply to Tim Bird
Quoted 5 lines · Tim Bird

Add framework for the coincell charger DT block in pm8941 file, and actual values for honami battery in the honami dts file.

---

Signature · 3 lines
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Reviewed-by on v3 2/3
#2 lore raw

Re: [PATCH v3 2/3] ARM: qcom: Add coincell charger driver

In reply to Tim Bird
Quoted 9 lines · Tim Bird

This driver is used to configure the coincell charger found in Qualcomm PMICs.

The driver allows configuring the current-limiting resistor for the charger, as well as the voltage to apply to the coincell (or capacitor) when charging.

---

Looks fine.

Signature · 3 lines
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
author
#6 lore raw
In reply to Rob Herring

Greg,

At this point I've got Reviewed-by from Rob on the binding and dts bits, and Reviewed-by from Andy Gross on the complete patch series (v3).

I believe I've addressed all issues raised. Can you please add this (v3) to drivers/misc?

Let me know if you want me to re-send anything.

Thanks very much.
-- Tim

Quoted 69 lines · Rob Herring
Quoted 4 lines · Tim Bird

This binding is used to configure the driver for the coincell charger found in Qualcomm PMICs.

Quoted 61 lines

---

Changes in v3:
- change charge-enable property to charger-disable
Changes in v2:
- remove 'qcom,' from example node name
- Added reference to parent node pm8941@0 and binding doc for it

 .../bindings/power/qcom,coincell-charger.txt       | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/qcom,coincell-charger.txt
Documentation/devicetree/bindings/power/qcom,coincell-charger.txt new file +43 -0
new file mode 100644
index 0000000..0e6d875
@@ -0,0 +1,48 @@
+Qualcomm Coincell Charger:
+
+The hardware block controls charging for a coincell or capacitor that is
+used to provide power backup for certain features of the power management
+IC (PMIC)
+
+- compatible:
+       Usage: required
+       Value type: <string>
+       Definition: must be: "qcom,pm8941-coincell"
+
+- reg:
+       Usage: required
+       Value type: <u32>
+       Definition: base address of the coincell charger registers
+
+- qcom,rset-ohms:
+       Usage: required
+       Value type: <u32>
+       Definition: resistance (in ohms) for current-limiting resistor
+               must be one of: 800, 1200, 1700, 2100
+
+- qcom,vset-millivolts:
+       Usage: required
+       Value type: <u32>
+       Definition: voltage (in millivolts) to apply for charging
+               must be one of: 2500, 3000, 3100, 3200
+
+- qcom,charger-disable:
+       Usage: optional
+       Value type: <boolean>
+       Definition: definining this property disables charging
+
+This charger is a sub-node of one of the 8941 PMIC blocks, and is specified
+as a child node in DTS of that node.  See ../mfd/qcom,spmi-pmic.txt and
+../mfd/qcom-pm8xxx.txt
+
+Example:
+
+       pm8941@0 {
+               coincell@2800 {
+                       compatible = "qcom,pm8941-coincell";
+                       reg = <0x2800>;
Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/power/qcom,coincell-charger.txt new file +5 -1
+
+                       qcom,rset-ohms = <2100>;
+                       qcom,vset-millivolts = <3000>;
+               };
+       };
--

1.8.2.2

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw
Quoted 9 lines · Tim Bird

Greg,

At this point I've got Reviewed-by from Rob on the binding and dts bits, and Reviewed-by from Andy Gross on the complete patch series (v3).

I believe I've addressed all issues raised. Can you please add this (v3) to drivers/misc?

Let me know if you want me to re-send anything.

Nope, I can take it from here, thanks.

greg k-h