Commit db01120c5f6cb1d8c6533a49b009f08a73852498
Committed by
Thierry Reding
1 parent
d46055af1c
Exists in
master
and in
16 other branches
ARM: pxa: Initialize PWM backlight enable_gpio field
The GPIO API defines 0 as being a valid GPIO number, so this field needs to be initialized explicitly. A special case is the Palm Tungsten|C board. Since it doesn't use any quirks that would require the existing .init() or .exit() hooks it can simply use the new enable_gpio field. Signed-off-by: Thierry Reding <treding@nvidia.com>
Showing 17 changed files with 19 additions and 34 deletions Side-by-side Diff
- arch/arm/mach-pxa/cm-x300.c
- arch/arm/mach-pxa/colibri-pxa270-income.c
- arch/arm/mach-pxa/ezx.c
- arch/arm/mach-pxa/hx4700.c
- arch/arm/mach-pxa/lpd270.c
- arch/arm/mach-pxa/magician.c
- arch/arm/mach-pxa/mainstone.c
- arch/arm/mach-pxa/mioa701.c
- arch/arm/mach-pxa/palm27x.c
- arch/arm/mach-pxa/palmtc.c
- arch/arm/mach-pxa/palmte2.c
- arch/arm/mach-pxa/pcm990-baseboard.c
- arch/arm/mach-pxa/raumfeld.c
- arch/arm/mach-pxa/tavorevb.c
- arch/arm/mach-pxa/viper.c
- arch/arm/mach-pxa/z2.c
- arch/arm/mach-pxa/zylonite.c
arch/arm/mach-pxa/cm-x300.c
arch/arm/mach-pxa/colibri-pxa270-income.c
arch/arm/mach-pxa/ezx.c
arch/arm/mach-pxa/hx4700.c
arch/arm/mach-pxa/lpd270.c
arch/arm/mach-pxa/magician.c
arch/arm/mach-pxa/mainstone.c
arch/arm/mach-pxa/mioa701.c
arch/arm/mach-pxa/palm27x.c
arch/arm/mach-pxa/palmtc.c
... | ... | @@ -166,45 +166,12 @@ |
166 | 166 | * Backlight |
167 | 167 | ******************************************************************************/ |
168 | 168 | #if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE) |
169 | -static int palmtc_backlight_init(struct device *dev) | |
170 | -{ | |
171 | - int ret; | |
172 | - | |
173 | - ret = gpio_request(GPIO_NR_PALMTC_BL_POWER, "BL POWER"); | |
174 | - if (ret) | |
175 | - goto err; | |
176 | - ret = gpio_direction_output(GPIO_NR_PALMTC_BL_POWER, 1); | |
177 | - if (ret) | |
178 | - goto err2; | |
179 | - | |
180 | - return 0; | |
181 | - | |
182 | -err2: | |
183 | - gpio_free(GPIO_NR_PALMTC_BL_POWER); | |
184 | -err: | |
185 | - return ret; | |
186 | -} | |
187 | - | |
188 | -static int palmtc_backlight_notify(struct device *dev, int brightness) | |
189 | -{ | |
190 | - /* backlight is on when GPIO16 AF0 is high */ | |
191 | - gpio_set_value(GPIO_NR_PALMTC_BL_POWER, brightness); | |
192 | - return brightness; | |
193 | -} | |
194 | - | |
195 | -static void palmtc_backlight_exit(struct device *dev) | |
196 | -{ | |
197 | - gpio_free(GPIO_NR_PALMTC_BL_POWER); | |
198 | -} | |
199 | - | |
200 | 169 | static struct platform_pwm_backlight_data palmtc_backlight_data = { |
201 | 170 | .pwm_id = 1, |
202 | 171 | .max_brightness = PALMTC_MAX_INTENSITY, |
203 | 172 | .dft_brightness = PALMTC_MAX_INTENSITY, |
204 | 173 | .pwm_period_ns = PALMTC_PERIOD_NS, |
205 | - .init = palmtc_backlight_init, | |
206 | - .notify = palmtc_backlight_notify, | |
207 | - .exit = palmtc_backlight_exit, | |
174 | + .enable_gpio = GPIO_NR_PALMTC_BL_POWER, | |
208 | 175 | }; |
209 | 176 | |
210 | 177 | static struct platform_device palmtc_backlight = { |
arch/arm/mach-pxa/palmte2.c
... | ... | @@ -165,6 +165,7 @@ |
165 | 165 | .max_brightness = PALMTE2_MAX_INTENSITY, |
166 | 166 | .dft_brightness = PALMTE2_MAX_INTENSITY, |
167 | 167 | .pwm_period_ns = PALMTE2_PERIOD_NS, |
168 | + .enable_gpio = -1, | |
168 | 169 | .init = palmte2_backlight_init, |
169 | 170 | .notify = palmte2_backlight_notify, |
170 | 171 | .exit = palmte2_backlight_exit, |
arch/arm/mach-pxa/pcm990-baseboard.c
arch/arm/mach-pxa/raumfeld.c
arch/arm/mach-pxa/tavorevb.c
... | ... | @@ -175,6 +175,7 @@ |
175 | 175 | .max_brightness = 100, |
176 | 176 | .dft_brightness = 100, |
177 | 177 | .pwm_period_ns = 100000, |
178 | + .enable_gpio = -1, | |
178 | 179 | }, |
179 | 180 | [1] = { |
180 | 181 | /* secondary backlight */ |
... | ... | @@ -182,6 +183,7 @@ |
182 | 183 | .max_brightness = 100, |
183 | 184 | .dft_brightness = 100, |
184 | 185 | .pwm_period_ns = 100000, |
186 | + .enable_gpio = -1, | |
185 | 187 | }, |
186 | 188 | }; |
187 | 189 |
arch/arm/mach-pxa/viper.c
arch/arm/mach-pxa/z2.c
... | ... | @@ -206,6 +206,7 @@ |
206 | 206 | .max_brightness = 1023, |
207 | 207 | .dft_brightness = 0, |
208 | 208 | .pwm_period_ns = 1260320, |
209 | + .enable_gpio = -1, | |
209 | 210 | }, |
210 | 211 | [1] = { |
211 | 212 | /* LCD Backlight */ |
... | ... | @@ -213,6 +214,7 @@ |
213 | 214 | .max_brightness = 1023, |
214 | 215 | .dft_brightness = 512, |
215 | 216 | .pwm_period_ns = 1260320, |
217 | + .enable_gpio = -1, | |
216 | 218 | }, |
217 | 219 | }; |
218 | 220 |