Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 1 | /* |
| 2 | * drivers/mmc/host/sdhci-spear.c |
| 3 | * |
| 4 | * Support of SDHCI platform devices for spear soc family |
| 5 | * |
| 6 | * Copyright (C) 2010 ST Microelectronics |
Viresh Kumar | 10d8935 | 2012-06-20 12:53:02 -0700 | [diff] [blame] | 7 | * Viresh Kumar <viresh.linux@gmail.com> |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 8 | * |
| 9 | * Inspired by sdhci-pltfm.c |
| 10 | * |
| 11 | * This file is licensed under the terms of the GNU General Public |
| 12 | * License version 2. This program is licensed "as is" without any |
| 13 | * warranty of any kind, whether express or implied. |
| 14 | */ |
| 15 | |
| 16 | #include <linux/clk.h> |
| 17 | #include <linux/delay.h> |
| 18 | #include <linux/gpio.h> |
| 19 | #include <linux/highmem.h> |
Paul Gortmaker | 88b4767 | 2011-07-03 15:15:51 -0400 | [diff] [blame] | 20 | #include <linux/module.h> |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 21 | #include <linux/interrupt.h> |
| 22 | #include <linux/irq.h> |
Viresh Kumar | 067bf74 | 2012-09-28 15:58:22 +0530 | [diff] [blame] | 23 | #include <linux/of.h> |
| 24 | #include <linux/of_gpio.h> |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 25 | #include <linux/platform_device.h> |
Viresh Kumar | b70a7fa | 2011-11-15 16:24:40 +0530 | [diff] [blame] | 26 | #include <linux/pm.h> |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 27 | #include <linux/slab.h> |
| 28 | #include <linux/mmc/host.h> |
| 29 | #include <linux/mmc/sdhci-spear.h> |
| 30 | #include <linux/io.h> |
| 31 | #include "sdhci.h" |
| 32 | |
| 33 | struct spear_sdhci { |
| 34 | struct clk *clk; |
| 35 | struct sdhci_plat_data *data; |
| 36 | }; |
| 37 | |
| 38 | /* sdhci ops */ |
Lars-Peter Clausen | c915568 | 2013-03-13 19:26:05 +0100 | [diff] [blame] | 39 | static const struct sdhci_ops sdhci_pltfm_ops = { |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 40 | /* Nothing to do for now. */ |
| 41 | }; |
| 42 | |
| 43 | /* gpio card detection interrupt handler */ |
| 44 | static irqreturn_t sdhci_gpio_irq(int irq, void *dev_id) |
| 45 | { |
| 46 | struct platform_device *pdev = dev_id; |
| 47 | struct sdhci_host *host = platform_get_drvdata(pdev); |
| 48 | struct spear_sdhci *sdhci = dev_get_platdata(&pdev->dev); |
| 49 | unsigned long gpio_irq_type; |
| 50 | int val; |
| 51 | |
| 52 | val = gpio_get_value(sdhci->data->card_int_gpio); |
| 53 | |
| 54 | /* val == 1 -> card removed, val == 0 -> card inserted */ |
| 55 | /* if card removed - set irq for low level, else vice versa */ |
| 56 | gpio_irq_type = val ? IRQF_TRIGGER_LOW : IRQF_TRIGGER_HIGH; |
Thomas Gleixner | dced35a | 2011-03-28 17:49:12 +0200 | [diff] [blame] | 57 | irq_set_irq_type(irq, gpio_irq_type); |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 58 | |
| 59 | if (sdhci->data->card_power_gpio >= 0) { |
| 60 | if (!sdhci->data->power_always_enb) { |
| 61 | /* if card inserted, give power, otherwise remove it */ |
| 62 | val = sdhci->data->power_active_high ? !val : val ; |
| 63 | gpio_set_value(sdhci->data->card_power_gpio, val); |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | /* inform sdhci driver about card insertion/removal */ |
| 68 | tasklet_schedule(&host->card_tasklet); |
| 69 | |
| 70 | return IRQ_HANDLED; |
| 71 | } |
| 72 | |
Viresh Kumar | 067bf74 | 2012-09-28 15:58:22 +0530 | [diff] [blame] | 73 | #ifdef CONFIG_OF |
Bill Pemberton | c3be1ef | 2012-11-19 13:23:06 -0500 | [diff] [blame] | 74 | static struct sdhci_plat_data *sdhci_probe_config_dt(struct platform_device *pdev) |
Viresh Kumar | 067bf74 | 2012-09-28 15:58:22 +0530 | [diff] [blame] | 75 | { |
| 76 | struct device_node *np = pdev->dev.of_node; |
| 77 | struct sdhci_plat_data *pdata = NULL; |
| 78 | int cd_gpio; |
| 79 | |
| 80 | cd_gpio = of_get_named_gpio(np, "cd-gpios", 0); |
| 81 | if (!gpio_is_valid(cd_gpio)) |
| 82 | cd_gpio = -1; |
| 83 | |
| 84 | /* If pdata is required */ |
| 85 | if (cd_gpio != -1) { |
| 86 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); |
| 87 | if (!pdata) { |
| 88 | dev_err(&pdev->dev, "DT: kzalloc failed\n"); |
| 89 | return ERR_PTR(-ENOMEM); |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | pdata->card_int_gpio = cd_gpio; |
| 94 | |
| 95 | return pdata; |
| 96 | } |
| 97 | #else |
Bill Pemberton | c3be1ef | 2012-11-19 13:23:06 -0500 | [diff] [blame] | 98 | static struct sdhci_plat_data *sdhci_probe_config_dt(struct platform_device *pdev) |
Viresh Kumar | 067bf74 | 2012-09-28 15:58:22 +0530 | [diff] [blame] | 99 | { |
| 100 | return ERR_PTR(-ENOSYS); |
| 101 | } |
| 102 | #endif |
| 103 | |
Bill Pemberton | c3be1ef | 2012-11-19 13:23:06 -0500 | [diff] [blame] | 104 | static int sdhci_probe(struct platform_device *pdev) |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 105 | { |
Viresh Kumar | 067bf74 | 2012-09-28 15:58:22 +0530 | [diff] [blame] | 106 | struct device_node *np = pdev->dev.of_node; |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 107 | struct sdhci_host *host; |
| 108 | struct resource *iomem; |
| 109 | struct spear_sdhci *sdhci; |
| 110 | int ret; |
| 111 | |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 112 | iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 113 | if (!iomem) { |
| 114 | ret = -ENOMEM; |
| 115 | dev_dbg(&pdev->dev, "memory resource not defined\n"); |
| 116 | goto err; |
| 117 | } |
| 118 | |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 119 | if (!devm_request_mem_region(&pdev->dev, iomem->start, |
| 120 | resource_size(iomem), "spear-sdhci")) { |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 121 | ret = -EBUSY; |
| 122 | dev_dbg(&pdev->dev, "cannot request region\n"); |
| 123 | goto err; |
| 124 | } |
| 125 | |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 126 | sdhci = devm_kzalloc(&pdev->dev, sizeof(*sdhci), GFP_KERNEL); |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 127 | if (!sdhci) { |
| 128 | ret = -ENOMEM; |
| 129 | dev_dbg(&pdev->dev, "cannot allocate memory for sdhci\n"); |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 130 | goto err; |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 131 | } |
| 132 | |
| 133 | /* clk enable */ |
| 134 | sdhci->clk = clk_get(&pdev->dev, NULL); |
| 135 | if (IS_ERR(sdhci->clk)) { |
| 136 | ret = PTR_ERR(sdhci->clk); |
| 137 | dev_dbg(&pdev->dev, "Error getting clock\n"); |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 138 | goto err; |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 139 | } |
| 140 | |
Viresh Kumar | da764f9 | 2012-09-28 15:58:23 +0530 | [diff] [blame] | 141 | ret = clk_prepare_enable(sdhci->clk); |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 142 | if (ret) { |
| 143 | dev_dbg(&pdev->dev, "Error enabling clock\n"); |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 144 | goto put_clk; |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 145 | } |
| 146 | |
Vipul Kumar Samar | 257f9df | 2012-11-08 20:39:09 +0530 | [diff] [blame] | 147 | ret = clk_set_rate(sdhci->clk, 50000000); |
| 148 | if (ret) |
| 149 | dev_dbg(&pdev->dev, "Error setting desired clk, clk=%lu\n", |
| 150 | clk_get_rate(sdhci->clk)); |
| 151 | |
Viresh Kumar | 067bf74 | 2012-09-28 15:58:22 +0530 | [diff] [blame] | 152 | if (np) { |
| 153 | sdhci->data = sdhci_probe_config_dt(pdev); |
| 154 | if (IS_ERR(sdhci->data)) { |
| 155 | dev_err(&pdev->dev, "DT: Failed to get pdata\n"); |
| 156 | return -ENODEV; |
| 157 | } |
| 158 | } else { |
| 159 | sdhci->data = dev_get_platdata(&pdev->dev); |
| 160 | } |
| 161 | |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 162 | pdev->dev.platform_data = sdhci; |
| 163 | |
| 164 | if (pdev->dev.parent) |
| 165 | host = sdhci_alloc_host(pdev->dev.parent, 0); |
| 166 | else |
| 167 | host = sdhci_alloc_host(&pdev->dev, 0); |
| 168 | |
| 169 | if (IS_ERR(host)) { |
| 170 | ret = PTR_ERR(host); |
| 171 | dev_dbg(&pdev->dev, "error allocating host\n"); |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 172 | goto disable_clk; |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 173 | } |
| 174 | |
| 175 | host->hw_name = "sdhci"; |
| 176 | host->ops = &sdhci_pltfm_ops; |
| 177 | host->irq = platform_get_irq(pdev, 0); |
| 178 | host->quirks = SDHCI_QUIRK_BROKEN_ADMA; |
| 179 | |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 180 | host->ioaddr = devm_ioremap(&pdev->dev, iomem->start, |
| 181 | resource_size(iomem)); |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 182 | if (!host->ioaddr) { |
| 183 | ret = -ENOMEM; |
| 184 | dev_dbg(&pdev->dev, "failed to remap registers\n"); |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 185 | goto free_host; |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 186 | } |
| 187 | |
| 188 | ret = sdhci_add_host(host); |
| 189 | if (ret) { |
| 190 | dev_dbg(&pdev->dev, "error adding host\n"); |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 191 | goto free_host; |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 192 | } |
| 193 | |
| 194 | platform_set_drvdata(pdev, host); |
| 195 | |
| 196 | /* |
| 197 | * It is optional to use GPIOs for sdhci Power control & sdhci card |
| 198 | * interrupt detection. If sdhci->data is NULL, then use original sdhci |
| 199 | * lines otherwise GPIO lines. |
| 200 | * If GPIO is selected for power control, then power should be disabled |
| 201 | * after card removal and should be enabled when card insertion |
| 202 | * interrupt occurs |
| 203 | */ |
| 204 | if (!sdhci->data) |
| 205 | return 0; |
| 206 | |
| 207 | if (sdhci->data->card_power_gpio >= 0) { |
| 208 | int val = 0; |
| 209 | |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 210 | ret = devm_gpio_request(&pdev->dev, |
| 211 | sdhci->data->card_power_gpio, "sdhci"); |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 212 | if (ret < 0) { |
| 213 | dev_dbg(&pdev->dev, "gpio request fail: %d\n", |
| 214 | sdhci->data->card_power_gpio); |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 215 | goto set_drvdata; |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 216 | } |
| 217 | |
| 218 | if (sdhci->data->power_always_enb) |
| 219 | val = sdhci->data->power_active_high; |
| 220 | else |
| 221 | val = !sdhci->data->power_active_high; |
| 222 | |
| 223 | ret = gpio_direction_output(sdhci->data->card_power_gpio, val); |
| 224 | if (ret) { |
| 225 | dev_dbg(&pdev->dev, "gpio set direction fail: %d\n", |
| 226 | sdhci->data->card_power_gpio); |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 227 | goto set_drvdata; |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 228 | } |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 229 | } |
| 230 | |
| 231 | if (sdhci->data->card_int_gpio >= 0) { |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 232 | ret = devm_gpio_request(&pdev->dev, sdhci->data->card_int_gpio, |
| 233 | "sdhci"); |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 234 | if (ret < 0) { |
| 235 | dev_dbg(&pdev->dev, "gpio request fail: %d\n", |
| 236 | sdhci->data->card_int_gpio); |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 237 | goto set_drvdata; |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 238 | } |
| 239 | |
| 240 | ret = gpio_direction_input(sdhci->data->card_int_gpio); |
| 241 | if (ret) { |
| 242 | dev_dbg(&pdev->dev, "gpio set direction fail: %d\n", |
| 243 | sdhci->data->card_int_gpio); |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 244 | goto set_drvdata; |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 245 | } |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 246 | ret = devm_request_irq(&pdev->dev, |
| 247 | gpio_to_irq(sdhci->data->card_int_gpio), |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 248 | sdhci_gpio_irq, IRQF_TRIGGER_LOW, |
| 249 | mmc_hostname(host->mmc), pdev); |
| 250 | if (ret) { |
| 251 | dev_dbg(&pdev->dev, "gpio request irq fail: %d\n", |
| 252 | sdhci->data->card_int_gpio); |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 253 | goto set_drvdata; |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 254 | } |
| 255 | |
| 256 | } |
| 257 | |
| 258 | return 0; |
| 259 | |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 260 | set_drvdata: |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 261 | sdhci_remove_host(host, 1); |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 262 | free_host: |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 263 | sdhci_free_host(host); |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 264 | disable_clk: |
Viresh Kumar | da764f9 | 2012-09-28 15:58:23 +0530 | [diff] [blame] | 265 | clk_disable_unprepare(sdhci->clk); |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 266 | put_clk: |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 267 | clk_put(sdhci->clk); |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 268 | err: |
| 269 | dev_err(&pdev->dev, "spear-sdhci probe failed: %d\n", ret); |
| 270 | return ret; |
| 271 | } |
| 272 | |
Bill Pemberton | 6e0ee71 | 2012-11-19 13:26:03 -0500 | [diff] [blame] | 273 | static int sdhci_remove(struct platform_device *pdev) |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 274 | { |
| 275 | struct sdhci_host *host = platform_get_drvdata(pdev); |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 276 | struct spear_sdhci *sdhci = dev_get_platdata(&pdev->dev); |
Viresh Kumar | 6ebaf8f | 2012-03-27 08:40:35 +0530 | [diff] [blame] | 277 | int dead = 0; |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 278 | u32 scratch; |
| 279 | |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 280 | scratch = readl(host->ioaddr + SDHCI_INT_STATUS); |
| 281 | if (scratch == (u32)-1) |
| 282 | dead = 1; |
| 283 | |
| 284 | sdhci_remove_host(host, dead); |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 285 | sdhci_free_host(host); |
Viresh Kumar | da764f9 | 2012-09-28 15:58:23 +0530 | [diff] [blame] | 286 | clk_disable_unprepare(sdhci->clk); |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 287 | clk_put(sdhci->clk); |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 288 | |
| 289 | return 0; |
| 290 | } |
| 291 | |
Jingoo Han | b0dd099 | 2013-03-29 16:08:00 +0900 | [diff] [blame] | 292 | #ifdef CONFIG_PM_SLEEP |
Viresh Kumar | b70a7fa | 2011-11-15 16:24:40 +0530 | [diff] [blame] | 293 | static int sdhci_suspend(struct device *dev) |
| 294 | { |
| 295 | struct sdhci_host *host = dev_get_drvdata(dev); |
| 296 | struct spear_sdhci *sdhci = dev_get_platdata(dev); |
Viresh Kumar | b70a7fa | 2011-11-15 16:24:40 +0530 | [diff] [blame] | 297 | int ret; |
| 298 | |
Viresh Kumar | 984589e | 2012-01-04 11:48:42 +0530 | [diff] [blame] | 299 | ret = sdhci_suspend_host(host); |
Viresh Kumar | b70a7fa | 2011-11-15 16:24:40 +0530 | [diff] [blame] | 300 | if (!ret) |
Viresh Kumar | 06960a1 | 2012-11-08 20:39:10 +0530 | [diff] [blame] | 301 | clk_disable(sdhci->clk); |
Viresh Kumar | b70a7fa | 2011-11-15 16:24:40 +0530 | [diff] [blame] | 302 | |
| 303 | return ret; |
| 304 | } |
| 305 | |
| 306 | static int sdhci_resume(struct device *dev) |
| 307 | { |
| 308 | struct sdhci_host *host = dev_get_drvdata(dev); |
| 309 | struct spear_sdhci *sdhci = dev_get_platdata(dev); |
| 310 | int ret; |
| 311 | |
Viresh Kumar | 06960a1 | 2012-11-08 20:39:10 +0530 | [diff] [blame] | 312 | ret = clk_enable(sdhci->clk); |
Viresh Kumar | b70a7fa | 2011-11-15 16:24:40 +0530 | [diff] [blame] | 313 | if (ret) { |
| 314 | dev_dbg(dev, "Resume: Error enabling clock\n"); |
| 315 | return ret; |
| 316 | } |
| 317 | |
| 318 | return sdhci_resume_host(host); |
| 319 | } |
Viresh Kumar | b70a7fa | 2011-11-15 16:24:40 +0530 | [diff] [blame] | 320 | #endif |
| 321 | |
Shiraz Hashim | 4b1a617 | 2012-02-24 11:55:35 +0530 | [diff] [blame] | 322 | static SIMPLE_DEV_PM_OPS(sdhci_pm_ops, sdhci_suspend, sdhci_resume); |
| 323 | |
Viresh Kumar | 067bf74 | 2012-09-28 15:58:22 +0530 | [diff] [blame] | 324 | #ifdef CONFIG_OF |
| 325 | static const struct of_device_id sdhci_spear_id_table[] = { |
| 326 | { .compatible = "st,spear300-sdhci" }, |
| 327 | {} |
| 328 | }; |
| 329 | MODULE_DEVICE_TABLE(of, sdhci_spear_id_table); |
| 330 | #endif |
| 331 | |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 332 | static struct platform_driver sdhci_driver = { |
| 333 | .driver = { |
| 334 | .name = "sdhci", |
| 335 | .owner = THIS_MODULE, |
Viresh Kumar | b70a7fa | 2011-11-15 16:24:40 +0530 | [diff] [blame] | 336 | .pm = &sdhci_pm_ops, |
Viresh Kumar | 067bf74 | 2012-09-28 15:58:22 +0530 | [diff] [blame] | 337 | .of_match_table = of_match_ptr(sdhci_spear_id_table), |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 338 | }, |
| 339 | .probe = sdhci_probe, |
Bill Pemberton | 0433c14 | 2012-11-19 13:20:26 -0500 | [diff] [blame] | 340 | .remove = sdhci_remove, |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 341 | }; |
| 342 | |
Axel Lin | d1f81a6 | 2011-11-26 12:55:43 +0800 | [diff] [blame] | 343 | module_platform_driver(sdhci_driver); |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 344 | |
| 345 | MODULE_DESCRIPTION("SPEAr Secure Digital Host Controller Interface driver"); |
Viresh Kumar | 10d8935 | 2012-06-20 12:53:02 -0700 | [diff] [blame] | 346 | MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>"); |
Viresh KUMAR | c63b3cb | 2010-05-26 14:42:10 -0700 | [diff] [blame] | 347 | MODULE_LICENSE("GPL v2"); |