Add linux-next specific files for 20110831
[linux-2.6/next.git] / arch / arm / mach-exynos4 / dev-dwmci.c
blobb025db4bf602380e465402381a270668ece4b41f
1 /*
2 * linux/arch/arm/mach-exynos4/dev-dwmci.c
4 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com
7 * Platform device for Synopsys DesignWare Mobile Storage IP
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
15 #include <linux/kernel.h>
16 #include <linux/dma-mapping.h>
17 #include <linux/platform_device.h>
18 #include <linux/interrupt.h>
19 #include <linux/mmc/dw_mmc.h>
21 #include <plat/devs.h>
23 #include <mach/map.h>
25 static int exynos4_dwmci_get_bus_wd(u32 slot_id)
27 return 4;
30 static int exynos4_dwmci_init(u32 slot_id, irq_handler_t handler, void *data)
32 return 0;
35 static struct resource exynos4_dwmci_resource[] = {
36 [0] = {
37 .start = EXYNOS4_PA_DWMCI,
38 .end = EXYNOS4_PA_DWMCI + SZ_4K - 1,
39 .flags = IORESOURCE_MEM,
41 [1] = {
42 .start = IRQ_DWMCI,
43 .end = IRQ_DWMCI,
44 .flags = IORESOURCE_IRQ,
48 static struct dw_mci_board exynos4_dwci_pdata = {
49 .num_slots = 1,
50 .quirks = DW_MCI_QUIRK_BROKEN_CARD_DETECTION,
51 .bus_hz = 80 * 1000 * 1000,
52 .detect_delay_ms = 200,
53 .init = exynos4_dwmci_init,
54 .get_bus_wd = exynos4_dwmci_get_bus_wd,
57 static u64 exynos4_dwmci_dmamask = DMA_BIT_MASK(32);
59 struct platform_device exynos4_device_dwmci = {
60 .name = "dw_mmc",
61 .id = -1,
62 .num_resources = ARRAY_SIZE(exynos4_dwmci_resource),
63 .resource = exynos4_dwmci_resource,
64 .dev = {
65 .dma_mask = &exynos4_dwmci_dmamask,
66 .coherent_dma_mask = DMA_BIT_MASK(32),
67 .platform_data = &exynos4_dwci_pdata,
71 void __init exynos4_dwmci_set_platdata(struct dw_mci_board *pd)
73 struct dw_mci_board *npd;
75 npd = s3c_set_platdata(pd, sizeof(struct dw_mci_board),
76 &exynos4_device_dwmci);
78 if (!npd->init)
79 npd->init = exynos4_dwmci_init;
80 if (!npd->get_bus_wd)
81 npd->get_bus_wd = exynos4_dwmci_get_bus_wd;