The LED setting and ramp timing modified for upgrade from android P
Root cause:
Code base upgrade
How to fix:
Upgrade from Android P
RiskArea:
LED
Change-Id: I36732b9b701400832a0a4975626cd933e608fc4e
diff --git a/arch/arm64/boot/dts/qcom/pmi632.dtsi b/arch/arm64/boot/dts/qcom/pmi632.dtsi
index 6919e74..d2b1688 100644
--- a/arch/arm64/boot/dts/qcom/pmi632.dtsi
+++ b/arch/arm64/boot/dts/qcom/pmi632.dtsi
@@ -565,30 +565,80 @@
nvmem = <&pmi632_sdam7>;
qcom,pbs-client = <&pmi632_pbs_client3>;
qcom,lut-sdam-base = <0x80>;
+ //<2020/04/21-Yuting Shih.[FAIRPHONE-Q][MISC][COMMON][LED][][]Modified for breath ramp and timing.
+ #if 1
+ qcom,lut-patterns = <0 0 0 0 0 0 0 0 2 16 30 44 58 72 86 96 100 100
+ 100 100 96 86 72 58 44 30 16 2 0 0 0 0 0 0 0 0>;
+ #else
+ /* Code default */
qcom,lut-patterns = <0 0 0 14 28 42 56 70 84 100
100 84 70 56 42 28 14 0 0 0>;
+ #endif
+ //>2020/04/21-Yuting Shih.[FAIRPHONE-Q][MISC][COMMON][LED][][].
lpg@1 {
qcom,lpg-chan-id = <1>;
+ //<2020/04/21-Yuting Shih.[FAIRPHONE-Q][MISC][COMMON][LED][][]Modified for breath ramp and timing.
+ #if 1
+ qcom,ramp-step-ms = <60>;
+ qcom,ramp-pause-hi-count = <80>;
+ qcom,ramp-pause-lo-count = <80>;
+ qcom,ramp-low-index = <0>;
+ qcom,ramp-high-index = <35>;
+ //qcom,ramp-toggle; /* ramp from high to low */
+ //qcom,ramp-from-low-to-high;
+ qcom,ramp-pattern-repeat;
+ #else
+ /* Code default */
qcom,ramp-step-ms = <200>;
qcom,ramp-low-index = <0>;
qcom,ramp-high-index = <19>;
qcom,ramp-pattern-repeat;
+ #endif
+ //>2020/04/21-Yuting Shih.[FAIRPHONE-Q][MISC][COMMON][LED][][].
qcom,lpg-sdam-base = <0x48>;
};
lpg@2 {
qcom,lpg-chan-id = <2>;
+ //<2020/04/21-Yuting Shih.[FAIRPHONE-Q][MISC][COMMON][LED][][]Modified for breath ramp and timing.
+ #if 1
+ qcom,ramp-step-ms = <60>;
+ qcom,ramp-pause-hi-count = <80>;
+ qcom,ramp-pause-lo-count = <80>;
+ qcom,ramp-low-index = <0>;
+ qcom,ramp-high-index = <35>;
+ //qcom,ramp-toggle; /* ramp from high to low */
+ //qcom,ramp-from-low-to-high;
+ qcom,ramp-pattern-repeat;
+ #else
+ /* Code default */
qcom,ramp-step-ms = <200>;
qcom,ramp-low-index = <0>;
qcom,ramp-high-index = <19>;
qcom,ramp-pattern-repeat;
+ #endif
+ //>2020/04/21-Yuting Shih.[FAIRPHONE-Q][MISC][COMMON][LED][][].
qcom,lpg-sdam-base = <0x56>;
};
lpg@3 {
qcom,lpg-chan-id = <3>;
+ //<2020/04/21-Yuting Shih.[FAIRPHONE-Q][MISC][COMMON][LED][][]Modified for breath ramp and timing.
+ #if 1
+ qcom,ramp-step-ms = <60>;
+ qcom,ramp-pause-hi-count = <80>;
+ qcom,ramp-pause-lo-count = <80>;
+ qcom,ramp-low-index = <0>;
+ qcom,ramp-high-index = <35>;
+ //qcom,ramp-toggle; /* ramp from high to low */
+ //qcom,ramp-from-low-to-high;
+ qcom,ramp-pattern-repeat;
+ #else
+ /* Code default */
qcom,ramp-step-ms = <200>;
qcom,ramp-low-index = <0>;
qcom,ramp-high-index = <19>;
qcom,ramp-pattern-repeat;
+ #endif
+ //>2020/04/21-Yuting Shih.[FAIRPHONE-Q][MISC][COMMON][LED][][].
qcom,lpg-sdam-base = <0x64>;
};
};
diff --git a/drivers/leds/leds-qti-tri-led.c b/drivers/leds/leds-qti-tri-led.c
index c494655..a079009 100644
--- a/drivers/leds/leds-qti-tri-led.c
+++ b/drivers/leds/leds-qti-tri-led.c
@@ -475,6 +475,21 @@
of_get_property(child_node, "label", NULL) ? :
child_node->name;
+ //<2020/04/21-Yuting Shih.[FAIRPHONE-Q][MISC][COMMON][LED][][]Add for flag initial.
+ led->pwm_setting.pre_period_ns = 0;
+ led->pwm_setting.period_ns = 0;
+ led->pwm_setting.duty_ns = 0;
+
+ led->led_setting.on_ms = 0;
+ led->led_setting.off_ms = 0;
+ led->led_setting.brightness = LED_OFF;
+ led->led_setting.blink = false;
+ led->led_setting.breath = false;
+
+ led->blinking = false;
+ led->breathing = false;
+ //>2020/04/21-Yuting Shih.[FAIRPHONE-Q][MISC][COMMON][LED][][].
+
led->pwm_dev =
devm_of_pwm_get(chip->dev, child_node, NULL);
if (IS_ERR(led->pwm_dev)) {