ARM: imx: use platform ids for spi_imx devices
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 9 Sep 2010 19:02:02 +0000 (21:02 +0200)
committerSascha Hauer <s.hauer@pengutronix.de>
Fri, 1 Oct 2010 07:32:14 +0000 (09:32 +0200)
The driver recently learned to handle platform ids.  Make use of this
new feature.  The up side is that the driver needs less knowledge about
the spi interfaces used on different SoCs.

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>
arch/arm/mach-imx/clock-imx1.c
arch/arm/mach-imx/clock-imx21.c
arch/arm/mach-imx/clock-imx27.c
arch/arm/mach-mx25/clock.c
arch/arm/mach-mx3/clock-imx31.c
arch/arm/mach-mx3/clock-imx35.c
arch/arm/plat-mxc/devices/platform-spi_imx.c
arch/arm/plat-mxc/include/mach/devices-common.h

index c05096c38301038292e9b9f6e0bb10990c31433e..daca30b2d5b1ad5d77c03e8166910a8b7ca5a066 100644 (file)
@@ -592,7 +592,7 @@ static struct clk_lookup lookups[] __initdata = {
        _REGISTER_CLOCK("imx-uart.1", NULL, uart_clk)
        _REGISTER_CLOCK("imx-uart.2", NULL, uart_clk)
        _REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk)
-       _REGISTER_CLOCK("spi_imx.0", NULL, spi_clk)
+       _REGISTER_CLOCK("imx1-cspi.0", NULL, spi_clk)
        _REGISTER_CLOCK("imx-mmc.0", NULL, sdhc_clk)
        _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk)
        _REGISTER_CLOCK(NULL, "mshc", mshc_clk)
index bb419ef4d133bb7c12f962bad2c961b337247d4c..cf15ea516a72c4e177d1d4d66374ea0a4ed8676f 100644 (file)
@@ -1172,9 +1172,9 @@ static struct clk_lookup lookups[] = {
        _REGISTER_CLOCK(NULL, "pwm", pwm_clk[0])
        _REGISTER_CLOCK(NULL, "sdhc1", sdhc_clk[0])
        _REGISTER_CLOCK(NULL, "sdhc2", sdhc_clk[1])
-       _REGISTER_CLOCK(NULL, "cspi1", cspi_clk[0])
-       _REGISTER_CLOCK(NULL, "cspi2", cspi_clk[1])
-       _REGISTER_CLOCK(NULL, "cspi3", cspi_clk[2])
+       _REGISTER_CLOCK("imx21-cspi.0", NULL, cspi_clk[0])
+       _REGISTER_CLOCK("imx21-cspi.1", NULL, cspi_clk[1])
+       _REGISTER_CLOCK("imx21-cspi.2", NULL, cspi_clk[2])
        _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk[0])
        _REGISTER_CLOCK(NULL, "csi", csi_clk[0])
        _REGISTER_CLOCK("imx21-hcd.0", NULL, usb_clk[0])
index 5a1aa15c8a16140f17e75ea451b5441c9c413d10..07bf315bc0783bc2eb26dd85b4d340b6f6b16564 100644 (file)
@@ -640,9 +640,9 @@ static struct clk_lookup lookups[] = {
        _REGISTER_CLOCK("mxc-mmc.0", NULL, sdhc1_clk)
        _REGISTER_CLOCK("mxc-mmc.1", NULL, sdhc2_clk)
        _REGISTER_CLOCK("mxc-mmc.2", NULL, sdhc3_clk)
-       _REGISTER_CLOCK("spi_imx.0", NULL, cspi1_clk)
-       _REGISTER_CLOCK("spi_imx.1", NULL, cspi2_clk)
-       _REGISTER_CLOCK("spi_imx.2", NULL, cspi3_clk)
+       _REGISTER_CLOCK("imx27-cspi.0", NULL, cspi1_clk)
+       _REGISTER_CLOCK("imx27-cspi.1", NULL, cspi2_clk)
+       _REGISTER_CLOCK("imx27-cspi.2", NULL, cspi3_clk)
        _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk)
        _REGISTER_CLOCK("mx2-camera.0", NULL, csi_clk)
        _REGISTER_CLOCK("fsl-usb2-udc", "usb", usb_clk)
index 40c7cc41cee372c906e3339f5da50f9e709f36df..039464a8dacc39d44edaf44b1df1be88fd7576b9 100644 (file)
@@ -261,9 +261,9 @@ static struct clk_lookup lookups[] = {
        _REGISTER_CLOCK("mxc-ehci.2", "usb", usbotg_clk)
        _REGISTER_CLOCK("fsl-usb2-udc", "usb", usbotg_clk)
        _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk)
-       _REGISTER_CLOCK("spi_imx.0", NULL, cspi1_clk)
-       _REGISTER_CLOCK("spi_imx.1", NULL, cspi2_clk)
-       _REGISTER_CLOCK("spi_imx.2", NULL, cspi3_clk)
+       _REGISTER_CLOCK("imx25-cspi.0", NULL, cspi1_clk)
+       _REGISTER_CLOCK("imx25-cspi.1", NULL, cspi2_clk)
+       _REGISTER_CLOCK("imx25-cspi.2", NULL, cspi3_clk)
        _REGISTER_CLOCK("mxc_pwm.0", NULL, pwm1_clk)
        _REGISTER_CLOCK("mxc_pwm.1", NULL, pwm2_clk)
        _REGISTER_CLOCK("mxc_pwm.2", NULL, pwm3_clk)
index 9a9eb6de6127efd0b7a6241a17a5f9d88b4e09e1..18e98f1d4de0504bb20fa92e06bd58541fc9bb5b 100644 (file)
@@ -525,9 +525,9 @@ DEFINE_CLOCK(ipg_clk,     0, NULL,          0, ipg_get_rate, NULL, &ahb_clk);
 
 static struct clk_lookup lookups[] = {
        _REGISTER_CLOCK(NULL, "emi", emi_clk)
-       _REGISTER_CLOCK("spi_imx.0", NULL, cspi1_clk)
-       _REGISTER_CLOCK("spi_imx.1", NULL, cspi2_clk)
-       _REGISTER_CLOCK("spi_imx.2", NULL, cspi3_clk)
+       _REGISTER_CLOCK("imx31-cspi.0", NULL, cspi1_clk)
+       _REGISTER_CLOCK("imx31-cspi.1", NULL, cspi2_clk)
+       _REGISTER_CLOCK("imx31-cspi.2", NULL, cspi3_clk)
        _REGISTER_CLOCK(NULL, "gpt", gpt_clk)
        _REGISTER_CLOCK(NULL, "pwm", pwm_clk)
        _REGISTER_CLOCK("imx-wdt.0", NULL, wdog_clk)
index f11ef990120ccd26d6b6006704a936031992def8..708c2b36cf06c51c60d145b9bd34950e2b99c2b8 100644 (file)
@@ -451,8 +451,8 @@ static struct clk_lookup lookups[] = {
        _REGISTER_CLOCK(NULL, "ata", ata_clk)
        _REGISTER_CLOCK("flexcan.0", NULL, can1_clk)
        _REGISTER_CLOCK("flexcan.1", NULL, can2_clk)
-       _REGISTER_CLOCK("spi_imx.0", NULL, cspi1_clk)
-       _REGISTER_CLOCK("spi_imx.1", NULL, cspi2_clk)
+       _REGISTER_CLOCK("imx35-cspi.0", NULL, cspi1_clk)
+       _REGISTER_CLOCK("imx35-cspi.1", NULL, cspi2_clk)
        _REGISTER_CLOCK(NULL, "ect", ect_clk)
        _REGISTER_CLOCK(NULL, "edio", edio_clk)
        _REGISTER_CLOCK(NULL, "emi", emi_clk)
index 412a81f24101990c236e8ec40fc48af0e7751c82..bd30d4b2b2f94464e043f20eb14b169327d0462e 100644 (file)
@@ -11,6 +11,7 @@
 
 #define imx_spi_imx_data_entry_single(soc, type, _devid, _id, hwid, _size) \
        {                                                               \
+               .devid = _devid,                                        \
                .id = _id,                                              \
                .iobase = soc ## _ ## type ## hwid ## _BASE_ADDR,       \
                .iosize = _size,                                        \
@@ -83,6 +84,6 @@ struct platform_device *__init imx_add_spi_imx(
                },
        };
 
-       return imx_add_platform_device("spi_imx", data->id,
+       return imx_add_platform_device(data->devid, data->id,
                        res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
 }
index 490fe7c3ed5f0def00c3008a168a126f5a4a1f91..32b8f3674cc9f61822eb237db7ab0ec111f9287a 100644 (file)
@@ -77,6 +77,7 @@ struct platform_device *__init imx_add_mxc_nand_v21(resource_size_t iobase,
 
 #include <mach/spi.h>
 struct imx_spi_imx_data {
+       const char *devid;
        int id;
        resource_size_t iobase;
        resource_size_t iosize;