Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: pxa2xx_spi: Convert to use GPIO descriptors

This converts the PXA2xx SPI driver to use GPIO descriptors
exclusively to retrieve GPIO chip select lines.

The device tree and ACPI paths of the driver already use
descriptors, hence ->use_gpio_descriptors is already set and
this codepath is well tested.

Convert all the PXA boards providing chip select GPIOs as
platform data and drop the old GPIO chipselect handling in
favor of the core managing it exclusively.

Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Daniel Mack <daniel@zonque.org>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: linux-arm-kernel@lists.infradead.org
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20220125005836.494807-1-linus.walleij@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Linus Walleij and committed by
Mark Brown
31455bbd 20dc69ca

+117 -114
-3
Documentation/spi/pxa2xx.rst
··· 101 101 u8 rx_threshold; 102 102 u8 dma_burst_size; 103 103 u32 timeout; 104 - int gpio_cs; 105 104 }; 106 105 107 106 The "pxa2xx_spi_chip.tx_threshold" and "pxa2xx_spi_chip.rx_threshold" fields are ··· 145 146 .rx_threshold = 8, /* SSP hardward FIFO threshold */ 146 147 .dma_burst_size = 8, /* Byte wide transfers used so 8 byte bursts */ 147 148 .timeout = 235, /* See Intel documentation */ 148 - .gpio_cs = 2, /* Use external chip select */ 149 149 }; 150 150 151 151 static struct pxa2xx_spi_chip cs8405a_chip_info = { ··· 152 154 .rx_threshold = 8, /* SSP hardward FIFO threshold */ 153 155 .dma_burst_size = 8, /* Byte wide transfers used so 8 byte bursts */ 154 156 .timeout = 235, /* See Intel documentation */ 155 - .gpio_cs = 3, /* Use external chip select */ 156 157 }; 157 158 158 159 static struct spi_board_info streetracer_spi_board_info[] __initdata = {
+11 -15
arch/arm/mach-pxa/corgi.c
··· 530 530 .num_chipselect = 3, 531 531 }; 532 532 533 + static struct gpiod_lookup_table corgi_spi_gpio_table = { 534 + .dev_id = "pxa2xx-spi.1", 535 + .table = { 536 + GPIO_LOOKUP_IDX("gpio-pxa", CORGI_GPIO_ADS7846_CS, "cs", 0, GPIO_ACTIVE_LOW), 537 + GPIO_LOOKUP_IDX("gpio-pxa", CORGI_GPIO_LCDCON_CS, "cs", 1, GPIO_ACTIVE_LOW), 538 + GPIO_LOOKUP_IDX("gpio-pxa", CORGI_GPIO_MAX1111_CS, "cs", 2, GPIO_ACTIVE_LOW), 539 + { }, 540 + }, 541 + }; 542 + 533 543 static void corgi_wait_for_hsync(void) 534 544 { 535 545 while (gpio_get_value(CORGI_GPIO_HSYNC)) ··· 556 546 .y_plate_ohms = 486, 557 547 .gpio_pendown = CORGI_GPIO_TP_INT, 558 548 .wait_for_sync = corgi_wait_for_hsync, 559 - }; 560 - 561 - static struct pxa2xx_spi_chip corgi_ads7846_chip = { 562 - .gpio_cs = CORGI_GPIO_ADS7846_CS, 563 549 }; 564 550 565 551 static void corgi_bl_kick_battery(void) ··· 586 580 .kick_battery = corgi_bl_kick_battery, 587 581 }; 588 582 589 - static struct pxa2xx_spi_chip corgi_lcdcon_chip = { 590 - .gpio_cs = CORGI_GPIO_LCDCON_CS, 591 - }; 592 - 593 - static struct pxa2xx_spi_chip corgi_max1111_chip = { 594 - .gpio_cs = CORGI_GPIO_MAX1111_CS, 595 - }; 596 - 597 583 static struct spi_board_info corgi_spi_devices[] = { 598 584 { 599 585 .modalias = "ads7846", ··· 593 595 .bus_num = 1, 594 596 .chip_select = 0, 595 597 .platform_data = &corgi_ads7846_info, 596 - .controller_data= &corgi_ads7846_chip, 597 598 .irq = PXA_GPIO_TO_IRQ(CORGI_GPIO_TP_INT), 598 599 }, { 599 600 .modalias = "corgi-lcd", ··· 600 603 .bus_num = 1, 601 604 .chip_select = 1, 602 605 .platform_data = &corgi_lcdcon_info, 603 - .controller_data= &corgi_lcdcon_chip, 604 606 }, { 605 607 .modalias = "max1111", 606 608 .max_speed_hz = 450000, 607 609 .bus_num = 1, 608 610 .chip_select = 2, 609 - .controller_data= &corgi_max1111_chip, 610 611 }, 611 612 }; 612 613 613 614 static void __init corgi_init_spi(void) 614 615 { 616 + gpiod_add_lookup_table(&corgi_spi_gpio_table); 615 617 pxa2xx_set_spi_info(1, &corgi_spi_info); 616 618 gpiod_add_lookup_table(&corgi_lcdcon_gpio_table); 617 619 spi_register_board_info(ARRAY_AND_SIZE(corgi_spi_devices));
+9 -1
arch/arm/mach-pxa/hx4700.c
··· 616 616 .tx_threshold = 1, 617 617 .rx_threshold = 2, 618 618 .timeout = 64, 619 - .gpio_cs = GPIO88_HX4700_TSC2046_CS, 620 619 }; 621 620 622 621 static struct spi_board_info tsc2046_board_info[] __initdata = { ··· 632 633 static struct pxa2xx_spi_controller pxa_ssp2_master_info = { 633 634 .num_chipselect = 1, 634 635 .enable_dma = 1, 636 + }; 637 + 638 + static struct gpiod_lookup_table pxa_ssp2_gpio_table = { 639 + .dev_id = "pxa2xx-spi.2", 640 + .table = { 641 + GPIO_LOOKUP_IDX("gpio-pxa", GPIO88_HX4700_TSC2046_CS, "cs", 0, GPIO_ACTIVE_LOW), 642 + { }, 643 + }, 635 644 }; 636 645 637 646 /* ··· 903 896 pxa_set_i2c_info(NULL); 904 897 i2c_register_board_info(0, ARRAY_AND_SIZE(i2c_board_info)); 905 898 i2c_register_board_info(1, ARRAY_AND_SIZE(pi2c_board_info)); 899 + gpiod_add_lookup_table(&pxa_ssp2_gpio_table); 906 900 pxa2xx_set_spi_info(2, &pxa_ssp2_master_info); 907 901 spi_register_board_info(ARRAY_AND_SIZE(tsc2046_board_info)); 908 902
+21 -5
arch/arm/mach-pxa/icontrol.c
··· 13 13 #include <linux/irq.h> 14 14 #include <linux/platform_device.h> 15 15 #include <linux/property.h> 16 - #include <linux/gpio.h> 16 + #include <linux/gpio/machine.h> 17 17 18 18 #include <asm/mach-types.h> 19 19 #include <asm/mach/arch.h> ··· 42 42 .rx_threshold = 128, 43 43 .dma_burst_size = 8, 44 44 .timeout = 235, 45 - .gpio_cs = ICONTROL_MCP251x_nCS1 46 45 }; 47 46 48 47 static struct pxa2xx_spi_chip mcp251x_chip_info2 = { ··· 49 50 .rx_threshold = 128, 50 51 .dma_burst_size = 8, 51 52 .timeout = 235, 52 - .gpio_cs = ICONTROL_MCP251x_nCS2 53 53 }; 54 54 55 55 static struct pxa2xx_spi_chip mcp251x_chip_info3 = { ··· 56 58 .rx_threshold = 128, 57 59 .dma_burst_size = 8, 58 60 .timeout = 235, 59 - .gpio_cs = ICONTROL_MCP251x_nCS3 60 61 }; 61 62 62 63 static struct pxa2xx_spi_chip mcp251x_chip_info4 = { ··· 63 66 .rx_threshold = 128, 64 67 .dma_burst_size = 8, 65 68 .timeout = 235, 66 - .gpio_cs = ICONTROL_MCP251x_nCS4 67 69 }; 68 70 69 71 static const struct property_entry mcp251x_properties[] = { ··· 139 143 } 140 144 }; 141 145 146 + static struct gpiod_lookup_table pxa_ssp3_gpio_table = { 147 + .dev_id = "pxa2xx-spi.3", 148 + .table = { 149 + GPIO_LOOKUP_IDX("gpio-pxa", ICONTROL_MCP251x_nCS1, "cs", 0, GPIO_ACTIVE_LOW), 150 + GPIO_LOOKUP_IDX("gpio-pxa", ICONTROL_MCP251x_nCS2, "cs", 1, GPIO_ACTIVE_LOW), 151 + { }, 152 + }, 153 + }; 154 + 155 + static struct gpiod_lookup_table pxa_ssp4_gpio_table = { 156 + .dev_id = "pxa2xx-spi.4", 157 + .table = { 158 + GPIO_LOOKUP_IDX("gpio-pxa", ICONTROL_MCP251x_nCS3, "cs", 0, GPIO_ACTIVE_LOW), 159 + GPIO_LOOKUP_IDX("gpio-pxa", ICONTROL_MCP251x_nCS4, "cs", 1, GPIO_ACTIVE_LOW), 160 + { }, 161 + }, 162 + }; 163 + 142 164 static struct platform_device *icontrol_spi_devices[] __initdata = { 143 165 &pxa_spi_ssp3, 144 166 &pxa_spi_ssp4, ··· 189 175 static void __init icontrol_can_init(void) 190 176 { 191 177 pxa3xx_mfp_config(ARRAY_AND_SIZE(mfp_can_cfg)); 178 + gpiod_add_lookup_table(&pxa_ssp3_gpio_table); 179 + gpiod_add_lookup_table(&pxa_ssp4_gpio_table); 192 180 platform_add_devices(ARRAY_AND_SIZE(icontrol_spi_devices)); 193 181 spi_register_board_info(ARRAY_AND_SIZE(mcp251x_board_info)); 194 182 }
+9 -1
arch/arm/mach-pxa/littleton.c
··· 195 195 static struct pxa2xx_spi_chip littleton_tdo24m_chip = { 196 196 .rx_threshold = 1, 197 197 .tx_threshold = 1, 198 - .gpio_cs = LITTLETON_GPIO_LCD_CS, 199 198 }; 200 199 201 200 static struct spi_board_info littleton_spi_devices[] __initdata = { ··· 207 208 }, 208 209 }; 209 210 211 + static struct gpiod_lookup_table littleton_spi_gpio_table = { 212 + .dev_id = "pxa2xx-spi.2", 213 + .table = { 214 + GPIO_LOOKUP_IDX("gpio-pxa", LITTLETON_GPIO_LCD_CS, "cs", 0, GPIO_ACTIVE_LOW), 215 + { }, 216 + }, 217 + }; 218 + 210 219 static void __init littleton_init_spi(void) 211 220 { 221 + gpiod_add_lookup_table(&littleton_spi_gpio_table); 212 222 pxa2xx_set_spi_info(2, &littleton_spi_info); 213 223 spi_register_board_info(ARRAY_AND_SIZE(littleton_spi_devices)); 214 224 }
+10 -2
arch/arm/mach-pxa/magician.c
··· 938 938 .tx_threshold = 1, 939 939 .rx_threshold = 2, 940 940 .timeout = 64, 941 - /* NOTICE must be GPIO, incompatibility with hw PXA SPI framing */ 942 - .gpio_cs = GPIO14_MAGICIAN_TSC2046_CS, 943 941 }; 944 942 945 943 static struct pxa2xx_spi_controller magician_spi_info = { 946 944 .num_chipselect = 1, 947 945 .enable_dma = 1, 946 + }; 947 + 948 + static struct gpiod_lookup_table magician_spi_gpio_table = { 949 + .dev_id = "pxa2xx-spi.2", 950 + .table = { 951 + /* NOTICE must be GPIO, incompatibility with hw PXA SPI framing */ 952 + GPIO_LOOKUP_IDX("gpio-pxa", GPIO14_MAGICIAN_TSC2046_CS, "cs", 0, GPIO_ACTIVE_LOW), 953 + { }, 954 + }, 948 955 }; 949 956 950 957 static struct spi_board_info ads7846_spi_board_info[] __initdata = { ··· 1038 1031 } else 1039 1032 pr_err("LCD detection: CPLD mapping failed\n"); 1040 1033 1034 + gpiod_add_lookup_table(&magician_spi_gpio_table); 1041 1035 pxa2xx_set_spi_info(2, &magician_spi_info); 1042 1036 spi_register_board_info(ARRAY_AND_SIZE(ads7846_spi_board_info)); 1043 1037
+9 -5
arch/arm/mach-pxa/poodle.c
··· 197 197 .num_chipselect = 1, 198 198 }; 199 199 200 + static struct gpiod_lookup_table poodle_spi_gpio_table = { 201 + .dev_id = "pxa2xx-spi.1", 202 + .table = { 203 + GPIO_LOOKUP_IDX("gpio-pxa", POODLE_GPIO_TP_CS, "cs", 0, GPIO_ACTIVE_LOW), 204 + { }, 205 + }, 206 + }; 207 + 200 208 static struct ads7846_platform_data poodle_ads7846_info = { 201 209 .model = 7846, 202 210 .vref_delay_usecs = 100, ··· 213 205 .gpio_pendown = POODLE_GPIO_TP_INT, 214 206 }; 215 207 216 - static struct pxa2xx_spi_chip poodle_ads7846_chip = { 217 - .gpio_cs = POODLE_GPIO_TP_CS, 218 - }; 219 - 220 208 static struct spi_board_info poodle_spi_devices[] = { 221 209 { 222 210 .modalias = "ads7846", 223 211 .max_speed_hz = 10000, 224 212 .bus_num = 1, 225 213 .platform_data = &poodle_ads7846_info, 226 - .controller_data= &poodle_ads7846_chip, 227 214 .irq = PXA_GPIO_TO_IRQ(POODLE_GPIO_TP_INT), 228 215 }, 229 216 }; 230 217 231 218 static void __init poodle_init_spi(void) 232 219 { 220 + gpiod_add_lookup_table(&poodle_spi_gpio_table); 233 221 pxa2xx_set_spi_info(1, &poodle_spi_info); 234 222 spi_register_board_info(ARRAY_AND_SIZE(poodle_spi_devices)); 235 223 }
+11 -15
arch/arm/mach-pxa/spitz.c
··· 510 510 .wait_for_sync = spitz_ads7846_wait_for_hsync, 511 511 }; 512 512 513 - static struct pxa2xx_spi_chip spitz_ads7846_chip = { 514 - .gpio_cs = SPITZ_GPIO_ADS7846_CS, 515 - }; 516 - 517 513 static void spitz_bl_kick_battery(void) 518 514 { 519 515 void (*kick_batt)(void); ··· 551 555 .kick_battery = spitz_bl_kick_battery, 552 556 }; 553 557 554 - static struct pxa2xx_spi_chip spitz_lcdcon_chip = { 555 - .gpio_cs = SPITZ_GPIO_LCDCON_CS, 556 - }; 557 - 558 - static struct pxa2xx_spi_chip spitz_max1111_chip = { 559 - .gpio_cs = SPITZ_GPIO_MAX1111_CS, 560 - }; 561 - 562 558 static struct spi_board_info spitz_spi_devices[] = { 563 559 { 564 560 .modalias = "ads7846", ··· 558 570 .bus_num = 2, 559 571 .chip_select = 0, 560 572 .platform_data = &spitz_ads7846_info, 561 - .controller_data = &spitz_ads7846_chip, 562 573 .irq = PXA_GPIO_TO_IRQ(SPITZ_GPIO_TP_INT), 563 574 }, { 564 575 .modalias = "corgi-lcd", ··· 565 578 .bus_num = 2, 566 579 .chip_select = 1, 567 580 .platform_data = &spitz_lcdcon_info, 568 - .controller_data = &spitz_lcdcon_chip, 569 581 }, { 570 582 .modalias = "max1111", 571 583 .max_speed_hz = 450000, 572 584 .bus_num = 2, 573 585 .chip_select = 2, 574 - .controller_data = &spitz_max1111_chip, 575 586 }, 576 587 }; 577 588 578 589 static struct pxa2xx_spi_controller spitz_spi_info = { 579 590 .num_chipselect = 3, 591 + }; 592 + 593 + static struct gpiod_lookup_table spitz_spi_gpio_table = { 594 + .dev_id = "pxa2xx-spi.2", 595 + .table = { 596 + GPIO_LOOKUP_IDX("gpio-pxa", SPITZ_GPIO_ADS7846_CS, "cs", 0, GPIO_ACTIVE_LOW), 597 + GPIO_LOOKUP_IDX("gpio-pxa", SPITZ_GPIO_LCDCON_CS, "cs", 1, GPIO_ACTIVE_LOW), 598 + GPIO_LOOKUP_IDX("gpio-pxa", SPITZ_GPIO_MAX1111_CS, "cs", 2, GPIO_ACTIVE_LOW), 599 + { }, 600 + }, 580 601 }; 581 602 582 603 static void __init spitz_spi_init(void) ··· 594 599 else 595 600 gpiod_add_lookup_table(&spitz_lcdcon_gpio_table); 596 601 602 + gpiod_add_lookup_table(&spitz_spi_gpio_table); 597 603 pxa2xx_set_spi_info(2, &spitz_spi_info); 598 604 spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices)); 599 605 }
+18 -2
arch/arm/mach-pxa/stargate2.c
··· 346 346 .num_chipselect = 1, 347 347 }; 348 348 349 + static struct gpiod_lookup_table pxa_ssp1_gpio_table = { 350 + .dev_id = "pxa2xx-spi.1", 351 + .table = { 352 + GPIO_LOOKUP_IDX("gpio-pxa", 24, "cs", 0, GPIO_ACTIVE_LOW), 353 + { }, 354 + }, 355 + }; 356 + 357 + static struct gpiod_lookup_table pxa_ssp3_gpio_table = { 358 + .dev_id = "pxa2xx-spi.3", 359 + .table = { 360 + GPIO_LOOKUP_IDX("gpio-pxa", 39, "cs", 0, GPIO_ACTIVE_LOW), 361 + { }, 362 + }, 363 + }; 364 + 349 365 /* An upcoming kernel change will scrap SFRM usage so these 350 366 * drivers have been moved to use GPIOs */ 351 367 static struct pxa2xx_spi_chip staccel_chip_info = { ··· 369 353 .rx_threshold = 8, 370 354 .dma_burst_size = 8, 371 355 .timeout = 235, 372 - .gpio_cs = 24, 373 356 }; 374 357 375 358 static struct pxa2xx_spi_chip cc2420_info = { ··· 376 361 .rx_threshold = 8, 377 362 .dma_burst_size = 8, 378 363 .timeout = 235, 379 - .gpio_cs = 39, 380 364 }; 381 365 382 366 static struct spi_board_info spi_board_info[] __initdata = { ··· 424 410 pxa_set_btuart_info(NULL); 425 411 pxa_set_stuart_info(NULL); 426 412 413 + gpiod_add_lookup_table(&pxa_ssp1_gpio_table); 414 + gpiod_add_lookup_table(&pxa_ssp3_gpio_table); 427 415 pxa2xx_set_spi_info(1, &pxa_ssp_master_0_info); 428 416 pxa2xx_set_spi_info(2, &pxa_ssp_master_1_info); 429 417 pxa2xx_set_spi_info(3, &pxa_ssp_master_2_info);
+18 -2
arch/arm/mach-pxa/z2.c
··· 570 570 .rx_threshold = 8, 571 571 .tx_threshold = 8, 572 572 .timeout = 1000, 573 - .gpio_cs = GPIO24_ZIPITZ2_WIFI_CS, 574 573 }; 575 574 576 575 static struct libertas_spi_platform_data z2_lbs_pdata = { ··· 583 584 .rx_threshold = 1, 584 585 .tx_threshold = 1, 585 586 .timeout = 64, 586 - .gpio_cs = GPIO88_ZIPITZ2_LCD_CS, 587 587 }; 588 588 589 589 static struct gpiod_lookup_table lms283_gpio_table = { ··· 622 624 .num_chipselect = 1, 623 625 }; 624 626 627 + static struct gpiod_lookup_table pxa_ssp1_gpio_table = { 628 + .dev_id = "pxa2xx-spi.1", 629 + .table = { 630 + GPIO_LOOKUP_IDX("gpio-pxa", GPIO24_ZIPITZ2_WIFI_CS, "cs", 0, GPIO_ACTIVE_LOW), 631 + { }, 632 + }, 633 + }; 634 + 635 + static struct gpiod_lookup_table pxa_ssp2_gpio_table = { 636 + .dev_id = "pxa2xx-spi.2", 637 + .table = { 638 + GPIO_LOOKUP_IDX("gpio-pxa", GPIO88_ZIPITZ2_LCD_CS, "cs", 0, GPIO_ACTIVE_LOW), 639 + { }, 640 + }, 641 + }; 642 + 625 643 static void __init z2_spi_init(void) 626 644 { 645 + gpiod_add_lookup_table(&pxa_ssp1_gpio_table); 646 + gpiod_add_lookup_table(&pxa_ssp2_gpio_table); 627 647 pxa2xx_set_spi_info(1, &pxa_ssp1_master_info); 628 648 pxa2xx_set_spi_info(2, &pxa_ssp2_master_info); 629 649 gpiod_add_lookup_table(&lms283_gpio_table);
+1 -62
drivers/spi/spi-pxa2xx.c
··· 13 13 #include <linux/err.h> 14 14 #include <linux/errno.h> 15 15 #include <linux/gpio/consumer.h> 16 - #include <linux/gpio.h> 17 16 #include <linux/init.h> 18 17 #include <linux/interrupt.h> 19 18 #include <linux/ioport.h> ··· 1162 1163 return 0; 1163 1164 } 1164 1165 1165 - static void cleanup_cs(struct spi_device *spi) 1166 - { 1167 - if (!gpio_is_valid(spi->cs_gpio)) 1168 - return; 1169 - 1170 - gpio_free(spi->cs_gpio); 1171 - spi->cs_gpio = -ENOENT; 1172 - } 1173 - 1174 - static int setup_cs(struct spi_device *spi, struct chip_data *chip, 1175 - struct pxa2xx_spi_chip *chip_info) 1176 - { 1177 - struct driver_data *drv_data = spi_controller_get_devdata(spi->controller); 1178 - 1179 - if (chip == NULL) 1180 - return 0; 1181 - 1182 - if (chip_info == NULL) 1183 - return 0; 1184 - 1185 - if (drv_data->ssp_type == CE4100_SSP) 1186 - return 0; 1187 - 1188 - /* 1189 - * NOTE: setup() can be called multiple times, possibly with 1190 - * different chip_info, release previously requested GPIO. 1191 - */ 1192 - cleanup_cs(spi); 1193 - 1194 - if (gpio_is_valid(chip_info->gpio_cs)) { 1195 - int gpio = chip_info->gpio_cs; 1196 - int err; 1197 - 1198 - err = gpio_request(gpio, "SPI_CS"); 1199 - if (err) { 1200 - dev_err(&spi->dev, "failed to request chip select GPIO%d\n", gpio); 1201 - return err; 1202 - } 1203 - 1204 - err = gpio_direction_output(gpio, !(spi->mode & SPI_CS_HIGH)); 1205 - if (err) { 1206 - gpio_free(gpio); 1207 - return err; 1208 - } 1209 - 1210 - spi->cs_gpio = gpio; 1211 - } 1212 - 1213 - return 0; 1214 - } 1215 - 1216 1166 static int setup(struct spi_device *spi) 1217 1167 { 1218 1168 struct pxa2xx_spi_chip *chip_info; ··· 1170 1222 struct driver_data *drv_data = 1171 1223 spi_controller_get_devdata(spi->controller); 1172 1224 uint tx_thres, tx_hi_thres, rx_thres; 1173 - int err; 1174 1225 1175 1226 switch (drv_data->ssp_type) { 1176 1227 case QUARK_X1000_SSP: ··· 1312 1365 1313 1366 spi_set_ctldata(spi, chip); 1314 1367 1315 - if (drv_data->ssp_type == CE4100_SSP) 1316 - return 0; 1317 - 1318 - err = setup_cs(spi, chip, chip_info); 1319 - if (err) 1320 - kfree(chip); 1321 - 1322 - return err; 1368 + return 0; 1323 1369 } 1324 1370 1325 1371 static void cleanup(struct spi_device *spi) 1326 1372 { 1327 1373 struct chip_data *chip = spi_get_ctldata(spi); 1328 1374 1329 - cleanup_cs(spi); 1330 1375 kfree(chip); 1331 1376 } 1332 1377
-1
include/linux/spi/pxa2xx_spi.h
··· 42 42 u8 rx_threshold; 43 43 u8 dma_burst_size; 44 44 u32 timeout; 45 - int gpio_cs; 46 45 }; 47 46 48 47 #if defined(CONFIG_ARCH_PXA) || defined(CONFIG_ARCH_MMP)