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>
25 static int exynos4_dwmci_get_bus_wd(u32 slot_id
)
30 static int exynos4_dwmci_init(u32 slot_id
, irq_handler_t handler
, void *data
)
35 static struct resource exynos4_dwmci_resource
[] = {
37 .start
= EXYNOS4_PA_DWMCI
,
38 .end
= EXYNOS4_PA_DWMCI
+ SZ_4K
- 1,
39 .flags
= IORESOURCE_MEM
,
44 .flags
= IORESOURCE_IRQ
,
48 static struct dw_mci_board exynos4_dwci_pdata
= {
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
= {
62 .num_resources
= ARRAY_SIZE(exynos4_dwmci_resource
),
63 .resource
= exynos4_dwmci_resource
,
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
);
79 npd
->init
= exynos4_dwmci_init
;
81 npd
->get_bus_wd
= exynos4_dwmci_get_bus_wd
;