diff options
Diffstat (limited to 'arch/arm/mach-exynos4/dev-dwmci.c')
-rw-r--r-- | arch/arm/mach-exynos4/dev-dwmci.c | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos4/dev-dwmci.c b/arch/arm/mach-exynos4/dev-dwmci.c new file mode 100644 index 000000000000..b025db4bf602 --- /dev/null +++ b/arch/arm/mach-exynos4/dev-dwmci.c | |||
@@ -0,0 +1,82 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-exynos4/dev-dwmci.c | ||
3 | * | ||
4 | * Copyright (c) 2011 Samsung Electronics Co., Ltd. | ||
5 | * http://www.samsung.com | ||
6 | * | ||
7 | * Platform device for Synopsys DesignWare Mobile Storage IP | ||
8 | * | ||
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. | ||
13 | */ | ||
14 | |||
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> | ||
20 | |||
21 | #include <plat/devs.h> | ||
22 | |||
23 | #include <mach/map.h> | ||
24 | |||
25 | static int exynos4_dwmci_get_bus_wd(u32 slot_id) | ||
26 | { | ||
27 | return 4; | ||
28 | } | ||
29 | |||
30 | static int exynos4_dwmci_init(u32 slot_id, irq_handler_t handler, void *data) | ||
31 | { | ||
32 | return 0; | ||
33 | } | ||
34 | |||
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, | ||
40 | }, | ||
41 | [1] = { | ||
42 | .start = IRQ_DWMCI, | ||
43 | .end = IRQ_DWMCI, | ||
44 | .flags = IORESOURCE_IRQ, | ||
45 | } | ||
46 | }; | ||
47 | |||
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, | ||
55 | }; | ||
56 | |||
57 | static u64 exynos4_dwmci_dmamask = DMA_BIT_MASK(32); | ||
58 | |||
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, | ||
68 | }, | ||
69 | }; | ||
70 | |||
71 | void __init exynos4_dwmci_set_platdata(struct dw_mci_board *pd) | ||
72 | { | ||
73 | struct dw_mci_board *npd; | ||
74 | |||
75 | npd = s3c_set_platdata(pd, sizeof(struct dw_mci_board), | ||
76 | &exynos4_device_dwmci); | ||
77 | |||
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; | ||
82 | } | ||