blob: 4c05b39810e27f49bd26e36189e5fd07861a8ec2 [file] [log] [blame]
Ben Dooks5b323c72008-10-31 16:14:28 +00001/* linux/arch/arm/plat-s3c/dev-hsmmc.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 devices
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>
Ben Dooks5cc7fd82008-10-31 16:14:38 +000016#include <linux/mmc/host.h>
Ben Dooks5b323c72008-10-31 16:14:28 +000017
18#include <mach/map.h>
Ben Dooks5cc7fd82008-10-31 16:14:38 +000019#include <plat/sdhci.h>
Ben Dooks5b323c72008-10-31 16:14:28 +000020#include <plat/devs.h>
21#include <plat/cpu.h>
22
23#define S3C_SZ_HSMMC (0x1000)
24
25static struct resource s3c_hsmmc_resource[] = {
26 [0] = {
27 .start = S3C_PA_HSMMC0,
28 .end = S3C_PA_HSMMC0 + S3C_SZ_HSMMC - 1,
29 .flags = IORESOURCE_MEM,
30 },
31 [1] = {
32 .start = IRQ_HSMMC0,
33 .end = IRQ_HSMMC0,
34 .flags = IORESOURCE_IRQ,
35 }
36};
37
38static u64 s3c_device_hsmmc_dmamask = 0xffffffffUL;
39
Ben Dooks5cc7fd82008-10-31 16:14:38 +000040struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata = {
41 .max_width = 4,
42 .host_caps = (MMC_CAP_4_BIT_DATA |
43 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
Ben Dooks5b323c72008-10-31 16:14:28 +000044};
Ben Dooks5cc7fd82008-10-31 16:14:38 +000045
46struct platform_device s3c_device_hsmmc0 = {
47 .name = "s3c-sdhci",
48 .id = 0,
49 .num_resources = ARRAY_SIZE(s3c_hsmmc_resource),
50 .resource = s3c_hsmmc_resource,
51 .dev = {
52 .dma_mask = &s3c_device_hsmmc_dmamask,
53 .coherent_dma_mask = 0xffffffffUL,
54 .platform_data = &s3c_hsmmc0_def_platdata,
55 },
56};
57
58void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd)
59{
60 struct s3c_sdhci_platdata *set = &s3c_hsmmc0_def_platdata;
61
62 set->max_width = pd->max_width;
63
64 if (pd->cfg_gpio)
65 set->cfg_gpio = pd->cfg_gpio;
66 if (pd->cfg_card)
67 set->cfg_card = pd->cfg_card;
68}