blob: 5a600a53b876663b47fc174bef74030b5c2caf3c [file] [log] [blame]
Olof Johansson03d2bfc2011-01-01 23:52:56 -05001/*
2 * Copyright (C) 2010 Google, Inc.
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15#include <linux/err.h>
Paul Gortmaker96547f52011-07-03 15:15:51 -040016#include <linux/module.h>
Olof Johansson03d2bfc2011-01-01 23:52:56 -050017#include <linux/init.h>
18#include <linux/platform_device.h>
19#include <linux/clk.h>
20#include <linux/io.h>
Stephen Warren55cd65e2011-08-30 13:17:16 -060021#include <linux/of.h>
Stephen Warren3e44a1a2012-02-01 16:30:55 -070022#include <linux/of_device.h>
Grant Likely275173b2011-08-23 12:15:33 -060023#include <linux/of_gpio.h>
Olof Johansson03d2bfc2011-01-01 23:52:56 -050024#include <linux/gpio.h>
25#include <linux/mmc/card.h>
26#include <linux/mmc/host.h>
27
Russell Kinge6b750d2011-07-26 10:59:32 +010028#include <asm/gpio.h>
Stephen Warrenea5abbd2011-09-26 19:00:02 +010029
Arnd Bergmanne35742b2012-09-12 18:15:42 +020030#include <linux/platform_data/mmc-sdhci-tegra.h>
Olof Johansson03d2bfc2011-01-01 23:52:56 -050031
Olof Johansson03d2bfc2011-01-01 23:52:56 -050032#include "sdhci-pltfm.h"
33
Pavan Kunapulica5879d2012-04-18 18:48:02 +053034/* Tegra SDHOST controller vendor register definitions */
35#define SDHCI_TEGRA_VENDOR_MISC_CTRL 0x120
36#define SDHCI_MISC_CTRL_ENABLE_SDHCI_SPEC_300 0x20
37
Stephen Warren3e44a1a2012-02-01 16:30:55 -070038#define NVQUIRK_FORCE_SDHCI_SPEC_200 BIT(0)
39#define NVQUIRK_ENABLE_BLOCK_GAP_DET BIT(1)
Pavan Kunapulica5879d2012-04-18 18:48:02 +053040#define NVQUIRK_ENABLE_SDHCI_SPEC_300 BIT(2)
Stephen Warren3e44a1a2012-02-01 16:30:55 -070041
42struct sdhci_tegra_soc_data {
43 struct sdhci_pltfm_data *pdata;
44 u32 nvquirks;
45};
46
47struct sdhci_tegra {
48 const struct tegra_sdhci_platform_data *plat;
49 const struct sdhci_tegra_soc_data *soc_data;
50};
51
Olof Johansson03d2bfc2011-01-01 23:52:56 -050052static u32 tegra_sdhci_readl(struct sdhci_host *host, int reg)
53{
54 u32 val;
55
56 if (unlikely(reg == SDHCI_PRESENT_STATE)) {
57 /* Use wp_gpio here instead? */
58 val = readl(host->ioaddr + reg);
59 return val | SDHCI_WRITE_PROTECT;
60 }
61
62 return readl(host->ioaddr + reg);
63}
64
65static u16 tegra_sdhci_readw(struct sdhci_host *host, int reg)
66{
Stephen Warren3e44a1a2012-02-01 16:30:55 -070067 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
68 struct sdhci_tegra *tegra_host = pltfm_host->priv;
69 const struct sdhci_tegra_soc_data *soc_data = tegra_host->soc_data;
70
71 if (unlikely((soc_data->nvquirks & NVQUIRK_FORCE_SDHCI_SPEC_200) &&
72 (reg == SDHCI_HOST_VERSION))) {
Olof Johansson03d2bfc2011-01-01 23:52:56 -050073 /* Erratum: Version register is invalid in HW. */
74 return SDHCI_SPEC_200;
75 }
76
77 return readw(host->ioaddr + reg);
78}
79
80static void tegra_sdhci_writel(struct sdhci_host *host, u32 val, int reg)
81{
Stephen Warren3e44a1a2012-02-01 16:30:55 -070082 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
83 struct sdhci_tegra *tegra_host = pltfm_host->priv;
84 const struct sdhci_tegra_soc_data *soc_data = tegra_host->soc_data;
85
Olof Johansson03d2bfc2011-01-01 23:52:56 -050086 /* Seems like we're getting spurious timeout and crc errors, so
87 * disable signalling of them. In case of real errors software
88 * timers should take care of eventually detecting them.
89 */
90 if (unlikely(reg == SDHCI_SIGNAL_ENABLE))
91 val &= ~(SDHCI_INT_TIMEOUT|SDHCI_INT_CRC);
92
93 writel(val, host->ioaddr + reg);
94
Stephen Warren3e44a1a2012-02-01 16:30:55 -070095 if (unlikely((soc_data->nvquirks & NVQUIRK_ENABLE_BLOCK_GAP_DET) &&
96 (reg == SDHCI_INT_ENABLE))) {
Olof Johansson03d2bfc2011-01-01 23:52:56 -050097 /* Erratum: Must enable block gap interrupt detection */
98 u8 gap_ctrl = readb(host->ioaddr + SDHCI_BLOCK_GAP_CONTROL);
99 if (val & SDHCI_INT_CARD_INT)
100 gap_ctrl |= 0x8;
101 else
102 gap_ctrl &= ~0x8;
103 writeb(gap_ctrl, host->ioaddr + SDHCI_BLOCK_GAP_CONTROL);
104 }
105}
106
Stephen Warren3e44a1a2012-02-01 16:30:55 -0700107static unsigned int tegra_sdhci_get_ro(struct sdhci_host *host)
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500108{
Stephen Warren3e44a1a2012-02-01 16:30:55 -0700109 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
110 struct sdhci_tegra *tegra_host = pltfm_host->priv;
111 const struct tegra_sdhci_platform_data *plat = tegra_host->plat;
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500112
113 if (!gpio_is_valid(plat->wp_gpio))
114 return -1;
115
116 return gpio_get_value(plat->wp_gpio);
117}
118
119static irqreturn_t carddetect_irq(int irq, void *data)
120{
121 struct sdhci_host *sdhost = (struct sdhci_host *)data;
122
123 tasklet_schedule(&sdhost->card_tasklet);
124 return IRQ_HANDLED;
125};
126
Pavan Kunapulica5879d2012-04-18 18:48:02 +0530127static void tegra_sdhci_reset_exit(struct sdhci_host *host, u8 mask)
128{
129 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
130 struct sdhci_tegra *tegra_host = pltfm_host->priv;
131 const struct sdhci_tegra_soc_data *soc_data = tegra_host->soc_data;
132
133 if (!(mask & SDHCI_RESET_ALL))
134 return;
135
136 /* Erratum: Enable SDHCI spec v3.00 support */
137 if (soc_data->nvquirks & NVQUIRK_ENABLE_SDHCI_SPEC_300) {
138 u32 misc_ctrl;
139
140 misc_ctrl = sdhci_readb(host, SDHCI_TEGRA_VENDOR_MISC_CTRL);
141 misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDHCI_SPEC_300;
142 sdhci_writeb(host, misc_ctrl, SDHCI_TEGRA_VENDOR_MISC_CTRL);
143 }
144}
145
Sascha Hauer7bc088d2013-01-21 19:02:27 +0800146static int tegra_sdhci_buswidth(struct sdhci_host *host, int bus_width)
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500147{
Grant Likely275173b2011-08-23 12:15:33 -0600148 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
Stephen Warren3e44a1a2012-02-01 16:30:55 -0700149 struct sdhci_tegra *tegra_host = pltfm_host->priv;
150 const struct tegra_sdhci_platform_data *plat = tegra_host->plat;
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500151 u32 ctrl;
152
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500153 ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
154 if (plat->is_8bit && bus_width == MMC_BUS_WIDTH_8) {
155 ctrl &= ~SDHCI_CTRL_4BITBUS;
156 ctrl |= SDHCI_CTRL_8BITBUS;
157 } else {
158 ctrl &= ~SDHCI_CTRL_8BITBUS;
159 if (bus_width == MMC_BUS_WIDTH_4)
160 ctrl |= SDHCI_CTRL_4BITBUS;
161 else
162 ctrl &= ~SDHCI_CTRL_4BITBUS;
163 }
164 sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
165 return 0;
166}
167
Shawn Guo85d65092011-05-27 23:48:12 +0800168static struct sdhci_ops tegra_sdhci_ops = {
169 .get_ro = tegra_sdhci_get_ro,
170 .read_l = tegra_sdhci_readl,
171 .read_w = tegra_sdhci_readw,
172 .write_l = tegra_sdhci_writel,
Sascha Hauer7bc088d2013-01-21 19:02:27 +0800173 .platform_bus_width = tegra_sdhci_buswidth,
Pavan Kunapulica5879d2012-04-18 18:48:02 +0530174 .platform_reset_exit = tegra_sdhci_reset_exit,
Shawn Guo85d65092011-05-27 23:48:12 +0800175};
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500176
Stephen Warren3e44a1a2012-02-01 16:30:55 -0700177#ifdef CONFIG_ARCH_TEGRA_2x_SOC
178static struct sdhci_pltfm_data sdhci_tegra20_pdata = {
Shawn Guo85d65092011-05-27 23:48:12 +0800179 .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
180 SDHCI_QUIRK_SINGLE_POWER_WRITE |
181 SDHCI_QUIRK_NO_HISPD_BIT |
182 SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC,
183 .ops = &tegra_sdhci_ops,
184};
185
Stephen Warren3e44a1a2012-02-01 16:30:55 -0700186static struct sdhci_tegra_soc_data soc_data_tegra20 = {
187 .pdata = &sdhci_tegra20_pdata,
188 .nvquirks = NVQUIRK_FORCE_SDHCI_SPEC_200 |
189 NVQUIRK_ENABLE_BLOCK_GAP_DET,
190};
191#endif
192
193#ifdef CONFIG_ARCH_TEGRA_3x_SOC
194static struct sdhci_pltfm_data sdhci_tegra30_pdata = {
195 .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
196 SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
197 SDHCI_QUIRK_SINGLE_POWER_WRITE |
198 SDHCI_QUIRK_NO_HISPD_BIT |
199 SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC,
200 .ops = &tegra_sdhci_ops,
201};
202
203static struct sdhci_tegra_soc_data soc_data_tegra30 = {
204 .pdata = &sdhci_tegra30_pdata,
Pavan Kunapulica5879d2012-04-18 18:48:02 +0530205 .nvquirks = NVQUIRK_ENABLE_SDHCI_SPEC_300,
Stephen Warren3e44a1a2012-02-01 16:30:55 -0700206};
207#endif
208
Bill Pemberton498d83e2012-11-19 13:24:22 -0500209static const struct of_device_id sdhci_tegra_dt_match[] = {
Stephen Warren3e44a1a2012-02-01 16:30:55 -0700210#ifdef CONFIG_ARCH_TEGRA_3x_SOC
211 { .compatible = "nvidia,tegra30-sdhci", .data = &soc_data_tegra30 },
212#endif
213#ifdef CONFIG_ARCH_TEGRA_2x_SOC
214 { .compatible = "nvidia,tegra20-sdhci", .data = &soc_data_tegra20 },
215#endif
Grant Likely275173b2011-08-23 12:15:33 -0600216 {}
217};
218MODULE_DEVICE_TABLE(of, sdhci_dt_ids);
219
Bill Pembertonc3be1ef2012-11-19 13:23:06 -0500220static struct tegra_sdhci_platform_data *sdhci_tegra_dt_parse_pdata(
Grant Likely275173b2011-08-23 12:15:33 -0600221 struct platform_device *pdev)
222{
223 struct tegra_sdhci_platform_data *plat;
224 struct device_node *np = pdev->dev.of_node;
Stephen Warrenc11bd552012-05-21 16:43:42 -0600225 u32 bus_width;
Grant Likely275173b2011-08-23 12:15:33 -0600226
227 if (!np)
228 return NULL;
229
230 plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL);
231 if (!plat) {
232 dev_err(&pdev->dev, "Can't allocate platform data\n");
233 return NULL;
234 }
235
236 plat->cd_gpio = of_get_named_gpio(np, "cd-gpios", 0);
237 plat->wp_gpio = of_get_named_gpio(np, "wp-gpios", 0);
238 plat->power_gpio = of_get_named_gpio(np, "power-gpios", 0);
Stephen Warrenc11bd552012-05-21 16:43:42 -0600239
240 if (of_property_read_u32(np, "bus-width", &bus_width) == 0 &&
241 bus_width == 8)
Stephen Warren55cd65e2011-08-30 13:17:16 -0600242 plat->is_8bit = 1;
Grant Likely275173b2011-08-23 12:15:33 -0600243
244 return plat;
245}
246
Bill Pembertonc3be1ef2012-11-19 13:23:06 -0500247static int sdhci_tegra_probe(struct platform_device *pdev)
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500248{
Stephen Warren3e44a1a2012-02-01 16:30:55 -0700249 const struct of_device_id *match;
250 const struct sdhci_tegra_soc_data *soc_data;
251 struct sdhci_host *host;
Shawn Guo85d65092011-05-27 23:48:12 +0800252 struct sdhci_pltfm_host *pltfm_host;
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500253 struct tegra_sdhci_platform_data *plat;
Stephen Warren3e44a1a2012-02-01 16:30:55 -0700254 struct sdhci_tegra *tegra_host;
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500255 struct clk *clk;
256 int rc;
257
Stephen Warren3e44a1a2012-02-01 16:30:55 -0700258 match = of_match_device(sdhci_tegra_dt_match, &pdev->dev);
Joseph Lob37f9d92012-08-17 15:04:31 +0800259 if (!match)
260 return -EINVAL;
261 soc_data = match->data;
Stephen Warren3e44a1a2012-02-01 16:30:55 -0700262
263 host = sdhci_pltfm_init(pdev, soc_data->pdata);
Shawn Guo85d65092011-05-27 23:48:12 +0800264 if (IS_ERR(host))
265 return PTR_ERR(host);
266
267 pltfm_host = sdhci_priv(host);
268
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500269 plat = pdev->dev.platform_data;
Shawn Guo85d65092011-05-27 23:48:12 +0800270
Grant Likely275173b2011-08-23 12:15:33 -0600271 if (plat == NULL)
272 plat = sdhci_tegra_dt_parse_pdata(pdev);
273
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500274 if (plat == NULL) {
275 dev_err(mmc_dev(host->mmc), "missing platform data\n");
Shawn Guo85d65092011-05-27 23:48:12 +0800276 rc = -ENXIO;
277 goto err_no_plat;
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500278 }
279
Stephen Warren3e44a1a2012-02-01 16:30:55 -0700280 tegra_host = devm_kzalloc(&pdev->dev, sizeof(*tegra_host), GFP_KERNEL);
281 if (!tegra_host) {
282 dev_err(mmc_dev(host->mmc), "failed to allocate tegra_host\n");
283 rc = -ENOMEM;
284 goto err_no_plat;
285 }
286
287 tegra_host->plat = plat;
288 tegra_host->soc_data = soc_data;
289
290 pltfm_host->priv = tegra_host;
Grant Likely275173b2011-08-23 12:15:33 -0600291
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500292 if (gpio_is_valid(plat->power_gpio)) {
293 rc = gpio_request(plat->power_gpio, "sdhci_power");
294 if (rc) {
295 dev_err(mmc_dev(host->mmc),
296 "failed to allocate power gpio\n");
Shawn Guo85d65092011-05-27 23:48:12 +0800297 goto err_power_req;
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500298 }
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500299 gpio_direction_output(plat->power_gpio, 1);
300 }
301
302 if (gpio_is_valid(plat->cd_gpio)) {
303 rc = gpio_request(plat->cd_gpio, "sdhci_cd");
304 if (rc) {
305 dev_err(mmc_dev(host->mmc),
306 "failed to allocate cd gpio\n");
Shawn Guo85d65092011-05-27 23:48:12 +0800307 goto err_cd_req;
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500308 }
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500309 gpio_direction_input(plat->cd_gpio);
310
311 rc = request_irq(gpio_to_irq(plat->cd_gpio), carddetect_irq,
312 IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
313 mmc_hostname(host->mmc), host);
314
315 if (rc) {
316 dev_err(mmc_dev(host->mmc), "request irq error\n");
Shawn Guo85d65092011-05-27 23:48:12 +0800317 goto err_cd_irq_req;
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500318 }
319
320 }
321
322 if (gpio_is_valid(plat->wp_gpio)) {
323 rc = gpio_request(plat->wp_gpio, "sdhci_wp");
324 if (rc) {
325 dev_err(mmc_dev(host->mmc),
326 "failed to allocate wp gpio\n");
Shawn Guo85d65092011-05-27 23:48:12 +0800327 goto err_wp_req;
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500328 }
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500329 gpio_direction_input(plat->wp_gpio);
330 }
331
332 clk = clk_get(mmc_dev(host->mmc), NULL);
333 if (IS_ERR(clk)) {
334 dev_err(mmc_dev(host->mmc), "clk err\n");
335 rc = PTR_ERR(clk);
Shawn Guo85d65092011-05-27 23:48:12 +0800336 goto err_clk_get;
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500337 }
Prashant Gaikwad1e674bc2012-06-05 09:59:37 +0530338 clk_prepare_enable(clk);
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500339 pltfm_host->clk = clk;
340
Venkat Raoc7f409e2011-03-25 20:37:47 -0400341 host->mmc->pm_caps = plat->pm_flags;
342
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500343 if (plat->is_8bit)
344 host->mmc->caps |= MMC_CAP_8_BIT_DATA;
345
Shawn Guo85d65092011-05-27 23:48:12 +0800346 rc = sdhci_add_host(host);
347 if (rc)
348 goto err_add_host;
349
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500350 return 0;
351
Shawn Guo85d65092011-05-27 23:48:12 +0800352err_add_host:
Prashant Gaikwad1e674bc2012-06-05 09:59:37 +0530353 clk_disable_unprepare(pltfm_host->clk);
Shawn Guo85d65092011-05-27 23:48:12 +0800354 clk_put(pltfm_host->clk);
355err_clk_get:
Stephen Warren3e215d02012-02-18 01:04:55 -0700356 if (gpio_is_valid(plat->wp_gpio))
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500357 gpio_free(plat->wp_gpio);
Shawn Guo85d65092011-05-27 23:48:12 +0800358err_wp_req:
Wolfram Sang8154b572011-02-10 18:07:30 +0100359 if (gpio_is_valid(plat->cd_gpio))
360 free_irq(gpio_to_irq(plat->cd_gpio), host);
Shawn Guo85d65092011-05-27 23:48:12 +0800361err_cd_irq_req:
Stephen Warren3e215d02012-02-18 01:04:55 -0700362 if (gpio_is_valid(plat->cd_gpio))
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500363 gpio_free(plat->cd_gpio);
Shawn Guo85d65092011-05-27 23:48:12 +0800364err_cd_req:
Stephen Warren3e215d02012-02-18 01:04:55 -0700365 if (gpio_is_valid(plat->power_gpio))
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500366 gpio_free(plat->power_gpio);
Shawn Guo85d65092011-05-27 23:48:12 +0800367err_power_req:
368err_no_plat:
369 sdhci_pltfm_free(pdev);
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500370 return rc;
371}
372
Bill Pemberton6e0ee712012-11-19 13:26:03 -0500373static int sdhci_tegra_remove(struct platform_device *pdev)
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500374{
Shawn Guo85d65092011-05-27 23:48:12 +0800375 struct sdhci_host *host = platform_get_drvdata(pdev);
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500376 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
Stephen Warren3e44a1a2012-02-01 16:30:55 -0700377 struct sdhci_tegra *tegra_host = pltfm_host->priv;
378 const struct tegra_sdhci_platform_data *plat = tegra_host->plat;
Shawn Guo85d65092011-05-27 23:48:12 +0800379 int dead = (readl(host->ioaddr + SDHCI_INT_STATUS) == 0xffffffff);
380
381 sdhci_remove_host(host, dead);
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500382
Stephen Warren3e215d02012-02-18 01:04:55 -0700383 if (gpio_is_valid(plat->wp_gpio))
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500384 gpio_free(plat->wp_gpio);
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500385
386 if (gpio_is_valid(plat->cd_gpio)) {
Wolfram Sang8154b572011-02-10 18:07:30 +0100387 free_irq(gpio_to_irq(plat->cd_gpio), host);
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500388 gpio_free(plat->cd_gpio);
389 }
390
Stephen Warren3e215d02012-02-18 01:04:55 -0700391 if (gpio_is_valid(plat->power_gpio))
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500392 gpio_free(plat->power_gpio);
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500393
Prashant Gaikwad1e674bc2012-06-05 09:59:37 +0530394 clk_disable_unprepare(pltfm_host->clk);
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500395 clk_put(pltfm_host->clk);
Shawn Guo85d65092011-05-27 23:48:12 +0800396
397 sdhci_pltfm_free(pdev);
398
399 return 0;
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500400}
401
Shawn Guo85d65092011-05-27 23:48:12 +0800402static struct platform_driver sdhci_tegra_driver = {
403 .driver = {
404 .name = "sdhci-tegra",
405 .owner = THIS_MODULE,
Grant Likely275173b2011-08-23 12:15:33 -0600406 .of_match_table = sdhci_tegra_dt_match,
Manuel Lauss29495aa2011-11-03 11:09:45 +0100407 .pm = SDHCI_PLTFM_PMOPS,
Shawn Guo85d65092011-05-27 23:48:12 +0800408 },
409 .probe = sdhci_tegra_probe,
Bill Pemberton0433c142012-11-19 13:20:26 -0500410 .remove = sdhci_tegra_remove,
Olof Johansson03d2bfc2011-01-01 23:52:56 -0500411};
412
Axel Lind1f81a62011-11-26 12:55:43 +0800413module_platform_driver(sdhci_tegra_driver);
Shawn Guo85d65092011-05-27 23:48:12 +0800414
415MODULE_DESCRIPTION("SDHCI driver for Tegra");
Stephen Warren3e44a1a2012-02-01 16:30:55 -0700416MODULE_AUTHOR("Google, Inc.");
Shawn Guo85d65092011-05-27 23:48:12 +0800417MODULE_LICENSE("GPL v2");