* [PATCH v2 0/4] Add PM8937 PMIC support
@ 2023-11-21 5:34 Dang Huynh
2023-11-21 5:34 ` [PATCH v2 1/4] mfd: qcom-spmi-pmic: Add support for PM8937 Dang Huynh
` (5 more replies)
0 siblings, 6 replies; 8+ messages in thread
From: Dang Huynh @ 2023-11-21 5:34 UTC (permalink / raw)
To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Lee Jones,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Stephen Boyd
Cc: linux-arm-msm, linux-kernel, devicetree, Dang Huynh,
Caleb Connolly, Krzysztof Kozlowski, Dmitry Baryshkov
PM8937 is a power management IC. It is used in various boards with
MSM8917, MSM8937, MSM8940 and APQ variants.
This patchset has been tested on Xiaomi Redmi 4X (MSM8940).
Signed-off-by: Dang Huynh <danct12@riseup.net>
---
Changes in v2:
- Remove PATCH 3-6 as it has been picked up.
- Applied suggestions from reviewers.
- Add VDD, GND to VADC.
- Link to v1: https://lore.kernel.org/r/20231106-pm8937-v1-0-ec51d9eeec53@riseup.net
---
Dang Huynh (4):
mfd: qcom-spmi-pmic: Add support for PM8937
dt-bindings: mfd: qcom-spmi-pmic: Document PM8937 PMIC
arm64: dts: qcom: Add PM8937 PMIC
soc: qcom: socinfo: Add PM8937 Power IC
.../devicetree/bindings/mfd/qcom,spmi-pmic.yaml | 1 +
arch/arm64/boot/dts/qcom/pm8937.dtsi | 216 +++++++++++++++++++++
drivers/mfd/qcom-spmi-pmic.c | 1 +
drivers/soc/qcom/socinfo.c | 2 +-
include/soc/qcom/qcom-spmi-pmic.h | 1 +
5 files changed, 220 insertions(+), 1 deletion(-)
---
base-commit: 408a8e748eb5f10026ea9d87f8f218e759101c9a
change-id: 20231106-pm8937-000e423a75fb
Best regards,
--
Dang Huynh <danct12@riseup.net>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/4] mfd: qcom-spmi-pmic: Add support for PM8937
2023-11-21 5:34 [PATCH v2 0/4] Add PM8937 PMIC support Dang Huynh
@ 2023-11-21 5:34 ` Dang Huynh
2023-11-21 5:35 ` [PATCH v2 2/4] dt-bindings: mfd: qcom-spmi-pmic: Document PM8937 PMIC Dang Huynh
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Dang Huynh @ 2023-11-21 5:34 UTC (permalink / raw)
To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Lee Jones,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Stephen Boyd
Cc: linux-arm-msm, linux-kernel, devicetree, Dang Huynh,
Caleb Connolly
Add the subtype and compatible strings for PM8937.
The PM8937 is found in various SoCs, including MSM8917, MSM8937,
MSM8940 and APQ variants.
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Signed-off-by: Dang Huynh <danct12@riseup.net>
---
drivers/mfd/qcom-spmi-pmic.c | 1 +
include/soc/qcom/qcom-spmi-pmic.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/mfd/qcom-spmi-pmic.c b/drivers/mfd/qcom-spmi-pmic.c
index 4549fa9f7d4b..eab5bf6cff10 100644
--- a/drivers/mfd/qcom-spmi-pmic.c
+++ b/drivers/mfd/qcom-spmi-pmic.c
@@ -53,6 +53,7 @@ static const struct of_device_id pmic_spmi_id_table[] = {
{ .compatible = "qcom,pm8901", .data = N_USIDS(2) },
{ .compatible = "qcom,pm8909", .data = N_USIDS(2) },
{ .compatible = "qcom,pm8916", .data = N_USIDS(2) },
+ { .compatible = "qcom,pm8937", .data = N_USIDS(2) },
{ .compatible = "qcom,pm8941", .data = N_USIDS(2) },
{ .compatible = "qcom,pm8950", .data = N_USIDS(2) },
{ .compatible = "qcom,pm8994", .data = N_USIDS(2) },
diff --git a/include/soc/qcom/qcom-spmi-pmic.h b/include/soc/qcom/qcom-spmi-pmic.h
index c47cc71a999e..17a0a8c3d656 100644
--- a/include/soc/qcom/qcom-spmi-pmic.h
+++ b/include/soc/qcom/qcom-spmi-pmic.h
@@ -31,6 +31,7 @@
#define PM8998_SUBTYPE 0x14
#define PMI8998_SUBTYPE 0x15
#define PM8005_SUBTYPE 0x18
+#define PM8937_SUBTYPE 0x19
#define PM660L_SUBTYPE 0x1a
#define PM660_SUBTYPE 0x1b
#define PM8150_SUBTYPE 0x1e
--
2.42.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/4] dt-bindings: mfd: qcom-spmi-pmic: Document PM8937 PMIC
2023-11-21 5:34 [PATCH v2 0/4] Add PM8937 PMIC support Dang Huynh
2023-11-21 5:34 ` [PATCH v2 1/4] mfd: qcom-spmi-pmic: Add support for PM8937 Dang Huynh
@ 2023-11-21 5:35 ` Dang Huynh
2023-11-21 5:35 ` [PATCH v2 3/4] arm64: dts: qcom: Add " Dang Huynh
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Dang Huynh @ 2023-11-21 5:35 UTC (permalink / raw)
To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Lee Jones,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Stephen Boyd
Cc: linux-arm-msm, linux-kernel, devicetree, Dang Huynh,
Krzysztof Kozlowski
Add bindings for PM8937 PMIC (qcom,pm8937). This PMIC is found in
boards with MSM8917, MSM8937, MSM8940 and APQ variants.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Dang Huynh <danct12@riseup.net>
---
Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
index 9fa568603930..8f728920df9e 100644
--- a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
+++ b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
@@ -66,6 +66,7 @@ properties:
- qcom,pm8841
- qcom,pm8909
- qcom,pm8916
+ - qcom,pm8937
- qcom,pm8941
- qcom,pm8950
- qcom,pm8953
--
2.42.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/4] arm64: dts: qcom: Add PM8937 PMIC
2023-11-21 5:34 [PATCH v2 0/4] Add PM8937 PMIC support Dang Huynh
2023-11-21 5:34 ` [PATCH v2 1/4] mfd: qcom-spmi-pmic: Add support for PM8937 Dang Huynh
2023-11-21 5:35 ` [PATCH v2 2/4] dt-bindings: mfd: qcom-spmi-pmic: Document PM8937 PMIC Dang Huynh
@ 2023-11-21 5:35 ` Dang Huynh
2023-11-22 16:38 ` Konrad Dybcio
2023-11-21 5:35 ` [PATCH v2 4/4] soc: qcom: socinfo: Add PM8937 Power IC Dang Huynh
` (2 subsequent siblings)
5 siblings, 1 reply; 8+ messages in thread
From: Dang Huynh @ 2023-11-21 5:35 UTC (permalink / raw)
To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Lee Jones,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Stephen Boyd
Cc: linux-arm-msm, linux-kernel, devicetree, Dang Huynh,
Dmitry Baryshkov
The PM8937 features integrated peripherals like ADC, GPIO controller,
MPPs, PON keys and others.
Add the device tree so that any boards with this PMIC can use it.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Dang Huynh <danct12@riseup.net>
---
arch/arm64/boot/dts/qcom/pm8937.dtsi | 216 +++++++++++++++++++++++++++++++++++
1 file changed, 216 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/pm8937.dtsi b/arch/arm64/boot/dts/qcom/pm8937.dtsi
new file mode 100644
index 000000000000..34e2b4cd0d5f
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/pm8937.dtsi
@@ -0,0 +1,216 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2023, Dang Huynh <danct12@riseup.net>
+ */
+
+#include <dt-bindings/iio/qcom,spmi-vadc.h>
+#include <dt-bindings/input/linux-event-codes.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/pinctrl/qcom,pmic-mpp.h>
+#include <dt-bindings/spmi/spmi.h>
+
+/ {
+ thermal-zones {
+ pm8937-thermal {
+ polling-delay-passive = <0>;
+ polling-delay = <0>;
+ thermal-sensors = <&pm8937_temp>;
+
+ trips {
+ trip0 {
+ temperature = <105000>;
+ hysteresis = <0>;
+ type = "passive";
+ };
+
+ trip1 {
+ temperature = <125000>;
+ hysteresis = <0>;
+ type = "hot";
+ };
+
+ trip2 {
+ temperature = <145000>;
+ hysteresis = <0>;
+ type = "critical";
+ };
+ };
+ };
+ };
+};
+
+&spmi_bus {
+ pmic@0 {
+ compatible = "qcom,pm8937", "qcom,spmi-pmic";
+ reg = <0x0 SPMI_USID>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ pon@800 {
+ compatible = "qcom,pm8916-pon";
+ reg = <0x800>;
+ mode-bootloader = <0x2>;
+ mode-recovery = <0x1>;
+
+ pm8937_pwrkey: pwrkey {
+ compatible = "qcom,pm8941-pwrkey";
+ interrupts = <0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
+ debounce = <15625>;
+ bias-pull-up;
+ linux,code = <KEY_POWER>;
+ };
+
+ pm8937_resin: resin {
+ compatible = "qcom,pm8941-resin";
+ interrupts = <0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
+ debounce = <15625>;
+ bias-pull-up;
+ status = "disabled";
+ };
+ };
+
+ pm8937_gpios: gpio@c000 {
+ compatible = "qcom,pm8937-gpio", "qcom,spmi-gpio";
+ reg = <0xc000>;
+ gpio-controller;
+ gpio-ranges = <&pm8937_gpios 0 0 8>;
+ #gpio-cells = <2>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ };
+
+ pm8937_mpps: mpps@a000 {
+ compatible = "qcom,pm8937-mpp", "qcom,spmi-mpp";
+ reg = <0xa000>;
+ gpio-controller;
+ gpio-ranges = <&pm8937_mpps 0 0 4>;
+ #gpio-cells = <2>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ };
+
+ pm8937_temp: temp-alarm@2400 {
+ compatible = "qcom,spmi-temp-alarm";
+ reg = <0x2400>;
+ interrupts = <0 0x24 0 IRQ_TYPE_EDGE_RISING>;
+ io-channels = <&pm8937_vadc VADC_DIE_TEMP>;
+ io-channel-names = "thermal";
+ #thermal-sensor-cells = <0>;
+ };
+
+ pm8937_vadc: adc@3100 {
+ compatible = "qcom,spmi-vadc";
+ reg = <0x3100>;
+ interrupts = <0 0x31 0 IRQ_TYPE_EDGE_RISING>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ #io-channel-cells = <1>;
+
+ channel@5 {
+ reg = <VADC_VCOIN>;
+ qcom,pre-scaling = <1 1>;
+ label = "vcoin";
+ };
+
+ channel@7 {
+ reg = <VADC_VSYS>;
+ qcom,pre-scaling = <1 1>;
+ label = "vph_pwr";
+ };
+
+ channel@8 {
+ reg = <VADC_DIE_TEMP>;
+ qcom,pre-scaling = <1 1>;
+ label = "die_temp";
+ };
+
+ channel@9 {
+ reg = <VADC_REF_625MV>;
+ qcom,pre-scaling = <1 1>;
+ label = "ref_625mv";
+ };
+
+ channel@a {
+ reg = <VADC_REF_1250MV>;
+ qcom,pre-scaling = <1 1>;
+ label = "ref_1250mv";
+ };
+
+ channel@c {
+ reg = <VADC_SPARE1>;
+ qcom,pre-scaling = <1 1>;
+ label = "ref_buf_625mv";
+ };
+
+ channel@e {
+ reg = <VADC_GND_REF>;
+ qcom,pre-scaling = <1 1>;
+ label = "ref_gnd";
+ };
+
+ channel@f {
+ reg = <VADC_VDD_VADC>;
+ qcom,pre-scaling = <1 1>;
+ label = "ref_vdd";
+ };
+
+ channel@11 {
+ reg = <VADC_P_MUX2_1_1>;
+ qcom,pre-scaling = <1 1>;
+ qcom,ratiometric;
+ qcom,hw-settle-time = <200>;
+ label = "pa_therm1";
+ };
+
+ channel@13 {
+ reg = <VADC_P_MUX4_1_1>;
+ qcom,pre-scaling = <1 1>;
+ qcom,ratiometric;
+ qcom,hw-settle-time = <200>;
+ label = "case_therm";
+ };
+
+ channel@32 {
+ reg = <VADC_LR_MUX3_XO_THERM>;
+ qcom,pre-scaling = <1 1>;
+ qcom,ratiometric;
+ qcom,hw-settle-time = <200>;
+ label = "xo_therm";
+ };
+
+ channel@36 {
+ reg = <VADC_LR_MUX7_HW_ID>;
+ qcom,pre-scaling = <1 1>;
+ qcom,ratiometric;
+ qcom,hw-settle-time = <200>;
+ label = "pa_therm0";
+ };
+
+ channel@3c {
+ reg = <VADC_LR_MUX3_BUF_XO_THERM>;
+ qcom,pre-scaling = <1 1>;
+ qcom,ratiometric;
+ qcom,hw-settle-time = <200>;
+ label = "xo_therm_buf";
+ };
+ };
+
+ rtc@6000 {
+ compatible = "qcom,pm8941-rtc";
+ reg = <0x6000>, <0x6100>;
+ reg-names = "rtc", "alarm";
+ interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
+ };
+ };
+
+ pmic@1 {
+ compatible = "qcom,pm8937", "qcom,spmi-pmic";
+ reg = <0x1 SPMI_USID>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ pm8937_spmi_regulators: regulators {
+ compatible = "qcom,pm8937-regulators";
+ };
+ };
+};
--
2.42.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 4/4] soc: qcom: socinfo: Add PM8937 Power IC
2023-11-21 5:34 [PATCH v2 0/4] Add PM8937 PMIC support Dang Huynh
` (2 preceding siblings ...)
2023-11-21 5:35 ` [PATCH v2 3/4] arm64: dts: qcom: Add " Dang Huynh
@ 2023-11-21 5:35 ` Dang Huynh
2023-11-23 17:16 ` (subset) [PATCH v2 0/4] Add PM8937 PMIC support Lee Jones
2023-12-08 14:55 ` Bjorn Andersson
5 siblings, 0 replies; 8+ messages in thread
From: Dang Huynh @ 2023-11-21 5:35 UTC (permalink / raw)
To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Lee Jones,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Stephen Boyd
Cc: linux-arm-msm, linux-kernel, devicetree, Dang Huynh
The PM8917 and PM8937 uses the same SUBTYPE ID.
The PM8937 is found in boards with MSM8917, MSM8937 and MSM8940
and APQ variants.
Signed-off-by: Dang Huynh <danct12@riseup.net>
---
drivers/soc/qcom/socinfo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c
index 51e05bec5bfc..37692fc1aefb 100644
--- a/drivers/soc/qcom/socinfo.c
+++ b/drivers/soc/qcom/socinfo.c
@@ -93,7 +93,7 @@ static const char *const pmic_models[] = {
[22] = "PM8821",
[23] = "PM8038",
[24] = "PM8005/PM8922",
- [25] = "PM8917",
+ [25] = "PM8917/PM8937",
[26] = "PM660L",
[27] = "PM660",
[30] = "PM8150",
--
2.42.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 3/4] arm64: dts: qcom: Add PM8937 PMIC
2023-11-21 5:35 ` [PATCH v2 3/4] arm64: dts: qcom: Add " Dang Huynh
@ 2023-11-22 16:38 ` Konrad Dybcio
0 siblings, 0 replies; 8+ messages in thread
From: Konrad Dybcio @ 2023-11-22 16:38 UTC (permalink / raw)
To: Dang Huynh, Andy Gross, Bjorn Andersson, Lee Jones, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephen Boyd
Cc: linux-arm-msm, linux-kernel, devicetree, Dmitry Baryshkov
On 11/21/23 06:35, Dang Huynh wrote:
> The PM8937 features integrated peripherals like ADC, GPIO controller,
> MPPs, PON keys and others.
>
> Add the device tree so that any boards with this PMIC can use it.
>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Signed-off-by: Dang Huynh <danct12@riseup.net>
> ---
No users?
Konrad
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: (subset) [PATCH v2 0/4] Add PM8937 PMIC support
2023-11-21 5:34 [PATCH v2 0/4] Add PM8937 PMIC support Dang Huynh
` (3 preceding siblings ...)
2023-11-21 5:35 ` [PATCH v2 4/4] soc: qcom: socinfo: Add PM8937 Power IC Dang Huynh
@ 2023-11-23 17:16 ` Lee Jones
2023-12-08 14:55 ` Bjorn Andersson
5 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2023-11-23 17:16 UTC (permalink / raw)
To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Lee Jones,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Stephen Boyd,
Dang Huynh
Cc: linux-arm-msm, linux-kernel, devicetree, Caleb Connolly,
Krzysztof Kozlowski, Dmitry Baryshkov
On Tue, 21 Nov 2023 12:34:58 +0700, Dang Huynh wrote:
> PM8937 is a power management IC. It is used in various boards with
> MSM8917, MSM8937, MSM8940 and APQ variants.
>
> This patchset has been tested on Xiaomi Redmi 4X (MSM8940).
>
>
Applied, thanks!
[1/4] mfd: qcom-spmi-pmic: Add support for PM8937
commit: 587fcef6762cef9f44eb1aadc294d515262e6da3
[2/4] dt-bindings: mfd: qcom-spmi-pmic: Document PM8937 PMIC
commit: 2a7b788e2ee041ee8b96481952b3cf4bebed60f3
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: (subset) [PATCH v2 0/4] Add PM8937 PMIC support
2023-11-21 5:34 [PATCH v2 0/4] Add PM8937 PMIC support Dang Huynh
` (4 preceding siblings ...)
2023-11-23 17:16 ` (subset) [PATCH v2 0/4] Add PM8937 PMIC support Lee Jones
@ 2023-12-08 14:55 ` Bjorn Andersson
5 siblings, 0 replies; 8+ messages in thread
From: Bjorn Andersson @ 2023-12-08 14:55 UTC (permalink / raw)
To: Andy Gross, Konrad Dybcio, Lee Jones, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephen Boyd, Dang Huynh
Cc: linux-arm-msm, linux-kernel, devicetree, Caleb Connolly,
Krzysztof Kozlowski, Dmitry Baryshkov
On Tue, 21 Nov 2023 12:34:58 +0700, Dang Huynh wrote:
> PM8937 is a power management IC. It is used in various boards with
> MSM8917, MSM8937, MSM8940 and APQ variants.
>
> This patchset has been tested on Xiaomi Redmi 4X (MSM8940).
>
>
Applied, thanks!
[4/4] soc: qcom: socinfo: Add PM8937 Power IC
commit: d50b5cb1a8f7db8ad2dc6a13f0cabedf7a7e1540
Best regards,
--
Bjorn Andersson <andersson@kernel.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-12-08 14:51 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-21 5:34 [PATCH v2 0/4] Add PM8937 PMIC support Dang Huynh
2023-11-21 5:34 ` [PATCH v2 1/4] mfd: qcom-spmi-pmic: Add support for PM8937 Dang Huynh
2023-11-21 5:35 ` [PATCH v2 2/4] dt-bindings: mfd: qcom-spmi-pmic: Document PM8937 PMIC Dang Huynh
2023-11-21 5:35 ` [PATCH v2 3/4] arm64: dts: qcom: Add " Dang Huynh
2023-11-22 16:38 ` Konrad Dybcio
2023-11-21 5:35 ` [PATCH v2 4/4] soc: qcom: socinfo: Add PM8937 Power IC Dang Huynh
2023-11-23 17:16 ` (subset) [PATCH v2 0/4] Add PM8937 PMIC support Lee Jones
2023-12-08 14:55 ` Bjorn Andersson
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).