diff options
author | Kyungmin Park <kyungmin.park@samsung.com> | 2009-11-17 02:41:23 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2009-11-30 20:33:17 -0500 |
commit | 86cd4f5f83acbfa481c513c74666ad360b49d73b (patch) | |
tree | fadf026dc26dc06b7d6fc3d8405aa96795db23e9 /arch/arm/plat-s3c/dev-hsmmc2.c | |
parent | 067f131d09d89bd56864f1f4b3144cc778024b33 (diff) |
ARM: S5PC1xx: add platform helpers for SDHCI host controllers
Samsung S5PC100 has 3 SDHCI controllers compatible with the one known from
previous SoCs series. Add required platform setup and support code that
the devices can be used with sdhci-s3c driver.
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s3c/dev-hsmmc2.c')
-rw-r--r-- | arch/arm/plat-s3c/dev-hsmmc2.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c/dev-hsmmc2.c b/arch/arm/plat-s3c/dev-hsmmc2.c new file mode 100644 index 000000000000..082e55a78ad7 --- /dev/null +++ b/arch/arm/plat-s3c/dev-hsmmc2.c | |||
@@ -0,0 +1,65 @@ | |||
1 | /* linux/arch/arm/plat-s3c/dev-hsmmc2.c | ||
2 | * | ||
3 | * Copyright (c) 2009 Samsung Electronics | ||
4 | * | ||
5 | * S3C series device definition for hsmmc device 2 | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/mmc/host.h> | ||
15 | |||
16 | #include <mach/map.h> | ||
17 | #include <plat/sdhci.h> | ||
18 | #include <plat/devs.h> | ||
19 | |||
20 | #define S3C_SZ_HSMMC (0x1000) | ||
21 | |||
22 | static struct resource s3c_hsmmc2_resource[] = { | ||
23 | [0] = { | ||
24 | .start = S3C_PA_HSMMC2, | ||
25 | .end = S3C_PA_HSMMC2 + S3C_SZ_HSMMC - 1, | ||
26 | .flags = IORESOURCE_MEM, | ||
27 | }, | ||
28 | [1] = { | ||
29 | .start = IRQ_HSMMC2, | ||
30 | .end = IRQ_HSMMC2, | ||
31 | .flags = IORESOURCE_IRQ, | ||
32 | } | ||
33 | }; | ||
34 | |||
35 | static u64 s3c_device_hsmmc2_dmamask = 0xffffffffUL; | ||
36 | |||
37 | struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata = { | ||
38 | .max_width = 4, | ||
39 | .host_caps = (MMC_CAP_4_BIT_DATA | | ||
40 | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED), | ||
41 | }; | ||
42 | |||
43 | struct platform_device s3c_device_hsmmc2 = { | ||
44 | .name = "s3c-sdhci", | ||
45 | .id = 2, | ||
46 | .num_resources = ARRAY_SIZE(s3c_hsmmc2_resource), | ||
47 | .resource = s3c_hsmmc2_resource, | ||
48 | .dev = { | ||
49 | .dma_mask = &s3c_device_hsmmc2_dmamask, | ||
50 | .coherent_dma_mask = 0xffffffffUL, | ||
51 | .platform_data = &s3c_hsmmc2_def_platdata, | ||
52 | }, | ||
53 | }; | ||
54 | |||
55 | void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd) | ||
56 | { | ||
57 | struct s3c_sdhci_platdata *set = &s3c_hsmmc2_def_platdata; | ||
58 | |||
59 | set->max_width = pd->max_width; | ||
60 | |||
61 | if (pd->cfg_gpio) | ||
62 | set->cfg_gpio = pd->cfg_gpio; | ||
63 | if (pd->cfg_card) | ||
64 | set->cfg_card = pd->cfg_card; | ||
65 | } | ||