blob: 2497321f08d7ddc3a17fb3e9eedb6293cbb6df97 [file] [log] [blame]
Ben Dooksa2205cd2008-10-31 16:14:39 +00001/* linux/arch/arm/plat-s3c/dev-hsmmc1.c
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for hsmmc device 1
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 version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/platform_device.h>
16#include <linux/mmc/host.h>
17
18#include <mach/map.h>
19#include <plat/sdhci.h>
20#include <plat/devs.h>
21#include <plat/cpu.h>
22
23#define S3C_SZ_HSMMC (0x1000)
24
25static struct resource s3c_hsmmc1_resource[] = {
26 [0] = {
27 .start = S3C_PA_HSMMC1,
28 .end = S3C_PA_HSMMC1 + S3C_SZ_HSMMC - 1,
29 .flags = IORESOURCE_MEM,
30 },
31 [1] = {
32 .start = IRQ_HSMMC1,
33 .end = IRQ_HSMMC1,
34 .flags = IORESOURCE_IRQ,
35 }
36};
37
38static u64 s3c_device_hsmmc1_dmamask = 0xffffffffUL;
39
40struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata = {
41 .max_width = 4,
42 .host_caps = (MMC_CAP_4_BIT_DATA |
43 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
Jeongbae Seo28c80aa2010-10-08 18:03:27 +090044 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
Ben Dooksa2205cd2008-10-31 16:14:39 +000045};
46
47struct platform_device s3c_device_hsmmc1 = {
48 .name = "s3c-sdhci",
49 .id = 1,
50 .num_resources = ARRAY_SIZE(s3c_hsmmc1_resource),
51 .resource = s3c_hsmmc1_resource,
52 .dev = {
53 .dma_mask = &s3c_device_hsmmc1_dmamask,
54 .coherent_dma_mask = 0xffffffffUL,
55 .platform_data = &s3c_hsmmc1_def_platdata,
56 },
57};
58
59void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd)
60{
61 struct s3c_sdhci_platdata *set = &s3c_hsmmc1_def_platdata;
62
Marek Szyprowski19206b172010-07-23 09:27:18 +090063 set->cd_type = pd->cd_type;
64 set->ext_cd_init = pd->ext_cd_init;
65 set->ext_cd_cleanup = pd->ext_cd_cleanup;
66 set->ext_cd_gpio = pd->ext_cd_gpio;
67 set->ext_cd_gpio_invert = pd->ext_cd_gpio_invert;
Ben Dooksa2205cd2008-10-31 16:14:39 +000068
Hyuk Lee40fcd5b2010-10-08 18:03:23 +090069 if (pd->max_width)
70 set->max_width = pd->max_width;
Ben Dooksa2205cd2008-10-31 16:14:39 +000071 if (pd->cfg_gpio)
72 set->cfg_gpio = pd->cfg_gpio;
73 if (pd->cfg_card)
74 set->cfg_card = pd->cfg_card;
Kyungmin Park944645c2010-08-19 14:13:34 -070075 if (pd->host_caps)
Hyuk Lee40fcd5b2010-10-08 18:03:23 +090076 set->host_caps |= pd->host_caps;
Jeongbae Seo28c80aa2010-10-08 18:03:27 +090077 if (pd->clk_type)
78 set->clk_type = pd->clk_type;
Ben Dooksa2205cd2008-10-31 16:14:39 +000079}