summaryrefslogtreecommitdiffstats
path: root/drivers/spi/Kconfig
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-09-09 15:29:01 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2010-10-01 09:32:11 +0200
commitf4ba6315cb77a5dcff6664ce1d66ebfe31bcc6b1 (patch)
treec0c99772309192bf7c5eb120fe7f0ea8af1dc160 /drivers/spi/Kconfig
parente89524d33deb55de28b4ab171e4b0f89d46b2d4e (diff)
downloadtalos-op-linux-f4ba6315cb77a5dcff6664ce1d66ebfe31bcc6b1.tar.gz
talos-op-linux-f4ba6315cb77a5dcff6664ce1d66ebfe31bcc6b1.zip
spi/imx: convert driver to use platform ids
This has the advantage not to need to much cpu_is_... macros. Still more when imx51 support is added which has two different spi interfaces which would introduce additional checks on the device id. With this setup it's not possible for the compiler anymore to detect the unused functions, so four additional kconfig symbols are introduced to ifdef out the unneeded functions in the callback array and all these functions are marked with __maybe_unused to suppress the corresponding gcc warnings. Comparing the driver footprint with and without the patch for a mx27 kernel yields: add/remove: 2/0 grow/shrink: 2/0 up/down: 280/0 (280) function old new delta spi_imx_devtype - 192 +192 spi_imx_probe 980 1032 +52 spi_imx_devtype_data - 32 +32 spi_imx_setupxfer 276 280 +4 Later when the platform code is updated to use the platform ids, the autodetection can be removed which will make the driver a bit smaller again. (~60 Bytes in my test.) Acked-by: Jason Wang <jason77.wang@gmail.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/spi/Kconfig')
-rw-r--r--drivers/spi/Kconfig12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 30aea6de4e37..4e9d77bc7d2f 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -143,6 +143,18 @@ config SPI_GPIO
GPIO operations, you should be able to leverage that for better
speed with a custom version of this driver; see the source code.
+config SPI_IMX_VER_IMX1
+ def_bool y if SOC_IMX1
+
+config SPI_IMX_VER_0_0
+ def_bool y if SOC_IMX21 || SOC_IMX27
+
+config SPI_IMX_VER_0_4
+ def_bool y if ARCH_MX31
+
+config SPI_IMX_VER_0_7
+ def_bool y if ARCH_MX25 || ARCH_MX35
+
config SPI_IMX
tristate "Freescale i.MX SPI controllers"
depends on ARCH_MXC
OpenPOWER on IntegriCloud