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

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

Version: ~ [ linux-5.13-rc5 ] ~ [ linux-5.12.9 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.42 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.124 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.193 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.235 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.271 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.271 ] ~ [ 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) 2010 Pengutronix, Wolfram Sang <w.sang@pengutronix.de>
  3  *
  4  * This program is free software; you can redistribute it and/or modify it under
  5  * the terms of the GNU General Public License version 2 as published by the
  6  * Free Software Foundation.
  7  */
  8 
  9 #include <linux/platform_data/mmc-esdhc-imx.h>
 10 
 11 #include "../hardware.h"
 12 #include "devices-common.h"
 13 
 14 #define imx_sdhci_esdhc_imx_data_entry_single(soc, _devid, _id, hwid) \
 15         {                                                               \
 16                 .devid = _devid,                                        \
 17                 .id = _id,                                              \
 18                 .iobase = soc ## _ESDHC ## hwid ## _BASE_ADDR,  \
 19                 .irq = soc ## _INT_ESDHC ## hwid,                       \
 20         }
 21 
 22 #define imx_sdhci_esdhc_imx_data_entry(soc, devid, id, hwid)    \
 23         [id] = imx_sdhci_esdhc_imx_data_entry_single(soc, devid, id, hwid)
 24 
 25 #ifdef CONFIG_SOC_IMX25
 26 const struct imx_sdhci_esdhc_imx_data
 27 imx25_sdhci_esdhc_imx_data[] __initconst = {
 28 #define imx25_sdhci_esdhc_imx_data_entry(_id, _hwid)                    \
 29         imx_sdhci_esdhc_imx_data_entry(MX25, "sdhci-esdhc-imx25", _id, _hwid)
 30         imx25_sdhci_esdhc_imx_data_entry(0, 1),
 31         imx25_sdhci_esdhc_imx_data_entry(1, 2),
 32 };
 33 #endif /* ifdef CONFIG_SOC_IMX25 */
 34 
 35 #ifdef CONFIG_SOC_IMX35
 36 const struct imx_sdhci_esdhc_imx_data
 37 imx35_sdhci_esdhc_imx_data[] __initconst = {
 38 #define imx35_sdhci_esdhc_imx_data_entry(_id, _hwid)                    \
 39         imx_sdhci_esdhc_imx_data_entry(MX35, "sdhci-esdhc-imx35", _id, _hwid)
 40         imx35_sdhci_esdhc_imx_data_entry(0, 1),
 41         imx35_sdhci_esdhc_imx_data_entry(1, 2),
 42         imx35_sdhci_esdhc_imx_data_entry(2, 3),
 43 };
 44 #endif /* ifdef CONFIG_SOC_IMX35 */
 45 
 46 #ifdef CONFIG_SOC_IMX51
 47 const struct imx_sdhci_esdhc_imx_data
 48 imx51_sdhci_esdhc_imx_data[] __initconst = {
 49 #define imx51_sdhci_esdhc_imx_data_entry(_id, _hwid)                    \
 50         imx_sdhci_esdhc_imx_data_entry(MX51, "sdhci-esdhc-imx51", _id, _hwid)
 51         imx51_sdhci_esdhc_imx_data_entry(0, 1),
 52         imx51_sdhci_esdhc_imx_data_entry(1, 2),
 53         imx51_sdhci_esdhc_imx_data_entry(2, 3),
 54         imx51_sdhci_esdhc_imx_data_entry(3, 4),
 55 };
 56 #endif /* ifdef CONFIG_SOC_IMX51 */
 57 
 58 #ifdef CONFIG_SOC_IMX53
 59 const struct imx_sdhci_esdhc_imx_data
 60 imx53_sdhci_esdhc_imx_data[] __initconst = {
 61 #define imx53_sdhci_esdhc_imx_data_entry(_id, _hwid)                    \
 62         imx_sdhci_esdhc_imx_data_entry(MX53, "sdhci-esdhc-imx53", _id, _hwid)
 63         imx53_sdhci_esdhc_imx_data_entry(0, 1),
 64         imx53_sdhci_esdhc_imx_data_entry(1, 2),
 65         imx53_sdhci_esdhc_imx_data_entry(2, 3),
 66         imx53_sdhci_esdhc_imx_data_entry(3, 4),
 67 };
 68 #endif /* ifdef CONFIG_SOC_IMX53 */
 69 
 70 static const struct esdhc_platform_data default_esdhc_pdata __initconst = {
 71         .wp_type = ESDHC_WP_NONE,
 72         .cd_type = ESDHC_CD_NONE,
 73 };
 74 
 75 struct platform_device *__init imx_add_sdhci_esdhc_imx(
 76                 const struct imx_sdhci_esdhc_imx_data *data,
 77                 const struct esdhc_platform_data *pdata)
 78 {
 79         struct resource res[] = {
 80                 {
 81                         .start = data->iobase,
 82                         .end = data->iobase + SZ_16K - 1,
 83                         .flags = IORESOURCE_MEM,
 84                 }, {
 85                         .start = data->irq,
 86                         .end = data->irq,
 87                         .flags = IORESOURCE_IRQ,
 88                 },
 89         };
 90 
 91         /*
 92          * If machine does not provide pdata, use the default one
 93          * which means no WP/CD support
 94          */
 95         if (!pdata)
 96                 pdata = &default_esdhc_pdata;
 97 
 98         return imx_add_platform_device(data->devid, data->id, res,
 99                         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