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/ioport.h>
20 #include <linux/mmc/dw_mmc.h>
22 #include <plat/devs.h>
26 static int exynos4_dwmci_get_bus_wd(u32 slot_id
)
31 static int exynos4_dwmci_init(u32 slot_id
, irq_handler_t handler
, void *data
)
36 static struct resource exynos4_dwmci_resource
[] = {
37 [0] = DEFINE_RES_MEM(EXYNOS4_PA_DWMCI
, SZ_4K
),
38 [1] = DEFINE_RES_IRQ(EXYNOS4_IRQ_DWMCI
),
41 static struct dw_mci_board exynos4_dwci_pdata
= {
43 .quirks
= DW_MCI_QUIRK_BROKEN_CARD_DETECTION
,
44 .bus_hz
= 80 * 1000 * 1000,
45 .detect_delay_ms
= 200,
46 .init
= exynos4_dwmci_init
,
47 .get_bus_wd
= exynos4_dwmci_get_bus_wd
,
50 static u64 exynos4_dwmci_dmamask
= DMA_BIT_MASK(32);
52 struct platform_device exynos4_device_dwmci
= {
55 .num_resources
= ARRAY_SIZE(exynos4_dwmci_resource
),
56 .resource
= exynos4_dwmci_resource
,
58 .dma_mask
= &exynos4_dwmci_dmamask
,
59 .coherent_dma_mask
= DMA_BIT_MASK(32),
60 .platform_data
= &exynos4_dwci_pdata
,
64 void __init
exynos4_dwmci_set_platdata(struct dw_mci_board
*pd
)
66 struct dw_mci_board
*npd
;
68 npd
= s3c_set_platdata(pd
, sizeof(struct dw_mci_board
),
69 &exynos4_device_dwmci
);
72 npd
->init
= exynos4_dwmci_init
;
74 npd
->get_bus_wd
= exynos4_dwmci_get_bus_wd
;