@@ -532,22 +532,24 @@ static struct gpiod_lookup_table spitz_ads7846_gpio_table = {
532
532
},
533
533
};
534
534
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
+ { }
542
541
};
543
542
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" ,
551
553
};
552
554
553
555
static struct corgi_lcd_platform_data spitz_lcdcon_info = {
@@ -572,6 +574,7 @@ static struct spi_board_info spitz_spi_devices[] = {
572
574
.bus_num = 2 ,
573
575
.chip_select = 1 ,
574
576
.platform_data = & spitz_lcdcon_info ,
577
+ .swnode = & spitz_lcdcon_node ,
575
578
}, {
576
579
.modalias = "max1111" ,
577
580
.max_speed_hz = 450000 ,
@@ -606,11 +609,6 @@ static void __init spitz_spi_init(void)
606
609
struct platform_device * pd ;
607
610
int err ;
608
611
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
-
614
612
gpiod_add_lookup_table (& spitz_ads7846_gpio_table );
615
613
616
614
pd = platform_device_register_full (& spitz_spi_device_info );
@@ -619,6 +617,8 @@ static void __init spitz_spi_init(void)
619
617
pr_err ("pxa2xx-spi: failed to instantiate SPI controller: %d\n" ,
620
618
err );
621
619
620
+ spitz_lcdcon_node .properties = machine_is_akita () ?
621
+ akita_lcdcon_props : spitz_lcdcon_props ;
622
622
spi_register_board_info (ARRAY_AND_SIZE (spitz_spi_devices ));
623
623
}
624
624
#else
0 commit comments