2022-11-04 13:36:42

by Vincent Knecht

[permalink] [raw]
Subject: [PATCH v2 0/3] Add msm8916-alcatel-idol347 torch and LED support

Add support for GPIO torch LED and si-en,sn3190 white LED indicator.

Changes in v2:
- Added patch 1/3 to use -state suffix in GPIOs states node names
- Changed patch 2/3 and 3/3 to also use -state suffix

Vincent Knecht (3):
arm64: dts: qcom: msm8916-alcatel-idol347: Add GPIOs -state suffix
arm64: dts: qcom: msm8916-alcatel-idol347: add GPIO torch LED
arm64: dts: qcom: msm8916-alcatel-idol347: add LED indicator

.../boot/dts/qcom/msm8916-alcatel-idol347.dts | 80 +++++++++++++++++--
1 file changed, 73 insertions(+), 7 deletions(-)

--
2.38.1





2022-11-04 13:37:05

by Vincent Knecht

[permalink] [raw]
Subject: [PATCH v2 3/3] arm64: dts: qcom: msm8916-alcatel-idol347: add LED indicator

Add si-en,sn3190 LED controller to enable white LED indicator.

This requires adding the additional "enable" gpio that the OEM
choose to use, despite it not being mentioned in si-en,sn3190
datasheet nor supported by the driver.

Signed-off-by: Vincent Knecht <[email protected]>
---
.../boot/dts/qcom/msm8916-alcatel-idol347.dts | 44 +++++++++++++++++++
1 file changed, 44 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
index eadeb1a445fd..701a5585d77e 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
@@ -130,6 +130,27 @@ gyroscope@68 {
};
};

+&blsp_i2c6 {
+ status = "okay";
+
+ led-controller@68 {
+ compatible = "si-en,sn3190";
+ reg = <0x68>;
+ shutdown-gpios = <&msmgpio 89 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&led_enable_default &led_shutdown_default>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ led@1 {
+ reg = <1>;
+ led-max-microamp = <5000>;
+ function = LED_FUNCTION_INDICATOR;
+ color = <LED_COLOR_ID_WHITE>;
+ };
+ };
+};
+
&pm8916_resin {
status = "okay";
linux,code = <KEY_VOLUMEDOWN>;
@@ -306,6 +327,29 @@ gyro_int_default: gyro-int-default-state {
bias-disable;
};

+ /*
+ * The OEM wired an additional GPIO to be asserted so that
+ * the si-en,sn3190 LED IC works. Since this GPIO is not
+ * part of the IC datasheet nor supported by the driver,
+ * force it asserted here.
+ */
+ led_enable_default: led-enable-default-state {
+ pins = "gpio102";
+ function = "gpio";
+
+ drive-strength = <2>;
+ bias-disable;
+ output-high;
+ };
+
+ led_shutdown_default: led-shutdown-default-state {
+ pins = "gpio89";
+ function = "gpio";
+
+ drive-strength = <2>;
+ bias-disable;
+ };
+
mag_reset_default: mag-reset-default-state {
pins = "gpio8";
function = "gpio";
--
2.38.1




2022-11-04 13:38:55

by Vincent Knecht

[permalink] [raw]
Subject: [PATCH v2 2/3] arm64: dts: qcom: msm8916-alcatel-idol347: add GPIO torch LED

Add support for torch LED on GPIO 32.

Signed-off-by: Vincent Knecht <[email protected]>
---
.../boot/dts/qcom/msm8916-alcatel-idol347.dts | 22 +++++++++++++++++++
1 file changed, 22 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
index 668f8ff53229..eadeb1a445fd 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
@@ -5,6 +5,7 @@
#include "msm8916-pm8916.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>

/ {
model = "Alcatel OneTouch Idol 3 (4.7)";
@@ -34,6 +35,19 @@ button-volume-up {
};
};

+ gpio-leds {
+ compatible = "gpio-leds";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&gpio_leds_default>;
+
+ led-0 {
+ gpios = <&msmgpio 32 GPIO_ACTIVE_HIGH>;
+ linux,default-trigger = "torch";
+ function = LED_FUNCTION_TORCH;
+ };
+ };
+
usb_id: usb-id {
compatible = "linux,extcon-usb-gpio";
id-gpio = <&msmgpio 69 GPIO_ACTIVE_HIGH>;
@@ -276,6 +290,14 @@ gpio_keys_default: gpio-keys-default-state {
bias-pull-up;
};

+ gpio_leds_default: gpio-leds-default-state {
+ pins = "gpio32";
+ function = "gpio";
+
+ drive-strength = <2>;
+ bias-disable;
+ };
+
gyro_int_default: gyro-int-default-state {
pins = "gpio97", "gpio98";
function = "gpio";
--
2.38.1




2022-11-04 14:05:29

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] arm64: dts: qcom: msm8916-alcatel-idol347: add GPIO torch LED

On 04/11/2022 09:23, Vincent Knecht wrote:
> Add support for torch LED on GPIO 32.
>
> Signed-off-by: Vincent Knecht <[email protected]>
> ---
> .../boot/dts/qcom/msm8916-alcatel-idol347.dts | 22 +++++++++++++++++++
> 1 file changed, 22 insertions(+)
>


Reviewed-by: Krzysztof Kozlowski <[email protected]>

Best regards,
Krzysztof


2022-11-04 14:15:40

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 3/3] arm64: dts: qcom: msm8916-alcatel-idol347: add LED indicator

On 04/11/2022 09:24, Vincent Knecht wrote:
> Add si-en,sn3190 LED controller to enable white LED indicator.
>
> This requires adding the additional "enable" gpio that the OEM
> choose to use, despite it not being mentioned in si-en,sn3190
> datasheet nor supported by the driver.
>


Reviewed-by: Krzysztof Kozlowski <[email protected]>

Best regards,
Krzysztof


2022-11-04 14:32:37

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH v2 3/3] arm64: dts: qcom: msm8916-alcatel-idol347: add LED indicator


On 04/11/2022 14:24, Vincent Knecht wrote:
> Add si-en,sn3190 LED controller to enable white LED indicator.
>
> This requires adding the additional "enable" gpio that the OEM
> choose to use, despite it not being mentioned in si-en,sn3190
> datasheet nor supported by the driver.
>
> Signed-off-by: Vincent Knecht <[email protected]>
> ---
> .../boot/dts/qcom/msm8916-alcatel-idol347.dts | 44 +++++++++++++++++++
> 1 file changed, 44 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> index eadeb1a445fd..701a5585d77e 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> +++ b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> @@ -130,6 +130,27 @@ gyroscope@68 {
> };
> };
>
> +&blsp_i2c6 {
> + status = "okay";
> +
> + led-controller@68 {
> + compatible = "si-en,sn3190";
> + reg = <0x68>;
> + shutdown-gpios = <&msmgpio 89 GPIO_ACTIVE_HIGH>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&led_enable_default &led_shutdown_default>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + led@1 {
> + reg = <1>;
> + led-max-microamp = <5000>;
> + function = LED_FUNCTION_INDICATOR;
> + color = <LED_COLOR_ID_WHITE>;
> + };
> + };
> +};
> +
> &pm8916_resin {
> status = "okay";
> linux,code = <KEY_VOLUMEDOWN>;
> @@ -306,6 +327,29 @@ gyro_int_default: gyro-int-default-state {
> bias-disable;
> };
>
> + /*
> + * The OEM wired an additional GPIO to be asserted so that
> + * the si-en,sn3190 LED IC works. Since this GPIO is not
> + * part of the IC datasheet nor supported by the driver,
> + * force it asserted here.
> + */

Looks like the least problematic way to handle this.


Reviewed-by: Konrad Dybcio <[email protected]>


Konrad

> + led_enable_default: led-enable-default-state {
> + pins = "gpio102";
> + function = "gpio";
> +
> + drive-strength = <2>;
> + bias-disable;
> + output-high;
> + };
> +
> + led_shutdown_default: led-shutdown-default-state {
> + pins = "gpio89";
> + function = "gpio";
> +
> + drive-strength = <2>;
> + bias-disable;
> + };
> +
> mag_reset_default: mag-reset-default-state {
> pins = "gpio8";
> function = "gpio";

2022-11-04 14:46:34

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] arm64: dts: qcom: msm8916-alcatel-idol347: add GPIO torch LED


On 04/11/2022 14:23, Vincent Knecht wrote:
> Add support for torch LED on GPIO 32.
>
> Signed-off-by: Vincent Knecht <[email protected]>
> ---

Reviewed-by: Konrad Dybcio <[email protected]>


Konrad

> .../boot/dts/qcom/msm8916-alcatel-idol347.dts | 22 +++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> index 668f8ff53229..eadeb1a445fd 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> +++ b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> @@ -5,6 +5,7 @@
> #include "msm8916-pm8916.dtsi"
> #include <dt-bindings/gpio/gpio.h>
> #include <dt-bindings/input/input.h>
> +#include <dt-bindings/leds/common.h>
>
> / {
> model = "Alcatel OneTouch Idol 3 (4.7)";
> @@ -34,6 +35,19 @@ button-volume-up {
> };
> };
>
> + gpio-leds {
> + compatible = "gpio-leds";
> +
> + pinctrl-names = "default";
> + pinctrl-0 = <&gpio_leds_default>;
> +
> + led-0 {
> + gpios = <&msmgpio 32 GPIO_ACTIVE_HIGH>;
> + linux,default-trigger = "torch";
> + function = LED_FUNCTION_TORCH;
> + };
> + };
> +
> usb_id: usb-id {
> compatible = "linux,extcon-usb-gpio";
> id-gpio = <&msmgpio 69 GPIO_ACTIVE_HIGH>;
> @@ -276,6 +290,14 @@ gpio_keys_default: gpio-keys-default-state {
> bias-pull-up;
> };
>
> + gpio_leds_default: gpio-leds-default-state {
> + pins = "gpio32";
> + function = "gpio";
> +
> + drive-strength = <2>;
> + bias-disable;
> + };
> +
> gyro_int_default: gyro-int-default-state {
> pins = "gpio97", "gpio98";
> function = "gpio";

2022-11-07 04:00:59

by Bjorn Andersson

[permalink] [raw]
Subject: Re: (subset) [PATCH v2 0/3] Add msm8916-alcatel-idol347 torch and LED support

On Fri, 4 Nov 2022 14:23:57 +0100, Vincent Knecht wrote:
> Add support for GPIO torch LED and si-en,sn3190 white LED indicator.
>
> Changes in v2:
> - Added patch 1/3 to use -state suffix in GPIOs states node names
> - Changed patch 2/3 and 3/3 to also use -state suffix
>
> Vincent Knecht (3):
> arm64: dts: qcom: msm8916-alcatel-idol347: Add GPIOs -state suffix
> arm64: dts: qcom: msm8916-alcatel-idol347: add GPIO torch LED
> arm64: dts: qcom: msm8916-alcatel-idol347: add LED indicator
>
> [...]

Applied, thanks!

[2/3] arm64: dts: qcom: msm8916-alcatel-idol347: add GPIO torch LED
commit: 64323952aa5a14471a1225f2c1121aa5447c6ded
[3/3] arm64: dts: qcom: msm8916-alcatel-idol347: add LED indicator
commit: 1c8cc183d07059d23d28c29a8e345464c4055127

Best regards,
--
Bjorn Andersson <[email protected]>