Linux-Doc Archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/8] Add PMI632 PMIC and RGB LED on sdm632-fairphone-fp3
@ 2023-04-18 16:43 Luca Weiss
  2023-04-18 16:43 ` [PATCH v2 1/8] dt-bindings: pinctrl: qcom,pmic-gpio: add PMI632 Luca Weiss
                   ` (9 more replies)
  0 siblings, 10 replies; 20+ messages in thread
From: Luca Weiss @ 2023-04-18 16:43 UTC (permalink / raw
  To: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Linus Walleij, Rob Herring,
	Krzysztof Kozlowski, Pavel Machek, Lee Jones, Jonathan Cameron,
	Lars-Peter Clausen, Stephen Boyd, Jonathan Corbet
  Cc: linux-arm-msm, linux-gpio, devicetree, linux-kernel, linux-leds,
	linux-iio, linux-doc, Luca Weiss, Krzysztof Kozlowski

Add support for the PMI632 PMIC in the spmi-gpio & qcom-lpg driver, add
the dtsi for the PMIC and enable the notification LED on fairphone-fp3.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
Changes in v2:
- Add qcom,pmi632-gpio to all the needed places in yaml
- Add patch documenting led path
- Pick up tags
- Drop vadc pre-scaling patch since it was applied
- Link to v1: https://lore.kernel.org/r/20230414-pmi632-v1-0-fe94dc414832@z3ntu.xyz

---
Luca Weiss (8):
      dt-bindings: pinctrl: qcom,pmic-gpio: add PMI632
      pinctrl: qcom: spmi-gpio: Add PMI632 support
      dt-bindings: leds: qcom-lpg: Add compatible for PMI632 LPG block
      leds: qcom-lpg: Add support for PMI632 LPG
      dt-bindings: mfd: qcom-spmi-pmic: Add PMI632 compatible
      arm64: dts: qcom: Add PMI632 PMIC
      arm64: dts: qcom: sdm632-fairphone-fp3: Add notification LED
      Documentation: leds: Add "rgb:status" path

 .../devicetree/bindings/leds/leds-qcom-lpg.yaml    |   1 +
 .../devicetree/bindings/mfd/qcom,spmi-pmic.yaml    |   1 +
 .../bindings/pinctrl/qcom,pmic-gpio.yaml           |   3 +
 Documentation/leds/well-known-leds.txt             |   1 +
 arch/arm64/boot/dts/qcom/pmi632.dtsi               | 165 +++++++++++++++++++++
 arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts  |  29 ++++
 drivers/leds/rgb/leds-qcom-lpg.c                   |  15 ++
 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c           |   1 +
 8 files changed, 216 insertions(+)
---
base-commit: 3f49aa65798675341eb9d4f947c40558564b2e6d
change-id: 20230414-pmi632-4ae03225ae75

Best regards,
-- 
Luca Weiss <luca@z3ntu.xyz>


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

* [PATCH v2 1/8] dt-bindings: pinctrl: qcom,pmic-gpio: add PMI632
  2023-04-18 16:43 [PATCH v2 0/8] Add PMI632 PMIC and RGB LED on sdm632-fairphone-fp3 Luca Weiss
@ 2023-04-18 16:43 ` Luca Weiss
  2023-04-19 18:06   ` Krzysztof Kozlowski
  2023-04-18 16:43 ` [PATCH v2 2/8] pinctrl: qcom: spmi-gpio: Add PMI632 support Luca Weiss
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Luca Weiss @ 2023-04-18 16:43 UTC (permalink / raw
  To: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Linus Walleij, Rob Herring,
	Krzysztof Kozlowski, Pavel Machek, Lee Jones, Jonathan Cameron,
	Lars-Peter Clausen, Stephen Boyd, Jonathan Corbet
  Cc: linux-arm-msm, linux-gpio, devicetree, linux-kernel, linux-leds,
	linux-iio, linux-doc, Luca Weiss

Document the 8 GPIOs found on PMI632.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
index 36c6435cfd0a..eaadd5a9a445 100644
--- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
@@ -52,6 +52,7 @@ properties:
           - qcom,pm8994-gpio
           - qcom,pm8998-gpio
           - qcom,pma8084-gpio
+          - qcom,pmi632-gpio
           - qcom,pmi8950-gpio
           - qcom,pmi8994-gpio
           - qcom,pmi8998-gpio
@@ -174,6 +175,7 @@ allOf:
               - qcom,pm8350b-gpio
               - qcom,pm8550ve-gpio
               - qcom,pm8950-gpio
+              - qcom,pmi632-gpio
     then:
       properties:
         gpio-line-names:
@@ -435,6 +437,7 @@ $defs:
                  - gpio1-gpio22 for pm8994
                  - gpio1-gpio26 for pm8998
                  - gpio1-gpio22 for pma8084
+                 - gpio1-gpio8 for pmi632
                  - gpio1-gpio2 for pmi8950
                  - gpio1-gpio10 for pmi8994
                  - gpio1-gpio4 for pmk8350

-- 
2.40.0


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

* [PATCH v2 2/8] pinctrl: qcom: spmi-gpio: Add PMI632 support
  2023-04-18 16:43 [PATCH v2 0/8] Add PMI632 PMIC and RGB LED on sdm632-fairphone-fp3 Luca Weiss
  2023-04-18 16:43 ` [PATCH v2 1/8] dt-bindings: pinctrl: qcom,pmic-gpio: add PMI632 Luca Weiss
@ 2023-04-18 16:43 ` Luca Weiss
  2023-04-20 10:12   ` Dmitry Baryshkov
  2023-04-18 16:43 ` [PATCH v2 3/8] dt-bindings: leds: qcom-lpg: Add compatible for PMI632 LPG block Luca Weiss
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Luca Weiss @ 2023-04-18 16:43 UTC (permalink / raw
  To: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Linus Walleij, Rob Herring,
	Krzysztof Kozlowski, Pavel Machek, Lee Jones, Jonathan Cameron,
	Lars-Peter Clausen, Stephen Boyd, Jonathan Corbet
  Cc: linux-arm-msm, linux-gpio, devicetree, linux-kernel, linux-leds,
	linux-iio, linux-doc, Luca Weiss

Add support for the 8 GPIOs found on PMI632.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
index 0d94175b34f8..43c7857c06a5 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
@@ -1232,6 +1232,7 @@ static const struct of_device_id pmic_gpio_of_match[] = {
 	{ .compatible = "qcom,pm8994-gpio", .data = (void *) 22 },
 	{ .compatible = "qcom,pm8998-gpio", .data = (void *) 26 },
 	{ .compatible = "qcom,pma8084-gpio", .data = (void *) 22 },
+	{ .compatible = "qcom,pmi632-gpio", .data = (void *) 8 },
 	{ .compatible = "qcom,pmi8950-gpio", .data = (void *) 2 },
 	{ .compatible = "qcom,pmi8994-gpio", .data = (void *) 10 },
 	{ .compatible = "qcom,pmi8998-gpio", .data = (void *) 14 },

-- 
2.40.0


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

* [PATCH v2 3/8] dt-bindings: leds: qcom-lpg: Add compatible for PMI632 LPG block
  2023-04-18 16:43 [PATCH v2 0/8] Add PMI632 PMIC and RGB LED on sdm632-fairphone-fp3 Luca Weiss
  2023-04-18 16:43 ` [PATCH v2 1/8] dt-bindings: pinctrl: qcom,pmic-gpio: add PMI632 Luca Weiss
  2023-04-18 16:43 ` [PATCH v2 2/8] pinctrl: qcom: spmi-gpio: Add PMI632 support Luca Weiss
@ 2023-04-18 16:43 ` Luca Weiss
  2023-04-27 15:27   ` Lee Jones
  2023-04-18 16:43 ` [PATCH v2 4/8] leds: qcom-lpg: Add support for PMI632 LPG Luca Weiss
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Luca Weiss @ 2023-04-18 16:43 UTC (permalink / raw
  To: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Linus Walleij, Rob Herring,
	Krzysztof Kozlowski, Pavel Machek, Lee Jones, Jonathan Cameron,
	Lars-Peter Clausen, Stephen Boyd, Jonathan Corbet
  Cc: linux-arm-msm, linux-gpio, devicetree, linux-kernel, linux-leds,
	linux-iio, linux-doc, Luca Weiss, Krzysztof Kozlowski

Document the availability of an LPG configuration for the PMI632 PMIC in
the Qualcomm Light Pulse Generator driver.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml
index 1df837798249..2e4426894bed 100644
--- a/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml
+++ b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml
@@ -25,6 +25,7 @@ properties:
       - qcom,pm8941-lpg
       - qcom,pm8994-lpg
       - qcom,pmc8180c-lpg
+      - qcom,pmi632-lpg
       - qcom,pmi8994-lpg
       - qcom,pmi8998-lpg
 

-- 
2.40.0


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

* [PATCH v2 4/8] leds: qcom-lpg: Add support for PMI632 LPG
  2023-04-18 16:43 [PATCH v2 0/8] Add PMI632 PMIC and RGB LED on sdm632-fairphone-fp3 Luca Weiss
                   ` (2 preceding siblings ...)
  2023-04-18 16:43 ` [PATCH v2 3/8] dt-bindings: leds: qcom-lpg: Add compatible for PMI632 LPG block Luca Weiss
@ 2023-04-18 16:43 ` Luca Weiss
  2023-04-27 15:27   ` Lee Jones
  2023-04-18 16:43 ` [PATCH v2 5/8] dt-bindings: mfd: qcom-spmi-pmic: Add PMI632 compatible Luca Weiss
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Luca Weiss @ 2023-04-18 16:43 UTC (permalink / raw
  To: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Linus Walleij, Rob Herring,
	Krzysztof Kozlowski, Pavel Machek, Lee Jones, Jonathan Cameron,
	Lars-Peter Clausen, Stephen Boyd, Jonathan Corbet
  Cc: linux-arm-msm, linux-gpio, devicetree, linux-kernel, linux-leds,
	linux-iio, linux-doc, Luca Weiss

The PMI632 PMIC contains 5 PWM channels, 3 of which can be used for
LEDs.

For the LED pattern it doesn't have LUT like other PMICs but uses SDAM
instead. This is not currently implemented in the driver but since LPG
works fine without it, add support for the PMIC now.

Acked-by: Pavel Machek <pavel@ucw.cz>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 drivers/leds/rgb/leds-qcom-lpg.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c
index 67f48f222109..51763ecb8c1e 100644
--- a/drivers/leds/rgb/leds-qcom-lpg.c
+++ b/drivers/leds/rgb/leds-qcom-lpg.c
@@ -1353,6 +1353,20 @@ static const struct lpg_data pm8994_lpg_data = {
 	},
 };
 
+/* PMI632 uses SDAM instead of LUT for pattern */
+static const struct lpg_data pmi632_lpg_data = {
+	.triled_base = 0xd000,
+
+	.num_channels = 5,
+	.channels = (const struct lpg_channel_data[]) {
+		{ .base = 0xb300, .triled_mask = BIT(7) },
+		{ .base = 0xb400, .triled_mask = BIT(6) },
+		{ .base = 0xb500, .triled_mask = BIT(5) },
+		{ .base = 0xb600 },
+		{ .base = 0xb700 },
+	},
+};
+
 static const struct lpg_data pmi8994_lpg_data = {
 	.lut_base = 0xb000,
 	.lut_size = 24,
@@ -1436,6 +1450,7 @@ static const struct of_device_id lpg_of_table[] = {
 	{ .compatible = "qcom,pm8916-pwm", .data = &pm8916_pwm_data },
 	{ .compatible = "qcom,pm8941-lpg", .data = &pm8941_lpg_data },
 	{ .compatible = "qcom,pm8994-lpg", .data = &pm8994_lpg_data },
+	{ .compatible = "qcom,pmi632-lpg", .data = &pmi632_lpg_data },
 	{ .compatible = "qcom,pmi8994-lpg", .data = &pmi8994_lpg_data },
 	{ .compatible = "qcom,pmi8998-lpg", .data = &pmi8998_lpg_data },
 	{ .compatible = "qcom,pmc8180c-lpg", .data = &pm8150l_lpg_data },

-- 
2.40.0


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

* [PATCH v2 5/8] dt-bindings: mfd: qcom-spmi-pmic: Add PMI632 compatible
  2023-04-18 16:43 [PATCH v2 0/8] Add PMI632 PMIC and RGB LED on sdm632-fairphone-fp3 Luca Weiss
                   ` (3 preceding siblings ...)
  2023-04-18 16:43 ` [PATCH v2 4/8] leds: qcom-lpg: Add support for PMI632 LPG Luca Weiss
@ 2023-04-18 16:43 ` Luca Weiss
  2023-04-27 15:28   ` Lee Jones
  2023-04-18 16:43 ` [PATCH v2 6/8] arm64: dts: qcom: Add PMI632 PMIC Luca Weiss
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Luca Weiss @ 2023-04-18 16:43 UTC (permalink / raw
  To: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Linus Walleij, Rob Herring,
	Krzysztof Kozlowski, Pavel Machek, Lee Jones, Jonathan Cameron,
	Lars-Peter Clausen, Stephen Boyd, Jonathan Corbet
  Cc: linux-arm-msm, linux-gpio, devicetree, linux-kernel, linux-leds,
	linux-iio, linux-doc, Luca Weiss, Krzysztof Kozlowski

Document support for the pmi632, often found with the sdm632 SoC.

Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 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 84620ebc1efe..09e7195c622b 100644
--- a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
+++ b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
@@ -71,6 +71,7 @@ properties:
           - qcom,pm8998
           - qcom,pma8084
           - qcom,pmd9635
+          - qcom,pmi632
           - qcom,pmi8950
           - qcom,pmi8962
           - qcom,pmi8994

-- 
2.40.0


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

* [PATCH v2 6/8] arm64: dts: qcom: Add PMI632 PMIC
  2023-04-18 16:43 [PATCH v2 0/8] Add PMI632 PMIC and RGB LED on sdm632-fairphone-fp3 Luca Weiss
                   ` (4 preceding siblings ...)
  2023-04-18 16:43 ` [PATCH v2 5/8] dt-bindings: mfd: qcom-spmi-pmic: Add PMI632 compatible Luca Weiss
@ 2023-04-18 16:43 ` Luca Weiss
  2023-04-19 10:27   ` Konrad Dybcio
  2023-04-18 16:43 ` [PATCH v2 7/8] arm64: dts: qcom: sdm632-fairphone-fp3: Add notification LED Luca Weiss
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Luca Weiss @ 2023-04-18 16:43 UTC (permalink / raw
  To: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Linus Walleij, Rob Herring,
	Krzysztof Kozlowski, Pavel Machek, Lee Jones, Jonathan Cameron,
	Lars-Peter Clausen, Stephen Boyd, Jonathan Corbet
  Cc: linux-arm-msm, linux-gpio, devicetree, linux-kernel, linux-leds,
	linux-iio, linux-doc, Luca Weiss

The PMI632, commonly found on SoCs with SDM632 has various standard
functions like ADC, GPIOs, LPG and more.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 arch/arm64/boot/dts/qcom/pmi632.dtsi | 165 +++++++++++++++++++++++++++++++++++
 1 file changed, 165 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/pmi632.dtsi b/arch/arm64/boot/dts/qcom/pmi632.dtsi
new file mode 100644
index 000000000000..4eb79e0ce40a
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/pmi632.dtsi
@@ -0,0 +1,165 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (C) 2023 Luca Weiss <luca@z3ntu.xyz>
+ */
+
+#include <dt-bindings/iio/qcom,spmi-vadc.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/spmi/spmi.h>
+
+/ {
+	thermal-zones {
+		pmi632-thermal {
+			polling-delay-passive = <100>;
+			polling-delay = <0>;
+
+			thermal-sensors = <&pmi632_temp>;
+
+			trips {
+				trip0 {
+					temperature = <95000>;
+					hysteresis = <0>;
+					type = "passive";
+				};
+
+				trip1 {
+					temperature = <115000>;
+					hysteresis = <0>;
+					type = "hot";
+				};
+
+				trip2 {
+					temperature = <125000>;
+					hysteresis = <0>;
+					type = "critical";
+				};
+			};
+		};
+	};
+};
+
+&spmi_bus {
+	pmic@2 {
+		compatible = "qcom,pmi632", "qcom,spmi-pmic";
+		reg = <0x2 SPMI_USID>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		pmi632_temp: temp-alarm@2400 {
+			compatible = "qcom,spmi-temp-alarm";
+			reg = <0x2400>;
+			interrupts = <0x2 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
+			#thermal-sensor-cells = <0>;
+		};
+
+		pmi632_adc: adc@3100 {
+			compatible = "qcom,spmi-adc5";
+			reg = <0x3100>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			#io-channel-cells = <1>;
+			interrupts = <0x2 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
+
+			channel@0 {
+				reg = <ADC5_REF_GND>;
+				qcom,pre-scaling = <1 1>;
+				label = "ref_gnd";
+			};
+
+			channel@1 {
+				reg = <ADC5_1P25VREF>;
+				qcom,pre-scaling = <1 1>;
+				label = "vref_1p25";
+			};
+
+			channel@6 {
+				reg = <ADC5_DIE_TEMP>;
+				qcom,pre-scaling = <1 1>;
+				label = "die_temp";
+			};
+
+			channel@7 {
+				reg = <ADC5_USB_IN_I>;
+				qcom,pre-scaling = <1 1>;
+				label = "usb_in_i_uv";
+			};
+
+			channel@8 {
+				reg = <ADC5_USB_IN_V_16>;
+				qcom,pre-scaling = <1 16>;
+				label = "usb_in_v_div_16";
+			};
+
+			channel@9 {
+				reg = <ADC5_CHG_TEMP>;
+				qcom,pre-scaling = <1 1>;
+				label = "chg_temp";
+			};
+
+			channel@4b {
+				reg = <ADC5_BAT_ID_100K_PU>;
+				qcom,hw-settle-time = <200>;
+				qcom,pre-scaling = <1 1>;
+				qcom,ratiometric;
+				label = "bat_id";
+			};
+
+			channel@83 {
+				reg = <ADC5_VPH_PWR>;
+				qcom,pre-scaling = <1 3>;
+				label = "vph_pwr";
+			};
+
+			channel@84 {
+				reg = <ADC5_VBAT_SNS>;
+				qcom,pre-scaling = <1 3>;
+				label = "vbat_sns";
+			};
+		};
+
+		pmi632_adc_tm: adc-tm@3500 {
+			compatible = "qcom,spmi-adc-tm5";
+			reg = <0x3500>;
+			interrupts = <0x2 0x35 0x0 IRQ_TYPE_EDGE_RISING>;
+			#thermal-sensor-cells = <1>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		pmi632_sdam_7: nvram@b600 {
+			compatible = "qcom,spmi-sdam";
+			reg = <0xb600>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0 0xb600 0x100>;
+		};
+
+		pmi632_gpios: gpio@c000 {
+			compatible = "qcom,pmi632-gpio", "qcom,spmi-gpio";
+			reg = <0xc000>;
+			gpio-controller;
+			gpio-ranges = <&pmi632_gpios 0 0 8>;
+			#gpio-cells = <2>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+		};
+	};
+
+	pmic@3 {
+		compatible = "qcom,pmi632", "qcom,spmi-pmic";
+		reg = <0x3 SPMI_USID>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		pmi632_lpg: pwm {
+			compatible = "qcom,pmi632-lpg";
+
+			#address-cells = <1>;
+			#size-cells = <0>;
+			#pwm-cells = <2>;
+
+			status = "disabled";
+		};
+	};
+};

-- 
2.40.0


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

* [PATCH v2 7/8] arm64: dts: qcom: sdm632-fairphone-fp3: Add notification LED
  2023-04-18 16:43 [PATCH v2 0/8] Add PMI632 PMIC and RGB LED on sdm632-fairphone-fp3 Luca Weiss
                   ` (5 preceding siblings ...)
  2023-04-18 16:43 ` [PATCH v2 6/8] arm64: dts: qcom: Add PMI632 PMIC Luca Weiss
@ 2023-04-18 16:43 ` Luca Weiss
  2023-04-19 10:28   ` Konrad Dybcio
  2023-04-18 16:43 ` [PATCH v2 8/8] Documentation: leds: Add "rgb:status" path Luca Weiss
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Luca Weiss @ 2023-04-18 16:43 UTC (permalink / raw
  To: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Linus Walleij, Rob Herring,
	Krzysztof Kozlowski, Pavel Machek, Lee Jones, Jonathan Cameron,
	Lars-Peter Clausen, Stephen Boyd, Jonathan Corbet
  Cc: linux-arm-msm, linux-gpio, devicetree, linux-kernel, linux-leds,
	linux-iio, linux-doc, Luca Weiss

The phone features a notification LED connected to the pmi632. Configure
the RGB led found on it.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts | 29 +++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts b/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
index 70e683b7e4fc..301eca9a4f31 100644
--- a/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
+++ b/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
@@ -4,8 +4,10 @@
  */
 /dts-v1/;
 
+#include <dt-bindings/leds/common.h>
 #include "sdm632.dtsi"
 #include "pm8953.dtsi"
+#include "pmi632.dtsi"
 
 / {
 	model = "Fairphone 3";
@@ -83,6 +85,33 @@ &pm8953_resin {
 	linux,code = <KEY_VOLUMEDOWN>;
 };
 
+&pmi632_lpg {
+	status = "okay";
+
+	multi-led {
+		color = <LED_COLOR_ID_RGB>;
+		function = LED_FUNCTION_STATUS;
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		led@1 {
+			reg = <1>;
+			color = <LED_COLOR_ID_RED>;
+		};
+
+		led@2 {
+			reg = <2>;
+			color = <LED_COLOR_ID_GREEN>;
+		};
+
+		led@3 {
+			reg = <3>;
+			color = <LED_COLOR_ID_BLUE>;
+		};
+	};
+};
+
 &sdhc_1 {
 	status = "okay";
 	vmmc-supply = <&pm8953_l8>;

-- 
2.40.0


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

* [PATCH v2 8/8] Documentation: leds: Add "rgb:status" path
  2023-04-18 16:43 [PATCH v2 0/8] Add PMI632 PMIC and RGB LED on sdm632-fairphone-fp3 Luca Weiss
                   ` (6 preceding siblings ...)
  2023-04-18 16:43 ` [PATCH v2 7/8] arm64: dts: qcom: sdm632-fairphone-fp3: Add notification LED Luca Weiss
@ 2023-04-18 16:43 ` Luca Weiss
  2023-04-27 16:05   ` Lee Jones
  2023-04-21  8:29 ` [PATCH v2 0/8] Add PMI632 PMIC and RGB LED on sdm632-fairphone-fp3 Linus Walleij
  2023-05-15 12:17 ` Lee Jones
  9 siblings, 1 reply; 20+ messages in thread
From: Luca Weiss @ 2023-04-18 16:43 UTC (permalink / raw
  To: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Linus Walleij, Rob Herring,
	Krzysztof Kozlowski, Pavel Machek, Lee Jones, Jonathan Cameron,
	Lars-Peter Clausen, Stephen Boyd, Jonathan Corbet
  Cc: linux-arm-msm, linux-gpio, devicetree, linux-kernel, linux-leds,
	linux-iio, linux-doc, Luca Weiss

The path /sys/class/leds/rgb:status is already widely used with the
qcom-lpg driver and others. Document it.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 Documentation/leds/well-known-leds.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/leds/well-known-leds.txt b/Documentation/leds/well-known-leds.txt
index 2160382c86be..439d4dac4472 100644
--- a/Documentation/leds/well-known-leds.txt
+++ b/Documentation/leds/well-known-leds.txt
@@ -58,6 +58,7 @@ LEDs on notebook body, indicating that sound input / output is muted.
 
 * System notification
 
+Good: "rgb:status"
 Legacy: "status-led:{red,green,blue}" (Motorola Droid 4)
 Legacy: "lp5523:{r,g,b}" (Nokia N900)
 

-- 
2.40.0


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

* Re: [PATCH v2 6/8] arm64: dts: qcom: Add PMI632 PMIC
  2023-04-18 16:43 ` [PATCH v2 6/8] arm64: dts: qcom: Add PMI632 PMIC Luca Weiss
@ 2023-04-19 10:27   ` Konrad Dybcio
  0 siblings, 0 replies; 20+ messages in thread
From: Konrad Dybcio @ 2023-04-19 10:27 UTC (permalink / raw
  To: Luca Weiss, ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Linus Walleij, Rob Herring, Krzysztof Kozlowski,
	Pavel Machek, Lee Jones, Jonathan Cameron, Lars-Peter Clausen,
	Stephen Boyd, Jonathan Corbet
  Cc: linux-arm-msm, linux-gpio, devicetree, linux-kernel, linux-leds,
	linux-iio, linux-doc



On 18.04.2023 18:43, Luca Weiss wrote:
> The PMI632, commonly found on SoCs with SDM632 has various standard
> functions like ADC, GPIOs, LPG and more.
> 
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
Looks good!

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  arch/arm64/boot/dts/qcom/pmi632.dtsi | 165 +++++++++++++++++++++++++++++++++++
>  1 file changed, 165 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/pmi632.dtsi b/arch/arm64/boot/dts/qcom/pmi632.dtsi
> new file mode 100644
> index 000000000000..4eb79e0ce40a
> --- /dev/null
> +++ b/arch/arm64/boot/dts/qcom/pmi632.dtsi
> @@ -0,0 +1,165 @@
> +// SPDX-License-Identifier: BSD-3-Clause
> +/*
> + * Copyright (C) 2023 Luca Weiss <luca@z3ntu.xyz>
> + */
> +
> +#include <dt-bindings/iio/qcom,spmi-vadc.h>
> +#include <dt-bindings/interrupt-controller/irq.h>
> +#include <dt-bindings/spmi/spmi.h>
> +
> +/ {
> +	thermal-zones {
> +		pmi632-thermal {
> +			polling-delay-passive = <100>;
> +			polling-delay = <0>;
> +
> +			thermal-sensors = <&pmi632_temp>;
> +
> +			trips {
> +				trip0 {
> +					temperature = <95000>;
> +					hysteresis = <0>;
> +					type = "passive";
> +				};
> +
> +				trip1 {
> +					temperature = <115000>;
> +					hysteresis = <0>;
> +					type = "hot";
> +				};
> +
> +				trip2 {
> +					temperature = <125000>;
> +					hysteresis = <0>;
> +					type = "critical";
> +				};
> +			};
> +		};
> +	};
> +};
> +
> +&spmi_bus {
> +	pmic@2 {
> +		compatible = "qcom,pmi632", "qcom,spmi-pmic";
> +		reg = <0x2 SPMI_USID>;
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		pmi632_temp: temp-alarm@2400 {
> +			compatible = "qcom,spmi-temp-alarm";
> +			reg = <0x2400>;
> +			interrupts = <0x2 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
> +			#thermal-sensor-cells = <0>;
> +		};
> +
> +		pmi632_adc: adc@3100 {
> +			compatible = "qcom,spmi-adc5";
> +			reg = <0x3100>;
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +			#io-channel-cells = <1>;
> +			interrupts = <0x2 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
> +
> +			channel@0 {
> +				reg = <ADC5_REF_GND>;
> +				qcom,pre-scaling = <1 1>;
> +				label = "ref_gnd";
> +			};
> +
> +			channel@1 {
> +				reg = <ADC5_1P25VREF>;
> +				qcom,pre-scaling = <1 1>;
> +				label = "vref_1p25";
> +			};
> +
> +			channel@6 {
> +				reg = <ADC5_DIE_TEMP>;
> +				qcom,pre-scaling = <1 1>;
> +				label = "die_temp";
> +			};
> +
> +			channel@7 {
> +				reg = <ADC5_USB_IN_I>;
> +				qcom,pre-scaling = <1 1>;
> +				label = "usb_in_i_uv";
> +			};
> +
> +			channel@8 {
> +				reg = <ADC5_USB_IN_V_16>;
> +				qcom,pre-scaling = <1 16>;
> +				label = "usb_in_v_div_16";
> +			};
> +
> +			channel@9 {
> +				reg = <ADC5_CHG_TEMP>;
> +				qcom,pre-scaling = <1 1>;
> +				label = "chg_temp";
> +			};
> +
> +			channel@4b {
> +				reg = <ADC5_BAT_ID_100K_PU>;
> +				qcom,hw-settle-time = <200>;
> +				qcom,pre-scaling = <1 1>;
> +				qcom,ratiometric;
> +				label = "bat_id";
> +			};
> +
> +			channel@83 {
> +				reg = <ADC5_VPH_PWR>;
> +				qcom,pre-scaling = <1 3>;
> +				label = "vph_pwr";
> +			};
> +
> +			channel@84 {
> +				reg = <ADC5_VBAT_SNS>;
> +				qcom,pre-scaling = <1 3>;
> +				label = "vbat_sns";
> +			};
> +		};
> +
> +		pmi632_adc_tm: adc-tm@3500 {
> +			compatible = "qcom,spmi-adc-tm5";
> +			reg = <0x3500>;
> +			interrupts = <0x2 0x35 0x0 IRQ_TYPE_EDGE_RISING>;
> +			#thermal-sensor-cells = <1>;
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +			status = "disabled";
> +		};
> +
> +		pmi632_sdam_7: nvram@b600 {
> +			compatible = "qcom,spmi-sdam";
> +			reg = <0xb600>;
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			ranges = <0 0xb600 0x100>;
> +		};
> +
> +		pmi632_gpios: gpio@c000 {
> +			compatible = "qcom,pmi632-gpio", "qcom,spmi-gpio";
> +			reg = <0xc000>;
> +			gpio-controller;
> +			gpio-ranges = <&pmi632_gpios 0 0 8>;
> +			#gpio-cells = <2>;
> +			interrupt-controller;
> +			#interrupt-cells = <2>;
> +		};
> +	};
> +
> +	pmic@3 {
> +		compatible = "qcom,pmi632", "qcom,spmi-pmic";
> +		reg = <0x3 SPMI_USID>;
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		pmi632_lpg: pwm {
> +			compatible = "qcom,pmi632-lpg";
> +
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +			#pwm-cells = <2>;
> +
> +			status = "disabled";
> +		};
> +	};
> +};
> 

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

* Re: [PATCH v2 7/8] arm64: dts: qcom: sdm632-fairphone-fp3: Add notification LED
  2023-04-18 16:43 ` [PATCH v2 7/8] arm64: dts: qcom: sdm632-fairphone-fp3: Add notification LED Luca Weiss
@ 2023-04-19 10:28   ` Konrad Dybcio
  0 siblings, 0 replies; 20+ messages in thread
From: Konrad Dybcio @ 2023-04-19 10:28 UTC (permalink / raw
  To: Luca Weiss, ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Linus Walleij, Rob Herring, Krzysztof Kozlowski,
	Pavel Machek, Lee Jones, Jonathan Cameron, Lars-Peter Clausen,
	Stephen Boyd, Jonathan Corbet
  Cc: linux-arm-msm, linux-gpio, devicetree, linux-kernel, linux-leds,
	linux-iio, linux-doc



On 18.04.2023 18:43, Luca Weiss wrote:
> The phone features a notification LED connected to the pmi632. Configure
> the RGB led found on it.
> 
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts | 29 +++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts b/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
> index 70e683b7e4fc..301eca9a4f31 100644
> --- a/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
> @@ -4,8 +4,10 @@
>   */
>  /dts-v1/;
>  
> +#include <dt-bindings/leds/common.h>
>  #include "sdm632.dtsi"
>  #include "pm8953.dtsi"
> +#include "pmi632.dtsi"
>  
>  / {
>  	model = "Fairphone 3";
> @@ -83,6 +85,33 @@ &pm8953_resin {
>  	linux,code = <KEY_VOLUMEDOWN>;
>  };
>  
> +&pmi632_lpg {
> +	status = "okay";
> +
> +	multi-led {
> +		color = <LED_COLOR_ID_RGB>;
> +		function = LED_FUNCTION_STATUS;
> +
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		led@1 {
> +			reg = <1>;
> +			color = <LED_COLOR_ID_RED>;
> +		};
> +
> +		led@2 {
> +			reg = <2>;
> +			color = <LED_COLOR_ID_GREEN>;
> +		};
> +
> +		led@3 {
> +			reg = <3>;
> +			color = <LED_COLOR_ID_BLUE>;
> +		};
> +	};
> +};
> +
>  &sdhc_1 {
>  	status = "okay";
>  	vmmc-supply = <&pm8953_l8>;
> 

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

* Re: [PATCH v2 1/8] dt-bindings: pinctrl: qcom,pmic-gpio: add PMI632
  2023-04-18 16:43 ` [PATCH v2 1/8] dt-bindings: pinctrl: qcom,pmic-gpio: add PMI632 Luca Weiss
@ 2023-04-19 18:06   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 20+ messages in thread
From: Krzysztof Kozlowski @ 2023-04-19 18:06 UTC (permalink / raw
  To: Luca Weiss, ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Linus Walleij, Rob Herring,
	Krzysztof Kozlowski, Pavel Machek, Lee Jones, Jonathan Cameron,
	Lars-Peter Clausen, Stephen Boyd, Jonathan Corbet
  Cc: linux-arm-msm, linux-gpio, devicetree, linux-kernel, linux-leds,
	linux-iio, linux-doc

On 18/04/2023 18:43, Luca Weiss wrote:
> Document the 8 GPIOs found on PMI632.
> 
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
>  Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml | 3 +++
>  1 file changed, 3 insertions(+)

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

* Re: [PATCH v2 2/8] pinctrl: qcom: spmi-gpio: Add PMI632 support
  2023-04-18 16:43 ` [PATCH v2 2/8] pinctrl: qcom: spmi-gpio: Add PMI632 support Luca Weiss
@ 2023-04-20 10:12   ` Dmitry Baryshkov
  0 siblings, 0 replies; 20+ messages in thread
From: Dmitry Baryshkov @ 2023-04-20 10:12 UTC (permalink / raw
  To: Luca Weiss, ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Linus Walleij, Rob Herring,
	Krzysztof Kozlowski, Pavel Machek, Lee Jones, Jonathan Cameron,
	Lars-Peter Clausen, Stephen Boyd, Jonathan Corbet
  Cc: linux-arm-msm, linux-gpio, devicetree, linux-kernel, linux-leds,
	linux-iio, linux-doc

On 18/04/2023 19:43, Luca Weiss wrote:
> Add support for the 8 GPIOs found on PMI632.
> 
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
>   drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 1 +
>   1 file changed, 1 insertion(+)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry


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

* Re: [PATCH v2 0/8] Add PMI632 PMIC and RGB LED on sdm632-fairphone-fp3
  2023-04-18 16:43 [PATCH v2 0/8] Add PMI632 PMIC and RGB LED on sdm632-fairphone-fp3 Luca Weiss
                   ` (7 preceding siblings ...)
  2023-04-18 16:43 ` [PATCH v2 8/8] Documentation: leds: Add "rgb:status" path Luca Weiss
@ 2023-04-21  8:29 ` Linus Walleij
  2023-05-15 12:17 ` Lee Jones
  9 siblings, 0 replies; 20+ messages in thread
From: Linus Walleij @ 2023-04-21  8:29 UTC (permalink / raw
  To: Luca Weiss
  Cc: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Pavel Machek, Lee Jones, Jonathan Cameron, Lars-Peter Clausen,
	Stephen Boyd, Jonathan Corbet, linux-arm-msm, linux-gpio,
	devicetree, linux-kernel, linux-leds, linux-iio, linux-doc,
	Krzysztof Kozlowski

On Tue, Apr 18, 2023 at 6:43 PM Luca Weiss <luca@z3ntu.xyz> wrote:

> Add support for the PMI632 PMIC in the spmi-gpio & qcom-lpg driver, add
> the dtsi for the PMIC and enable the notification LED on fairphone-fp3.
>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
(...)
> Luca Weiss (8):
>       dt-bindings: pinctrl: qcom,pmic-gpio: add PMI632
>       pinctrl: qcom: spmi-gpio: Add PMI632 support

Patches 1 & 2 are finished so I applied them to the pinctrl tree so
Luca does not need to keep reiterating these for the next kernel cycle.

Yours,
Linus Walleij

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

* Re: [PATCH v2 3/8] dt-bindings: leds: qcom-lpg: Add compatible for PMI632 LPG block
  2023-04-18 16:43 ` [PATCH v2 3/8] dt-bindings: leds: qcom-lpg: Add compatible for PMI632 LPG block Luca Weiss
@ 2023-04-27 15:27   ` Lee Jones
  0 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2023-04-27 15:27 UTC (permalink / raw
  To: Luca Weiss
  Cc: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Linus Walleij, Rob Herring,
	Krzysztof Kozlowski, Pavel Machek, Jonathan Cameron,
	Lars-Peter Clausen, Stephen Boyd, Jonathan Corbet, linux-arm-msm,
	linux-gpio, devicetree, linux-kernel, linux-leds, linux-iio,
	linux-doc, Krzysztof Kozlowski

On Tue, 18 Apr 2023, Luca Weiss wrote:

> Document the availability of an LPG configuration for the PMI632 PMIC in
> the Qualcomm Light Pulse Generator driver.
> 
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
>  Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks

-- 
Lee Jones [李琼斯]

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

* Re: [PATCH v2 4/8] leds: qcom-lpg: Add support for PMI632 LPG
  2023-04-18 16:43 ` [PATCH v2 4/8] leds: qcom-lpg: Add support for PMI632 LPG Luca Weiss
@ 2023-04-27 15:27   ` Lee Jones
  0 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2023-04-27 15:27 UTC (permalink / raw
  To: Luca Weiss
  Cc: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Linus Walleij, Rob Herring,
	Krzysztof Kozlowski, Pavel Machek, Jonathan Cameron,
	Lars-Peter Clausen, Stephen Boyd, Jonathan Corbet, linux-arm-msm,
	linux-gpio, devicetree, linux-kernel, linux-leds, linux-iio,
	linux-doc

On Tue, 18 Apr 2023, Luca Weiss wrote:

> The PMI632 PMIC contains 5 PWM channels, 3 of which can be used for
> LEDs.
> 
> For the LED pattern it doesn't have LUT like other PMICs but uses SDAM
> instead. This is not currently implemented in the driver but since LPG
> works fine without it, add support for the PMIC now.
> 
> Acked-by: Pavel Machek <pavel@ucw.cz>
> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
>  drivers/leds/rgb/leds-qcom-lpg.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)

Applied, thanks

-- 
Lee Jones [李琼斯]

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

* Re: [PATCH v2 5/8] dt-bindings: mfd: qcom-spmi-pmic: Add PMI632 compatible
  2023-04-18 16:43 ` [PATCH v2 5/8] dt-bindings: mfd: qcom-spmi-pmic: Add PMI632 compatible Luca Weiss
@ 2023-04-27 15:28   ` Lee Jones
  0 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2023-04-27 15:28 UTC (permalink / raw
  To: Luca Weiss
  Cc: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Linus Walleij, Rob Herring,
	Krzysztof Kozlowski, Pavel Machek, Jonathan Cameron,
	Lars-Peter Clausen, Stephen Boyd, Jonathan Corbet, linux-arm-msm,
	linux-gpio, devicetree, linux-kernel, linux-leds, linux-iio,
	linux-doc, Krzysztof Kozlowski

On Tue, 18 Apr 2023, Luca Weiss wrote:

> Document support for the pmi632, often found with the sdm632 SoC.
> 
> Acked-by: Pavel Machek <pavel@ucw.cz>
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
>  Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks

-- 
Lee Jones [李琼斯]

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

* Re: [PATCH v2 8/8] Documentation: leds: Add "rgb:status" path
  2023-04-18 16:43 ` [PATCH v2 8/8] Documentation: leds: Add "rgb:status" path Luca Weiss
@ 2023-04-27 16:05   ` Lee Jones
  2023-04-27 17:50     ` Luca Weiss
  0 siblings, 1 reply; 20+ messages in thread
From: Lee Jones @ 2023-04-27 16:05 UTC (permalink / raw
  To: Luca Weiss
  Cc: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Linus Walleij, Rob Herring,
	Krzysztof Kozlowski, Pavel Machek, Jonathan Cameron,
	Lars-Peter Clausen, Stephen Boyd, Jonathan Corbet, linux-arm-msm,
	linux-gpio, devicetree, linux-kernel, linux-leds, linux-iio,
	linux-doc

On Tue, 18 Apr 2023, Luca Weiss wrote:

> The path /sys/class/leds/rgb:status is already widely used with the
> qcom-lpg driver and others. Document it.

Where is this used?

$ grep status drivers/leds/rgb/leds-qcom-lpg.c
<no results>

> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
>  Documentation/leds/well-known-leds.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/leds/well-known-leds.txt b/Documentation/leds/well-known-leds.txt
> index 2160382c86be..439d4dac4472 100644
> --- a/Documentation/leds/well-known-leds.txt
> +++ b/Documentation/leds/well-known-leds.txt
> @@ -58,6 +58,7 @@ LEDs on notebook body, indicating that sound input / output is muted.
>  
>  * System notification
>  
> +Good: "rgb:status"
>  Legacy: "status-led:{red,green,blue}" (Motorola Droid 4)
>  Legacy: "lp5523:{r,g,b}" (Nokia N900)
>  
> 
> -- 
> 2.40.0
> 

-- 
Lee Jones [李琼斯]

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

* Re: [PATCH v2 8/8] Documentation: leds: Add "rgb:status" path
  2023-04-27 16:05   ` Lee Jones
@ 2023-04-27 17:50     ` Luca Weiss
  0 siblings, 0 replies; 20+ messages in thread
From: Luca Weiss @ 2023-04-27 17:50 UTC (permalink / raw
  To: Lee Jones
  Cc: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Linus Walleij, Rob Herring,
	Krzysztof Kozlowski, Pavel Machek, Jonathan Cameron,
	Lars-Peter Clausen, Stephen Boyd, Jonathan Corbet, linux-arm-msm,
	linux-gpio, devicetree, linux-kernel, linux-leds, linux-iio,
	linux-doc

On Donnerstag, 27. April 2023 18:05:59 CEST Lee Jones wrote:
> On Tue, 18 Apr 2023, Luca Weiss wrote:
> > The path /sys/class/leds/rgb:status is already widely used with the
> > qcom-lpg driver and others. Document it.
> 
> Where is this used?
> 
> $ grep status drivers/leds/rgb/leds-qcom-lpg.c
> <no results>

This is set in devicetree, e.g. from qcom-msm8974pro-fairphone-fp2.dts[0]:

    color = <LED_COLOR_ID_RGB>;
    function = LED_FUNCTION_STATUS;

And then something in the LED core sets the name based on that, I'd have
to dig to find where exactly.

Regards
Luca

[0] https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/qcom-msm8974pro-fairphone-fp2.dts#L105-L106

> 
> > Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> > ---
> > 
> >  Documentation/leds/well-known-leds.txt | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/Documentation/leds/well-known-leds.txt
> > b/Documentation/leds/well-known-leds.txt index 2160382c86be..439d4dac4472
> > 100644
> > --- a/Documentation/leds/well-known-leds.txt
> > +++ b/Documentation/leds/well-known-leds.txt
> > @@ -58,6 +58,7 @@ LEDs on notebook body, indicating that sound input /
> > output is muted.> 
> >  * System notification
> > 
> > +Good: "rgb:status"
> > 
> >  Legacy: "status-led:{red,green,blue}" (Motorola Droid 4)
> >  Legacy: "lp5523:{r,g,b}" (Nokia N900)





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

* Re: [PATCH v2 0/8] Add PMI632 PMIC and RGB LED on sdm632-fairphone-fp3
  2023-04-18 16:43 [PATCH v2 0/8] Add PMI632 PMIC and RGB LED on sdm632-fairphone-fp3 Luca Weiss
                   ` (8 preceding siblings ...)
  2023-04-21  8:29 ` [PATCH v2 0/8] Add PMI632 PMIC and RGB LED on sdm632-fairphone-fp3 Linus Walleij
@ 2023-05-15 12:17 ` Lee Jones
  9 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2023-05-15 12:17 UTC (permalink / raw
  To: Luca Weiss
  Cc: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Linus Walleij, Rob Herring,
	Krzysztof Kozlowski, Pavel Machek, Jonathan Cameron,
	Lars-Peter Clausen, Stephen Boyd, Jonathan Corbet, linux-arm-msm,
	linux-gpio, devicetree, linux-kernel, linux-leds, linux-iio,
	linux-doc, Krzysztof Kozlowski

On Tue, 18 Apr 2023, Luca Weiss wrote:

> Add support for the PMI632 PMIC in the spmi-gpio & qcom-lpg driver, add
> the dtsi for the PMIC and enable the notification LED on fairphone-fp3.
> 
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
> Changes in v2:
> - Add qcom,pmi632-gpio to all the needed places in yaml
> - Add patch documenting led path
> - Pick up tags
> - Drop vadc pre-scaling patch since it was applied
> - Link to v1: https://lore.kernel.org/r/20230414-pmi632-v1-0-fe94dc414832@z3ntu.xyz
> 
> ---
> Luca Weiss (8):
>       dt-bindings: pinctrl: qcom,pmic-gpio: add PMI632
>       pinctrl: qcom: spmi-gpio: Add PMI632 support
>       dt-bindings: leds: qcom-lpg: Add compatible for PMI632 LPG block
>       leds: qcom-lpg: Add support for PMI632 LPG
>       dt-bindings: mfd: qcom-spmi-pmic: Add PMI632 compatible
>       arm64: dts: qcom: Add PMI632 PMIC
>       arm64: dts: qcom: sdm632-fairphone-fp3: Add notification LED
>       Documentation: leds: Add "rgb:status" path
> 
>  .../devicetree/bindings/leds/leds-qcom-lpg.yaml    |   1 +
>  .../devicetree/bindings/mfd/qcom,spmi-pmic.yaml    |   1 +
>  .../bindings/pinctrl/qcom,pmic-gpio.yaml           |   3 +
>  Documentation/leds/well-known-leds.txt             |   1 +
>  arch/arm64/boot/dts/qcom/pmi632.dtsi               | 165 +++++++++++++++++++++
>  arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts  |  29 ++++
>  drivers/leds/rgb/leds-qcom-lpg.c                   |  15 ++
>  drivers/pinctrl/qcom/pinctrl-spmi-gpio.c           |   1 +
>  8 files changed, 216 insertions(+)

Please rebase anything that is yet to be applied and submit a [RESEND].

Thank you.

> ---
> base-commit: 3f49aa65798675341eb9d4f947c40558564b2e6d
> change-id: 20230414-pmi632-4ae03225ae75
> 
> Best regards,
> -- 
> Luca Weiss <luca@z3ntu.xyz>
 

-- 
Lee Jones [李琼斯]

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

end of thread, other threads:[~2023-05-15 12:17 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-18 16:43 [PATCH v2 0/8] Add PMI632 PMIC and RGB LED on sdm632-fairphone-fp3 Luca Weiss
2023-04-18 16:43 ` [PATCH v2 1/8] dt-bindings: pinctrl: qcom,pmic-gpio: add PMI632 Luca Weiss
2023-04-19 18:06   ` Krzysztof Kozlowski
2023-04-18 16:43 ` [PATCH v2 2/8] pinctrl: qcom: spmi-gpio: Add PMI632 support Luca Weiss
2023-04-20 10:12   ` Dmitry Baryshkov
2023-04-18 16:43 ` [PATCH v2 3/8] dt-bindings: leds: qcom-lpg: Add compatible for PMI632 LPG block Luca Weiss
2023-04-27 15:27   ` Lee Jones
2023-04-18 16:43 ` [PATCH v2 4/8] leds: qcom-lpg: Add support for PMI632 LPG Luca Weiss
2023-04-27 15:27   ` Lee Jones
2023-04-18 16:43 ` [PATCH v2 5/8] dt-bindings: mfd: qcom-spmi-pmic: Add PMI632 compatible Luca Weiss
2023-04-27 15:28   ` Lee Jones
2023-04-18 16:43 ` [PATCH v2 6/8] arm64: dts: qcom: Add PMI632 PMIC Luca Weiss
2023-04-19 10:27   ` Konrad Dybcio
2023-04-18 16:43 ` [PATCH v2 7/8] arm64: dts: qcom: sdm632-fairphone-fp3: Add notification LED Luca Weiss
2023-04-19 10:28   ` Konrad Dybcio
2023-04-18 16:43 ` [PATCH v2 8/8] Documentation: leds: Add "rgb:status" path Luca Weiss
2023-04-27 16:05   ` Lee Jones
2023-04-27 17:50     ` Luca Weiss
2023-04-21  8:29 ` [PATCH v2 0/8] Add PMI632 PMIC and RGB LED on sdm632-fairphone-fp3 Linus Walleij
2023-05-15 12:17 ` Lee Jones

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 read-only IMAP folder(s) and NNTP newsgroup(s).