~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-imx/devices/platform-spi_imx.c

Version: ~ [ linux-5.12 ] ~ [ linux-5.11.16 ] ~ [ linux-5.10.32 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.114 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.188 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.231 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.267 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.267 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Copyright (C) 2009-2010 Pengutronix
  3  * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
  4  *
  5  * This program is free software; you can redistribute it and/or modify it under
  6  * the terms of the GNU General Public License version 2 as published by the
  7  * Free Software Foundation.
  8  */
  9 #include "../hardware.h"
 10 #include "devices-common.h"
 11 
 12 #define imx_spi_imx_data_entry_single(soc, type, _devid, _id, hwid, _size) \
 13         {                                                               \
 14                 .devid = _devid,                                        \
 15                 .id = _id,                                              \
 16                 .iobase = soc ## _ ## type ## hwid ## _BASE_ADDR,       \
 17                 .iosize = _size,                                        \
 18                 .irq = soc ## _INT_ ## type ## hwid,                    \
 19         }
 20 
 21 #define imx_spi_imx_data_entry(soc, type, devid, id, hwid, size)        \
 22         [id] = imx_spi_imx_data_entry_single(soc, type, devid, id, hwid, size)
 23 
 24 #ifdef CONFIG_SOC_IMX1
 25 const struct imx_spi_imx_data imx1_cspi_data[] __initconst = {
 26 #define imx1_cspi_data_entry(_id, _hwid) \
 27         imx_spi_imx_data_entry(MX1, CSPI, "imx1-cspi", _id, _hwid, SZ_4K)
 28         imx1_cspi_data_entry(0, 1),
 29         imx1_cspi_data_entry(1, 2),
 30 };
 31 #endif
 32 
 33 #ifdef CONFIG_SOC_IMX21
 34 const struct imx_spi_imx_data imx21_cspi_data[] __initconst = {
 35 #define imx21_cspi_data_entry(_id, _hwid)                            \
 36         imx_spi_imx_data_entry(MX21, CSPI, "imx21-cspi", _id, _hwid, SZ_4K)
 37         imx21_cspi_data_entry(0, 1),
 38         imx21_cspi_data_entry(1, 2),
 39 };
 40 #endif
 41 
 42 #ifdef CONFIG_SOC_IMX25
 43 /* i.mx25 has the i.mx35 type cspi */
 44 const struct imx_spi_imx_data imx25_cspi_data[] __initconst = {
 45 #define imx25_cspi_data_entry(_id, _hwid)                               \
 46         imx_spi_imx_data_entry(MX25, CSPI, "imx35-cspi", _id, _hwid, SZ_16K)
 47         imx25_cspi_data_entry(0, 1),
 48         imx25_cspi_data_entry(1, 2),
 49         imx25_cspi_data_entry(2, 3),
 50 };
 51 #endif /* ifdef CONFIG_SOC_IMX25 */
 52 
 53 #ifdef CONFIG_SOC_IMX27
 54 const struct imx_spi_imx_data imx27_cspi_data[] __initconst = {
 55 #define imx27_cspi_data_entry(_id, _hwid)                               \
 56         imx_spi_imx_data_entry(MX27, CSPI, "imx27-cspi", _id, _hwid, SZ_4K)
 57         imx27_cspi_data_entry(0, 1),
 58         imx27_cspi_data_entry(1, 2),
 59         imx27_cspi_data_entry(2, 3),
 60 };
 61 #endif /* ifdef CONFIG_SOC_IMX27 */
 62 
 63 #ifdef CONFIG_SOC_IMX31
 64 const struct imx_spi_imx_data imx31_cspi_data[] __initconst = {
 65 #define imx31_cspi_data_entry(_id, _hwid)                               \
 66         imx_spi_imx_data_entry(MX31, CSPI, "imx31-cspi", _id, _hwid, SZ_4K)
 67         imx31_cspi_data_entry(0, 1),
 68         imx31_cspi_data_entry(1, 2),
 69         imx31_cspi_data_entry(2, 3),
 70 };
 71 #endif /* ifdef CONFIG_SOC_IMX31 */
 72 
 73 #ifdef CONFIG_SOC_IMX35
 74 const struct imx_spi_imx_data imx35_cspi_data[] __initconst = {
 75 #define imx35_cspi_data_entry(_id, _hwid)                           \
 76         imx_spi_imx_data_entry(MX35, CSPI, "imx35-cspi", _id, _hwid, SZ_4K)
 77         imx35_cspi_data_entry(0, 1),
 78         imx35_cspi_data_entry(1, 2),
 79 };
 80 #endif /* ifdef CONFIG_SOC_IMX35 */
 81 
 82 struct platform_device *__init imx_add_spi_imx(
 83                 const struct imx_spi_imx_data *data,
 84                 const struct spi_imx_master *pdata)
 85 {
 86         struct resource res[] = {
 87                 {
 88                         .start = data->iobase,
 89                         .end = data->iobase + data->iosize - 1,
 90                         .flags = IORESOURCE_MEM,
 91                 }, {
 92                         .start = data->irq,
 93                         .end = data->irq,
 94                         .flags = IORESOURCE_IRQ,
 95                 },
 96         };
 97 
 98         return imx_add_platform_device(data->devid, data->id,
 99                         res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
100 }
101 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp