dev-hsmmc3.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. #include <linux/kernel.h>
  19. #include <linux/platform_device.h>
  20. #include <linux/mmc/host.h>
  21. #include <mach/map.h>
  22. #include <plat/sdhci.h>
  23. #include <plat/devs.h>
  24. #define S3C_SZ_HSMMC (0x1000)
  25. static struct resource s3c_hsmmc3_resource[] = {
  26. [0] = {
  27. .start = S3C_PA_HSMMC3,
  28. .end = S3C_PA_HSMMC3 + S3C_SZ_HSMMC - 1,
  29. .flags = IORESOURCE_MEM,
  30. },
  31. [1] = {
  32. .start = IRQ_HSMMC3,
  33. .end = IRQ_HSMMC3,
  34. .flags = IORESOURCE_IRQ,
  35. }
  36. };
  37. static u64 s3c_device_hsmmc3_dmamask = 0xffffffffUL;
  38. struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata = {
  39. .max_width = 4,
  40. .host_caps = (MMC_CAP_4_BIT_DATA |
  41. MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
  42. .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
  43. };
  44. struct platform_device s3c_device_hsmmc3 = {
  45. .name = "s3c-sdhci",
  46. .id = 3,
  47. .num_resources = ARRAY_SIZE(s3c_hsmmc3_resource),
  48. .resource = s3c_hsmmc3_resource,
  49. .dev = {
  50. .dma_mask = &s3c_device_hsmmc3_dmamask,
  51. .coherent_dma_mask = 0xffffffffUL,
  52. .platform_data = &s3c_hsmmc3_def_platdata,
  53. },
  54. };
  55. void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd)
  56. {
  57. struct s3c_sdhci_platdata *set = &s3c_hsmmc3_def_platdata;
  58. set->cd_type = pd->cd_type;
  59. set->ext_cd_init = pd->ext_cd_init;
  60. set->ext_cd_cleanup = pd->ext_cd_cleanup;
  61. set->ext_cd_gpio = pd->ext_cd_gpio;
  62. set->ext_cd_gpio_invert = pd->ext_cd_gpio_invert;
  63. if (pd->max_width)
  64. set->max_width = pd->max_width;
  65. if (pd->cfg_gpio)
  66. set->cfg_gpio = pd->cfg_gpio;
  67. if (pd->cfg_card)
  68. set->cfg_card = pd->cfg_card;
  69. if (pd->host_caps)
  70. set->host_caps |= pd->host_caps;
  71. if (pd->clk_type)
  72. set->clk_type = pd->clk_type;
  73. }