Skip to content

Commit 2644f91

Browse files
linuswLee Jones
authored andcommitted
backlight: pwm_bl: Switch to full GPIO descriptor
The PWM backlight still supports passing a enable GPIO line as platform data using the legacy <linux/gpio.h> API. It turns out that ever board using this mechanism except one is pass .enable_gpio = -1. So we drop all these cargo-culted -1's from all instances of this platform data in the kernel. The remaning board, Palm TC, is converted to pass a machine descriptior table with the "enable" GPIO instead, and delete the platform data entry for enable_gpio and the code handling it and things should work smoothly with the new API. Signed-off-by: Linus Walleij <[email protected]> Acked-by: Robert Jarzmik <[email protected]> Acked-by: Krzysztof Kozlowski <[email protected] Reviewed-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Daniel Thompson <[email protected]> Signed-off-by: Lee Jones <[email protected]>
1 parent bb6d3fb commit 2644f91

26 files changed

+11
-49
lines changed

arch/arm/mach-pxa/cm-x300.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@ static struct pwm_lookup cm_x300_pwm_lookup[] = {
312312
static struct platform_pwm_backlight_data cm_x300_backlight_data = {
313313
.max_brightness = 100,
314314
.dft_brightness = 100,
315-
.enable_gpio = -1,
316315
};
317316

318317
static struct platform_device cm_x300_backlight_device = {

arch/arm/mach-pxa/colibri-pxa270-income.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ static struct pwm_lookup income_pwm_lookup[] = {
202202
static struct platform_pwm_backlight_data income_backlight_data = {
203203
.max_brightness = 0x3ff,
204204
.dft_brightness = 0x1ff,
205-
.enable_gpio = -1,
206205
};
207206

208207
static struct platform_device income_backlight = {

arch/arm/mach-pxa/ezx.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ static struct pwm_lookup ezx_pwm_lookup[] __maybe_unused = {
5555
static struct platform_pwm_backlight_data ezx_backlight_data = {
5656
.max_brightness = 1023,
5757
.dft_brightness = 1023,
58-
.enable_gpio = -1,
5958
};
6059

6160
static struct platform_device ezx_backlight_device = {

arch/arm/mach-pxa/hx4700.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,6 @@ static struct platform_device hx4700_lcd = {
556556
static struct platform_pwm_backlight_data backlight_data = {
557557
.max_brightness = 200,
558558
.dft_brightness = 100,
559-
.enable_gpio = -1,
560559
};
561560

562561
static struct platform_device backlight = {

arch/arm/mach-pxa/lpd270.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ static struct pwm_lookup lpd270_pwm_lookup[] = {
277277
static struct platform_pwm_backlight_data lpd270_backlight_data = {
278278
.max_brightness = 1,
279279
.dft_brightness = 1,
280-
.enable_gpio = -1,
281280
};
282281

283282
static struct platform_device lpd270_backlight_device = {

arch/arm/mach-pxa/magician.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ static void magician_backlight_exit(struct device *dev)
401401
static struct platform_pwm_backlight_data backlight_data = {
402402
.max_brightness = 272,
403403
.dft_brightness = 100,
404-
.enable_gpio = -1,
405404
.init = magician_backlight_init,
406405
.notify = magician_backlight_notify,
407406
.exit = magician_backlight_exit,

arch/arm/mach-pxa/mainstone.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ static struct pwm_lookup mainstone_pwm_lookup[] = {
256256
static struct platform_pwm_backlight_data mainstone_backlight_data = {
257257
.max_brightness = 1023,
258258
.dft_brightness = 1023,
259-
.enable_gpio = -1,
260259
};
261260

262261
static struct platform_device mainstone_backlight_device = {

arch/arm/mach-pxa/mioa701.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ static struct pwm_lookup mioa701_pwm_lookup[] = {
176176
static struct platform_pwm_backlight_data mioa701_backlight_data = {
177177
.max_brightness = 100,
178178
.dft_brightness = 50,
179-
.enable_gpio = -1,
180179
};
181180

182181
/*

arch/arm/mach-pxa/palm27x.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ static void palm27x_backlight_exit(struct device *dev)
318318
static struct platform_pwm_backlight_data palm27x_backlight_data = {
319319
.max_brightness = 0xfe,
320320
.dft_brightness = 0x7e,
321-
.enable_gpio = -1,
322321
.init = palm27x_backlight_init,
323322
.notify = palm27x_backlight_notify,
324323
.exit = palm27x_backlight_exit,

arch/arm/mach-pxa/palmtc.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,15 @@ static inline void palmtc_keys_init(void) {}
174174
* Backlight
175175
******************************************************************************/
176176
#if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE)
177+
178+
static struct gpiod_lookup_table palmtc_pwm_bl_gpio_table = {
179+
.dev_id = "pwm-backlight.0",
180+
.table = {
181+
GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMTC_BL_POWER,
182+
"enable", GPIO_ACTIVE_HIGH),
183+
},
184+
};
185+
177186
static struct pwm_lookup palmtc_pwm_lookup[] = {
178187
PWM_LOOKUP("pxa25x-pwm.1", 0, "pwm-backlight.0", NULL, PALMTC_PERIOD_NS,
179188
PWM_POLARITY_NORMAL),
@@ -182,7 +191,6 @@ static struct pwm_lookup palmtc_pwm_lookup[] = {
182191
static struct platform_pwm_backlight_data palmtc_backlight_data = {
183192
.max_brightness = PALMTC_MAX_INTENSITY,
184193
.dft_brightness = PALMTC_MAX_INTENSITY,
185-
.enable_gpio = GPIO_NR_PALMTC_BL_POWER,
186194
};
187195

188196
static struct platform_device palmtc_backlight = {
@@ -195,6 +203,7 @@ static struct platform_device palmtc_backlight = {
195203

196204
static void __init palmtc_pwm_init(void)
197205
{
206+
gpiod_add_lookup_table(&palmtc_pwm_bl_gpio_table);
198207
pwm_add_table(palmtc_pwm_lookup, ARRAY_SIZE(palmtc_pwm_lookup));
199208
platform_device_register(&palmtc_backlight);
200209
}

0 commit comments

Comments
 (0)