@@ -532,22 +532,24 @@ static struct gpiod_lookup_table spitz_ads7846_gpio_table = {
532532 },
533533};
534534
535- static struct gpiod_lookup_table spitz_lcdcon_gpio_table = {
536- .dev_id = "spi2.1" ,
537- .table = {
538- GPIO_LOOKUP ("sharp-scoop.1" , 6 , "BL_CONT" , GPIO_ACTIVE_LOW ),
539- GPIO_LOOKUP ("sharp-scoop.1" , 7 , "BL_ON" , GPIO_ACTIVE_HIGH ),
540- { },
541- },
535+ static const struct property_entry spitz_lcdcon_props [] = {
536+ PROPERTY_ENTRY_GPIO ("BL_CONT-gpios" ,
537+ & spitz_scoop_2_gpiochip_node , 6 , GPIO_ACTIVE_LOW ),
538+ PROPERTY_ENTRY_GPIO ("BL_ON-gpios" ,
539+ & spitz_scoop_2_gpiochip_node , 7 , GPIO_ACTIVE_HIGH ),
540+ { }
542541};
543542
544- static struct gpiod_lookup_table akita_lcdcon_gpio_table = {
545- .dev_id = "spi2.1" ,
546- .table = {
547- GPIO_LOOKUP ("i2c-max7310" , 3 , "BL_ON" , GPIO_ACTIVE_HIGH ),
548- GPIO_LOOKUP ("i2c-max7310" , 4 , "BL_CONT" , GPIO_ACTIVE_LOW ),
549- { },
550- },
543+ static const struct property_entry akita_lcdcon_props [] = {
544+ PROPERTY_ENTRY_GPIO ("BL_ON-gpios" ,
545+ & akita_max7310_gpiochip_node , 3 , GPIO_ACTIVE_HIGH ),
546+ PROPERTY_ENTRY_GPIO ("BL_CONT-gpios" ,
547+ & akita_max7310_gpiochip_node , 4 , GPIO_ACTIVE_LOW ),
548+ { }
549+ };
550+
551+ static struct software_node spitz_lcdcon_node = {
552+ .name = "spitz-lcdcon" ,
551553};
552554
553555static struct corgi_lcd_platform_data spitz_lcdcon_info = {
@@ -572,6 +574,7 @@ static struct spi_board_info spitz_spi_devices[] = {
572574 .bus_num = 2 ,
573575 .chip_select = 1 ,
574576 .platform_data = & spitz_lcdcon_info ,
577+ .swnode = & spitz_lcdcon_node ,
575578 }, {
576579 .modalias = "max1111" ,
577580 .max_speed_hz = 450000 ,
@@ -606,11 +609,6 @@ static void __init spitz_spi_init(void)
606609 struct platform_device * pd ;
607610 int err ;
608611
609- if (machine_is_akita ())
610- gpiod_add_lookup_table (& akita_lcdcon_gpio_table );
611- else
612- gpiod_add_lookup_table (& spitz_lcdcon_gpio_table );
613-
614612 gpiod_add_lookup_table (& spitz_ads7846_gpio_table );
615613
616614 pd = platform_device_register_full (& spitz_spi_device_info );
@@ -619,6 +617,8 @@ static void __init spitz_spi_init(void)
619617 pr_err ("pxa2xx-spi: failed to instantiate SPI controller: %d\n" ,
620618 err );
621619
620+ spitz_lcdcon_node .properties = machine_is_akita () ?
621+ akita_lcdcon_props : spitz_lcdcon_props ;
622622 spi_register_board_info (ARRAY_AND_SIZE (spitz_spi_devices ));
623623}
624624#else
0 commit comments