Hyuk Lee | b3c674b | 2010-06-10 15:22:16 +0900 | [diff] [blame] | 1 | /* linux/arch/arm/plat-samsung/dev-hsmmc3.c |
| 2 | * |
| 3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. |
| 4 | * http://www.samsung.com |
| 5 | * |
| 6 | * Copyright (c) 2008 Simtec Electronics |
| 7 | * Ben Dooks <ben@simtec.co.uk> |
| 8 | * http://armlinux.simtec.co.uk/ |
| 9 | * |
| 10 | * Based on arch/arm/plat-samsung/dev-hsmmc1.c |
| 11 | * |
| 12 | * Samsung device definition for hsmmc device 3 |
| 13 | * |
| 14 | * This program is free software; you can redistribute it and/or modify |
| 15 | * it under the terms of the GNU General Public License version 2 as |
| 16 | * published by the Free Software Foundation. |
| 17 | */ |
| 18 | |
| 19 | #include <linux/kernel.h> |
| 20 | #include <linux/platform_device.h> |
| 21 | #include <linux/mmc/host.h> |
| 22 | |
| 23 | #include <mach/map.h> |
| 24 | #include <plat/sdhci.h> |
| 25 | #include <plat/devs.h> |
| 26 | |
| 27 | #define S3C_SZ_HSMMC (0x1000) |
| 28 | |
| 29 | static struct resource s3c_hsmmc3_resource[] = { |
| 30 | [0] = { |
| 31 | .start = S3C_PA_HSMMC3, |
| 32 | .end = S3C_PA_HSMMC3 + S3C_SZ_HSMMC - 1, |
| 33 | .flags = IORESOURCE_MEM, |
| 34 | }, |
| 35 | [1] = { |
Kukjin Kim | eda9c02 | 2010-08-20 21:09:18 +0900 | [diff] [blame] | 36 | .start = IRQ_HSMMC3, |
| 37 | .end = IRQ_HSMMC3, |
Hyuk Lee | b3c674b | 2010-06-10 15:22:16 +0900 | [diff] [blame] | 38 | .flags = IORESOURCE_IRQ, |
| 39 | } |
| 40 | }; |
| 41 | |
| 42 | static u64 s3c_device_hsmmc3_dmamask = 0xffffffffUL; |
| 43 | |
| 44 | struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata = { |
| 45 | .max_width = 4, |
| 46 | .host_caps = (MMC_CAP_4_BIT_DATA | |
| 47 | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED), |
Jeongbae Seo | 28c80aa | 2010-10-08 18:03:27 +0900 | [diff] [blame] | 48 | .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL, |
Hyuk Lee | b3c674b | 2010-06-10 15:22:16 +0900 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | struct platform_device s3c_device_hsmmc3 = { |
| 52 | .name = "s3c-sdhci", |
| 53 | .id = 3, |
| 54 | .num_resources = ARRAY_SIZE(s3c_hsmmc3_resource), |
| 55 | .resource = s3c_hsmmc3_resource, |
| 56 | .dev = { |
| 57 | .dma_mask = &s3c_device_hsmmc3_dmamask, |
| 58 | .coherent_dma_mask = 0xffffffffUL, |
| 59 | .platform_data = &s3c_hsmmc3_def_platdata, |
| 60 | }, |
| 61 | }; |
| 62 | |
| 63 | void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd) |
| 64 | { |
| 65 | struct s3c_sdhci_platdata *set = &s3c_hsmmc3_def_platdata; |
| 66 | |
Marek Szyprowski | 19206b1 | 2010-07-23 09:27:18 +0900 | [diff] [blame] | 67 | set->cd_type = pd->cd_type; |
| 68 | set->ext_cd_init = pd->ext_cd_init; |
| 69 | set->ext_cd_cleanup = pd->ext_cd_cleanup; |
| 70 | set->ext_cd_gpio = pd->ext_cd_gpio; |
| 71 | set->ext_cd_gpio_invert = pd->ext_cd_gpio_invert; |
Hyuk Lee | b3c674b | 2010-06-10 15:22:16 +0900 | [diff] [blame] | 72 | |
Hyuk Lee | 40fcd5b | 2010-10-08 18:03:23 +0900 | [diff] [blame] | 73 | if (pd->max_width) |
| 74 | set->max_width = pd->max_width; |
Hyuk Lee | b3c674b | 2010-06-10 15:22:16 +0900 | [diff] [blame] | 75 | if (pd->cfg_gpio) |
| 76 | set->cfg_gpio = pd->cfg_gpio; |
| 77 | if (pd->cfg_card) |
| 78 | set->cfg_card = pd->cfg_card; |
Hyuk Lee | 40fcd5b | 2010-10-08 18:03:23 +0900 | [diff] [blame] | 79 | if (pd->host_caps) |
| 80 | set->host_caps |= pd->host_caps; |
Jeongbae Seo | 28c80aa | 2010-10-08 18:03:27 +0900 | [diff] [blame] | 81 | if (pd->clk_type) |
| 82 | set->clk_type = pd->clk_type; |
Hyuk Lee | b3c674b | 2010-06-10 15:22:16 +0900 | [diff] [blame] | 83 | } |