mmc-omap.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. * MMC definitions for OMAP2
  3. *
  4. * Copyright (C) 2006 Nokia Corporation
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #define OMAP_MMC_MAX_SLOTS 2
  11. struct mmc_card;
  12. struct omap_mmc_platform_data {
  13. /* back-link to device */
  14. struct device *dev;
  15. /* number of slots per controller */
  16. unsigned nr_slots:2;
  17. /* set if your board has components or wiring that limits the
  18. * maximum frequency on the MMC bus */
  19. unsigned int max_freq;
  20. /* switch the bus to a new slot */
  21. int (*switch_slot)(struct device *dev, int slot);
  22. /* initialize board-specific MMC functionality, can be NULL if
  23. * not supported */
  24. int (*init)(struct device *dev);
  25. void (*cleanup)(struct device *dev);
  26. void (*shutdown)(struct device *dev);
  27. /* Return context loss count due to PM states changing */
  28. int (*get_context_loss_count)(struct device *dev);
  29. /* Integrating attributes from the omap_hwmod layer */
  30. u8 controller_flags;
  31. /* Register offset deviation */
  32. u16 reg_offset;
  33. struct omap_mmc_slot_data {
  34. /*
  35. * 4/8 wires and any additional host capabilities
  36. * need to OR'd all capabilities (ref. linux/mmc/host.h)
  37. */
  38. u8 wires; /* Used for the MMC driver on omap1 and 2420 */
  39. u32 caps; /* Used for the MMC driver on 2430 and later */
  40. u32 pm_caps; /* PM capabilities of the mmc */
  41. /*
  42. * nomux means "standard" muxing is wrong on this board, and
  43. * that board-specific code handled it before common init logic.
  44. */
  45. unsigned nomux:1;
  46. /* switch pin can be for card detect (default) or card cover */
  47. unsigned cover:1;
  48. /* use the internal clock */
  49. unsigned internal_clock:1;
  50. /* nonremovable e.g. eMMC */
  51. unsigned nonremovable:1;
  52. /* Try to sleep or power off when possible */
  53. unsigned power_saving:1;
  54. /* If using power_saving and the MMC power is not to go off */
  55. unsigned no_off:1;
  56. /* eMMC does not handle power off when not in sleep state */
  57. unsigned no_regulator_off_init:1;
  58. /* Regulator off remapped to sleep */
  59. unsigned vcc_aux_disable_is_sleep:1;
  60. /* we can put the features above into this variable */
  61. #define MMC_OMAP7XX (1 << 3)
  62. #define MMC_OMAP15XX (1 << 4)
  63. #define MMC_OMAP16XX (1 << 5)
  64. unsigned features;
  65. int switch_pin; /* gpio (card detect) */
  66. int gpio_wp; /* gpio (write protect) */
  67. int (*set_bus_mode)(struct device *dev, int slot, int bus_mode);
  68. int (*set_power)(struct device *dev, int slot,
  69. int power_on, int vdd);
  70. int (*get_ro)(struct device *dev, int slot);
  71. void (*remux)(struct device *dev, int slot, int power_on);
  72. /* Call back before enabling / disabling regulators */
  73. void (*before_set_reg)(struct device *dev, int slot,
  74. int power_on, int vdd);
  75. /* Call back after enabling / disabling regulators */
  76. void (*after_set_reg)(struct device *dev, int slot,
  77. int power_on, int vdd);
  78. /* if we have special card, init it using this callback */
  79. void (*init_card)(struct mmc_card *card);
  80. /* return MMC cover switch state, can be NULL if not supported.
  81. *
  82. * possible return values:
  83. * 0 - closed
  84. * 1 - open
  85. */
  86. int (*get_cover_state)(struct device *dev, int slot);
  87. const char *name;
  88. u32 ocr_mask;
  89. /* Card detection IRQs */
  90. int card_detect_irq;
  91. int (*card_detect)(struct device *dev, int slot);
  92. unsigned int ban_openended:1;
  93. } slots[OMAP_MMC_MAX_SLOTS];
  94. };