Skip to content

Commit c108905

Browse files
andy-shevbroonie
authored andcommitted
spi: gpio: Remove stale documentation part
The SPI GPIO driver doesn't support hard coded absolute GPIO numbers anymore. However, it may still be instantiated from board files with help of GPIO lookup tables or device properties. Neither of this is covered by the old part of the documentation, it's the opposite, i.e. old documentation pretend that antique approach still works. With all this said, remove stale and confusing part of the documentation. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 652ffad commit c108905

File tree

1 file changed

+2
-32
lines changed

1 file changed

+2
-32
lines changed

drivers/spi/spi-gpio.c

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -39,36 +39,8 @@ struct spi_gpio {
3939

4040
/*----------------------------------------------------------------------*/
4141

42-
/*
43-
* Because the overhead of going through four GPIO procedure calls
44-
* per transferred bit can make performance a problem, this code
45-
* is set up so that you can use it in either of two ways:
46-
*
47-
* - The slow generic way: set up platform_data to hold the GPIO
48-
* numbers used for MISO/MOSI/SCK, and issue procedure calls for
49-
* each of them. This driver can handle several such busses.
50-
*
51-
* - The quicker inlined way: only helps with platform GPIO code
52-
* that inlines operations for constant GPIOs. This can give
53-
* you tight (fast!) inner loops, but each such bus needs a
54-
* new driver. You'll define a new C file, with Makefile and
55-
* Kconfig support; the C code can be a total of six lines:
56-
*
57-
* #define DRIVER_NAME "myboard_spi2"
58-
* #define SPI_MISO_GPIO 119
59-
* #define SPI_MOSI_GPIO 120
60-
* #define SPI_SCK_GPIO 121
61-
* #define SPI_N_CHIPSEL 4
62-
* #include "spi-gpio.c"
63-
*/
64-
65-
#ifndef DRIVER_NAME
6642
#define DRIVER_NAME "spi_gpio"
6743

68-
#define GENERIC_BITBANG /* vs tight inlines */
69-
70-
#endif
71-
7244
/*----------------------------------------------------------------------*/
7345

7446
static inline struct spi_gpio *__pure
@@ -341,10 +313,9 @@ static int spi_gpio_probe_pdata(struct platform_device *pdev,
341313
struct spi_gpio *spi_gpio = spi_controller_get_devdata(host);
342314
int i;
343315

344-
#ifdef GENERIC_BITBANG
345316
if (!pdata || !pdata->num_chipselect)
346317
return -ENODEV;
347-
#endif
318+
348319
/*
349320
* The host needs to think there is a chipselect even if not
350321
* connected
@@ -445,8 +416,6 @@ static int spi_gpio_probe(struct platform_device *pdev)
445416
return devm_spi_register_controller(&pdev->dev, host);
446417
}
447418

448-
MODULE_ALIAS("platform:" DRIVER_NAME);
449-
450419
static const struct of_device_id spi_gpio_dt_ids[] = {
451420
{ .compatible = "spi-gpio" },
452421
{}
@@ -465,3 +434,4 @@ module_platform_driver(spi_gpio_driver);
465434
MODULE_DESCRIPTION("SPI host driver using generic bitbanged GPIO ");
466435
MODULE_AUTHOR("David Brownell");
467436
MODULE_LICENSE("GPL");
437+
MODULE_ALIAS("platform:" DRIVER_NAME);

0 commit comments

Comments
 (0)