[v2,3/3] arm64: dts: qcom: msm8916-alcatel-idol347: add LED indicator

Message ID 20221104132400.1763218-4-vincent.knecht@mailoo.org
State New
Headers
Series Add msm8916-alcatel-idol347 torch and LED support |

Commit Message

Vincent Knecht Nov. 4, 2022, 1:24 p.m. UTC
  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 <vincent.knecht@mailoo.org>
---
 .../boot/dts/qcom/msm8916-alcatel-idol347.dts | 44 +++++++++++++++++++
 1 file changed, 44 insertions(+)
  

Comments

Krzysztof Kozlowski Nov. 4, 2022, 1:57 p.m. UTC | #1
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 <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
  
Konrad Dybcio Nov. 4, 2022, 2:21 p.m. UTC | #2
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 <vincent.knecht@mailoo.org>
> ---
>   .../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 <konrad.dybcio@somainline.org>


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";
  

Patch

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";