backlight: lms283gf05: Convert to GPIO descriptors
Subsystems (6)
PATCH v7 1/1 backlight: lms283gf05: Convert to GPIO descriptors
This converts the lms283gf05 backlight driver to use GPIO descriptors and switches the single PXA Palm Z2 device over to defining these.
Since the platform data was only used to convey GPIO information we can delete the platform data header.
Notice that we define the proper active low semantics in the board file GPIO descriptor table (active low) and assert the reset line by bringing it to "1" (asserted).
---
ChangeLog v6->v7:
- Rebase onto v5.10-rc1
ChangeLog v5->v6:
- Rebase onto v5.9-rc1
ChangeLog v4->v5:
- Rebase on v5.8-rc1
- Collected Daniel's Reviewed-by tag.
ChangeLog v3->v4:
- Check IS_ERR() on the returned GPIO descriptor.
- Unconditionally set consumer name since the API tolerates NULL. ChangeLog v2->v3:
- Fix a use-before-allocated bug discovered by compile tests.
- Remove unused ret variable as autobuilders complained. ChangeLog v1->v2:
- Bring up the GPIO de-asserted in probe()
Marek: I saw this was written by you, are you regularly testing the Z2 device?
--- arch/arm/mach-pxa/z2.c | 12 +++++--- drivers/video/backlight/lms283gf05.c | 43 +++++++++++----------------- include/linux/spi/lms283gf05.h | 16 ----------- 3 files changed, 25 insertions(+), 46 deletions(-) delete mode 100644 include/linux/spi/lms283gf05.h
arch/arm/mach-pxa/z2.c +8 -4
@@ -20,7 +20,6 @@#include <linux/spi/spi.h> #include <linux/spi/pxa2xx_spi.h> #include <linux/spi/libertas_spi.h> -#include <linux/spi/lms283gf05.h> #include <linux/power_supply.h> #include <linux/mtd/physmap.h> #include <linux/gpio.h>
@@ -578,8 +577,13 @@ static struct pxa2xx_spi_chip lms283_chip_info = { .gpio_cs = GPIO88_ZIPITZ2_LCD_CS, }; -static const struct lms283gf05_pdata lms283_pdata = { - .reset_gpio =GPIO19_ZIPITZ2_LCD_RESET , +static struct gpiod_lookup_table lms283_gpio_table = { + .dev_id ="spi2.0" ,/* SPI bus 2 chip select 0 */ + .table = { +GPIO_LOOKUP ("gpio-pxa" ,GPIO19_ZIPITZ2_LCD_RESET , +"reset" ,GPIO_ACTIVE_LOW ), + { }, + }, };static struct spi_board_info spi_board_info[]__initdata = {
@@ -595,7 +599,6 @@ static struct spi_board_info spi_board_info[] __initdata = { { .modalias = "lms283gf05", .controller_data = &lms283_chip_info, - .platform_data = &lms283_pdata, .max_speed_hz = 400000, .bus_num = 2, .chip_select = 0,
@@ -615,6 +618,7 @@ static void __init z2_spi_init(void) {pxa2xx_set_spi_info (1 , &pxa_ssp1_master_info);pxa2xx_set_spi_info (2 , &pxa_ssp2_master_info); +gpiod_add_lookup_table (&lms283_gpio_table);spi_register_board_info (spi_board_info,ARRAY_SIZE (spi_board_info)); }#else
drivers/video/backlight/lms283gf05.c +17 -26
96 lines not on this page · raw message
include/linux/spi/lms283gf05.h deleted +0 -16
@@ -1,16 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* -* lms283gf05.h - Platform glue for Samsung LMS283GF05 LCD -* -* Copyright (C) 2009 Marek Vasut <[email protected]> -*/ - -#ifndef _INCLUDE_LINUX_SPI_LMS283GF05_H_ -#define _INCLUDE_LINUX_SPI_LMS283GF05_H_ - -struct lms283gf05_pdata { -unsigned long reset_gpio; -bool reset_inverted; -}; - -#endif /* _INCLUDE_LINUX_SPI_LMS283GF05_H_ */
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 34 lines · Linus Walleij
This converts the lms283gf05 backlight driver to use GPIO descriptors and switches the single PXA Palm Z2 device over to defining these.
Since the platform data was only used to convey GPIO information we can delete the platform data header.
Notice that we define the proper active low semantics in the board file GPIO descriptor table (active low) and assert the reset line by bringing it to "1" (asserted).
Cc Marek Vasut <[email protected]>Cc Daniel Mack <[email protected]>Cc Haojian Zhuang <[email protected]>Cc Robert Jarzmik <[email protected]>Reviewed-by Daniel Thompson <[email protected]>Signed-off-by Linus Walleij <[email protected]>---
ChangeLogv6->v7:
- Rebase onto v5.10-rc1
ChangeLogv5->v6:
- Rebase onto v5.9-rc1
ChangeLogv4->v5:
- Rebase on v5.8-rc1
- Collected Daniel's Reviewed-by tag.
ChangeLogv3->v4:
- CheckIS_ERR()on the returned GPIO descriptor.
- Unconditionally set consumer name since the API tolerates NULL. ChangeLogv2->v3:
- Fix a use-before-allocated bug discovered by compile tests.
- Remove unused ret variable as autobuilders complained. ChangeLogv1->v2:
- Bring up the GPIO de-asserted inprobe()
Quoted 2 lines
Marek: I saw this was written by you, are you regularly testing the Z2 device?
No, it has been a very long time since I last used this device.
[...]
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 6 lines · Marek Vasut
Quoted 2 lines · Linus Walleij
Marek: I saw this was written by you, are you regularly testing the Z2 device?
No, it has been a very long time since I last used this device.
OK then I suggest the maintainers just apply it by the token that if a tree falls in the forest and noone is there to hear it, it doesn't make a noise.
The kernel sure looks better after than before.
Yours,
Linus Walleij
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel