Skip to content

Commit c5cdb92

Browse files
linuswarndb
authored andcommitted
ARM: pxa2xx: Fix GPIO descriptor tables
Laurence reports: "Kernel >5.18 on Zaurus has a bug where the power management code can't talk to devices, emitting the following errors: sharpsl-pm sharpsl-pm: Error: AC check failed: voltage -22. sharpsl-pm sharpsl-pm: Charging Error! sharpsl-pm sharpsl-pm: Warning: Cannot read main battery! Looking at the recent changes, I found that commit 31455bb ("spi: pxa2xx_spi: Convert to use GPIO descriptors") replaced the deprecated SPI chip select platform device code with a gpiod lookup table. However, this didn't seem to work until I changed the `dev_id` member from the device name to the bus id. I'm not entirely sure why this is necessary, but I suspect it is related to the fact that in sysfs SPI devices are attached under /sys/devices/.../dev_name/spi_master/spiB/spiB.C, rather than directly to the device." After reviewing the change I conclude that the same fix is needed for all affected boards. Fixes: 31455bb ("spi: pxa2xx_spi: Convert to use GPIO descriptors") Reported-by: Laurence de Bruxelles <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]' Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 430d31b commit c5cdb92

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

arch/arm/mach-pxa/corgi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ static struct pxa2xx_spi_controller corgi_spi_info = {
549549
};
550550

551551
static struct gpiod_lookup_table corgi_spi_gpio_table = {
552-
.dev_id = "pxa2xx-spi.1",
552+
.dev_id = "spi1",
553553
.table = {
554554
GPIO_LOOKUP_IDX("gpio-pxa", CORGI_GPIO_ADS7846_CS, "cs", 0, GPIO_ACTIVE_LOW),
555555
GPIO_LOOKUP_IDX("gpio-pxa", CORGI_GPIO_LCDCON_CS, "cs", 1, GPIO_ACTIVE_LOW),

arch/arm/mach-pxa/hx4700.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ static struct pxa2xx_spi_controller pxa_ssp2_master_info = {
635635
};
636636

637637
static struct gpiod_lookup_table pxa_ssp2_gpio_table = {
638-
.dev_id = "pxa2xx-spi.2",
638+
.dev_id = "spi2",
639639
.table = {
640640
GPIO_LOOKUP_IDX("gpio-pxa", GPIO88_HX4700_TSC2046_CS, "cs", 0, GPIO_ACTIVE_LOW),
641641
{ },

arch/arm/mach-pxa/icontrol.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ struct platform_device pxa_spi_ssp4 = {
140140
};
141141

142142
static struct gpiod_lookup_table pxa_ssp3_gpio_table = {
143-
.dev_id = "pxa2xx-spi.3",
143+
.dev_id = "spi3",
144144
.table = {
145145
GPIO_LOOKUP_IDX("gpio-pxa", ICONTROL_MCP251x_nCS1, "cs", 0, GPIO_ACTIVE_LOW),
146146
GPIO_LOOKUP_IDX("gpio-pxa", ICONTROL_MCP251x_nCS2, "cs", 1, GPIO_ACTIVE_LOW),
@@ -149,7 +149,7 @@ static struct gpiod_lookup_table pxa_ssp3_gpio_table = {
149149
};
150150

151151
static struct gpiod_lookup_table pxa_ssp4_gpio_table = {
152-
.dev_id = "pxa2xx-spi.4",
152+
.dev_id = "spi4",
153153
.table = {
154154
GPIO_LOOKUP_IDX("gpio-pxa", ICONTROL_MCP251x_nCS3, "cs", 0, GPIO_ACTIVE_LOW),
155155
GPIO_LOOKUP_IDX("gpio-pxa", ICONTROL_MCP251x_nCS4, "cs", 1, GPIO_ACTIVE_LOW),

arch/arm/mach-pxa/littleton.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static struct spi_board_info littleton_spi_devices[] __initdata = {
207207
};
208208

209209
static struct gpiod_lookup_table littleton_spi_gpio_table = {
210-
.dev_id = "pxa2xx-spi.2",
210+
.dev_id = "spi2",
211211
.table = {
212212
GPIO_LOOKUP_IDX("gpio-pxa", LITTLETON_GPIO_LCD_CS, "cs", 0, GPIO_ACTIVE_LOW),
213213
{ },

arch/arm/mach-pxa/magician.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ static struct pxa2xx_spi_controller magician_spi_info = {
994994
};
995995

996996
static struct gpiod_lookup_table magician_spi_gpio_table = {
997-
.dev_id = "pxa2xx-spi.2",
997+
.dev_id = "spi2",
998998
.table = {
999999
/* NOTICE must be GPIO, incompatibility with hw PXA SPI framing */
10001000
GPIO_LOOKUP_IDX("gpio-pxa", GPIO14_MAGICIAN_TSC2046_CS, "cs", 0, GPIO_ACTIVE_LOW),

arch/arm/mach-pxa/spitz.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ static struct pxa2xx_spi_controller spitz_spi_info = {
578578
};
579579

580580
static struct gpiod_lookup_table spitz_spi_gpio_table = {
581-
.dev_id = "pxa2xx-spi.2",
581+
.dev_id = "spi2",
582582
.table = {
583583
GPIO_LOOKUP_IDX("gpio-pxa", SPITZ_GPIO_ADS7846_CS, "cs", 0, GPIO_ACTIVE_LOW),
584584
GPIO_LOOKUP_IDX("gpio-pxa", SPITZ_GPIO_LCDCON_CS, "cs", 1, GPIO_ACTIVE_LOW),

arch/arm/mach-pxa/z2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,15 +623,15 @@ static struct pxa2xx_spi_controller pxa_ssp2_master_info = {
623623
};
624624

625625
static struct gpiod_lookup_table pxa_ssp1_gpio_table = {
626-
.dev_id = "pxa2xx-spi.1",
626+
.dev_id = "spi1",
627627
.table = {
628628
GPIO_LOOKUP_IDX("gpio-pxa", GPIO24_ZIPITZ2_WIFI_CS, "cs", 0, GPIO_ACTIVE_LOW),
629629
{ },
630630
},
631631
};
632632

633633
static struct gpiod_lookup_table pxa_ssp2_gpio_table = {
634-
.dev_id = "pxa2xx-spi.2",
634+
.dev_id = "spi2",
635635
.table = {
636636
GPIO_LOOKUP_IDX("gpio-pxa", GPIO88_ZIPITZ2_LCD_CS, "cs", 0, GPIO_ACTIVE_LOW),
637637
{ },

0 commit comments

Comments
 (0)