dev-hsmmc2.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* linux/arch/arm/plat-s3c/dev-hsmmc2.c
  2. *
  3. * Copyright (c) 2009 Samsung Electronics
  4. * Copyright (c) 2009 Maurus Cuelenaere
  5. *
  6. * Based on arch/arm/plat-s3c/dev-hsmmc1.c
  7. * original file Copyright (c) 2008 Simtec Electronics
  8. *
  9. * S3C series device definition for hsmmc device 2
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. */
  15. #include <linux/kernel.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/mmc/host.h>
  18. #include <mach/map.h>
  19. #include <plat/sdhci.h>
  20. #include <plat/devs.h>
  21. #define S3C_SZ_HSMMC (0x1000)
  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. static u64 s3c_device_hsmmc2_dmamask = 0xffffffffUL;
  35. struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata = {
  36. .max_width = 4,
  37. .host_caps = (MMC_CAP_4_BIT_DATA |
  38. MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
  39. };
  40. struct platform_device s3c_device_hsmmc2 = {
  41. .name = "s3c-sdhci",
  42. .id = 2,
  43. .num_resources = ARRAY_SIZE(s3c_hsmmc2_resource),
  44. .resource = s3c_hsmmc2_resource,
  45. .dev = {
  46. .dma_mask = &s3c_device_hsmmc2_dmamask,
  47. .coherent_dma_mask = 0xffffffffUL,
  48. .platform_data = &s3c_hsmmc2_def_platdata,
  49. },
  50. };
  51. void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
  52. {
  53. struct s3c_sdhci_platdata *set = &s3c_hsmmc2_def_platdata;
  54. set->max_width = pd->max_width;
  55. if (pd->cfg_gpio)
  56. set->cfg_gpio = pd->cfg_gpio;
  57. if (pd->cfg_card)
  58. set->cfg_card = pd->cfg_card;
  59. }