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 <[email protected]>
---
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/[email protected]
---
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 <[email protected]>
The PMI632, commonly found on SoCs with SDM632 has various standard
functions like ADC, GPIOs, LPG and more.
Signed-off-by: Luca Weiss <[email protected]>
---
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 <[email protected]>
+ */
+
+#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
Document support for the pmi632, often found with the sdm632 SoC.
Acked-by: Pavel Machek <[email protected]>
Acked-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Luca Weiss <[email protected]>
---
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
The phone features a notification LED connected to the pmi632. Configure
the RGB led found on it.
Signed-off-by: Luca Weiss <[email protected]>
---
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
Document the availability of an LPG configuration for the PMI632 PMIC in
the Qualcomm Light Pulse Generator driver.
Acked-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Luca Weiss <[email protected]>
---
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
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 <[email protected]>
> ---
Looks good!
Reviewed-by: Konrad Dybcio <[email protected]>
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 <[email protected]>
> + */
> +
> +#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";
> + };
> + };
> +};
>
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 <[email protected]>
> ---
Reviewed-by: Konrad Dybcio <[email protected]>
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>;
>
On Tue, Apr 18, 2023 at 6:43 PM Luca Weiss <[email protected]> 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 <[email protected]>
(...)
> 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
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 <[email protected]>
> Signed-off-by: Luca Weiss <[email protected]>
> ---
> Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml | 1 +
> 1 file changed, 1 insertion(+)
Applied, thanks
--
Lee Jones [李琼斯]
On Tue, 18 Apr 2023, Luca Weiss wrote:
> Document support for the pmi632, often found with the sdm632 SoC.
>
> Acked-by: Pavel Machek <[email protected]>
> Acked-by: Krzysztof Kozlowski <[email protected]>
> Signed-off-by: Luca Weiss <[email protected]>
> ---
> Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml | 1 +
> 1 file changed, 1 insertion(+)
Applied, thanks
--
Lee Jones [李琼斯]
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 <[email protected]>
> ---
> 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/[email protected]
>
> ---
> 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 <[email protected]>
--
Lee Jones [李琼斯]