dev-hsmmc1.c 2.0 KB

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