Commit 00e7e69
backlight: pwm_bl: Configure pwm only once per backlight toggle
When the function pwm_backlight_update_status() was called with
brightness > 0, pwm_get_state() was called twice (once directly and once
in compute_duty_cycle). Also pwm_apply_state() was called twice (once in
pwm_backlight_power_on() and once directly).
Optimize this to do both calls only once.
Note that with this affects the order of regulator and PWM setup. It's
not expected to have a relevant effect on hardware. The rationale for
this is that the regulator (and the GPIO) are reasonable to switch in
pwm_backlight_power_on()/pwm_backlight_power_off() but the PWM has
nothing to do with power. (The post_pwm_on_delay and pwm_off_delay are
still there though.)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20230120120018.161103-2-u.kleine-koenig@pengutronix.de1 parent 744fc2d commit 00e7e69
1 file changed
Lines changed: 10 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | 43 | | |
45 | 44 | | |
46 | | - | |
47 | 45 | | |
48 | 46 | | |
49 | 47 | | |
50 | 48 | | |
51 | 49 | | |
52 | 50 | | |
53 | 51 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | 52 | | |
58 | 53 | | |
59 | 54 | | |
| |||
65 | 60 | | |
66 | 61 | | |
67 | 62 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | 63 | | |
72 | 64 | | |
73 | 65 | | |
| |||
77 | 69 | | |
78 | 70 | | |
79 | 71 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | 72 | | |
85 | 73 | | |
86 | 74 | | |
87 | 75 | | |
88 | | - | |
| 76 | + | |
89 | 77 | | |
90 | 78 | | |
91 | | - | |
92 | 79 | | |
93 | 80 | | |
94 | | - | |
95 | | - | |
96 | 81 | | |
97 | 82 | | |
98 | 83 | | |
99 | 84 | | |
100 | 85 | | |
101 | | - | |
| 86 | + | |
102 | 87 | | |
103 | 88 | | |
104 | 89 | | |
| |||
115 | 100 | | |
116 | 101 | | |
117 | 102 | | |
118 | | - | |
| 103 | + | |
| 104 | + | |
119 | 105 | | |
| 106 | + | |
120 | 107 | | |
121 | 108 | | |
122 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
123 | 115 | | |
124 | 116 | | |
125 | 117 | | |
| |||
0 commit comments