leds: qpnp-flash-v2: Fix pinctrl configuration
Currently pinctrl is obtained after it is used to obtain
strobe_enable and strobe_disable states. This is incorrect and
needs to be fixed. Also, when the switch device is disabled, the
pinctrl configuration for GPIO that drives the LED output is
selected only when the brightness or current is set to a non-zero
value in flash device.
To keep it simple, move the pinctrl configuration for GPIO that
drives the LED output (e.g. flash LED3) to the switch device so
that both flash and torch device need not have to control it.
Also, fix the pinctrl configuration for GPIO21 that is used to
drive flash LED3 output on sdm845 CDP and MTP for functional
correctness.
Change-Id: If6ec27dd39fd750b6d4311a5e370020961f30e08
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
diff --git a/arch/arm64/boot/dts/qcom/sdm845-cdp.dtsi b/arch/arm64/boot/dts/qcom/sdm845-cdp.dtsi
index 27a95ae..38d7d38 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-cdp.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-cdp.dtsi
@@ -119,13 +119,7 @@
status = "ok";
};
-&pmi8998_flash2 {
- pinctrl-names = "led_enable", "led_disable";
- pinctrl-0 = <&flash_led3_front_en>;
- pinctrl-1 = <&flash_led3_front_dis>;
-};
-
-&pmi8998_torch2 {
+&pmi8998_switch1 {
pinctrl-names = "led_enable", "led_disable";
pinctrl-0 = <&flash_led3_front_en>;
pinctrl-1 = <&flash_led3_front_dis>;