aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-gpio.c
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-04-21 15:16:38 +0000
committersaturneric <[email protected]>2025-04-21 15:16:38 +0000
commitb6fa6aab249ea9a41adf12b81c3fdc57adbe2c59 (patch)
tree89bf2c4a4dd6d00f18f22dbdef080fc205a407ad /drivers/spi/spi-gpio.c
parentfix: patch to bcm2712-rpi-5-b.dts solving boot issues (diff)
parentgcc-15: disable '-Wunterminated-string-initialization' entirely for now (diff)
downloadkernel-b6fa6aab249ea9a41adf12b81c3fdc57adbe2c59.tar.gz
kernel-b6fa6aab249ea9a41adf12b81c3fdc57adbe2c59.zip
Merge remote-tracking UNTIL 21. Apr. 2025
Diffstat (limited to 'drivers/spi/spi-gpio.c')
-rw-r--r--drivers/spi/spi-gpio.c36
1 files changed, 3 insertions, 33 deletions
diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c
index 139641fd2329..b7783fffecfb 100644
--- a/drivers/spi/spi-gpio.c
+++ b/drivers/spi/spi-gpio.c
@@ -42,36 +42,8 @@ struct spi_gpio {
/*----------------------------------------------------------------------*/
-/*
- * Because the overhead of going through four GPIO procedure calls
- * per transferred bit can make performance a problem, this code
- * is set up so that you can use it in either of two ways:
- *
- * - The slow generic way: set up platform_data to hold the GPIO
- * numbers used for MISO/MOSI/SCK, and issue procedure calls for
- * each of them. This driver can handle several such busses.
- *
- * - The quicker inlined way: only helps with platform GPIO code
- * that inlines operations for constant GPIOs. This can give
- * you tight (fast!) inner loops, but each such bus needs a
- * new driver. You'll define a new C file, with Makefile and
- * Kconfig support; the C code can be a total of six lines:
- *
- * #define DRIVER_NAME "myboard_spi2"
- * #define SPI_MISO_GPIO 119
- * #define SPI_MOSI_GPIO 120
- * #define SPI_SCK_GPIO 121
- * #define SPI_N_CHIPSEL 4
- * #include "spi-gpio.c"
- */
-
-#ifndef DRIVER_NAME
#define DRIVER_NAME "spi_gpio"
-#define GENERIC_BITBANG /* vs tight inlines */
-
-#endif
-
/*----------------------------------------------------------------------*/
static inline struct spi_gpio *__pure
@@ -397,10 +369,9 @@ static int spi_gpio_probe_pdata(struct platform_device *pdev,
struct device *dev = &pdev->dev;
struct spi_gpio_platform_data *pdata = dev_get_platdata(dev);
-#ifdef GENERIC_BITBANG
- if (!pdata || !pdata->num_chipselect)
+ if (!pdata)
return -ENODEV;
-#endif
+
/*
* The host needs to think there is a chipselect even if not
* connected
@@ -488,8 +459,6 @@ static int spi_gpio_probe(struct platform_device *pdev)
return devm_spi_register_controller(&pdev->dev, host);
}
-MODULE_ALIAS("platform:" DRIVER_NAME);
-
static const struct of_device_id spi_gpio_dt_ids[] = {
{ .compatible = "spi-gpio" },
{}
@@ -508,3 +477,4 @@ module_platform_driver(spi_gpio_driver);
MODULE_DESCRIPTION("SPI host driver using generic bitbanged GPIO ");
MODULE_AUTHOR("David Brownell");
MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:" DRIVER_NAME);