mmc-omap.h 3.3 KB

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