mmc.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /*
  2. * arch/arm/include/asm/mach/mmc.h
  3. */
  4. #ifndef ASMARM_MACH_MMC_H
  5. #define ASMARM_MACH_MMC_H
  6. #include <linux/mmc/host.h>
  7. #include <linux/mmc/card.h>
  8. #include <linux/mmc/sdio_func.h>
  9. #include <mach/gpio.h>
  10. #include <mach/msm_bus.h>
  11. #define SDC_DAT1_DISABLE 0
  12. #define SDC_DAT1_ENABLE 1
  13. #define SDC_DAT1_ENWAKE 2
  14. #define SDC_DAT1_DISWAKE 3
  15. struct embedded_sdio_data {
  16. struct sdio_cis cis;
  17. struct sdio_cccr cccr;
  18. struct sdio_embedded_func *funcs;
  19. int num_funcs;
  20. };
  21. /* This structure keeps information per regulator */
  22. struct msm_mmc_reg_data {
  23. /* voltage regulator handle */
  24. struct regulator *reg;
  25. /* regulator name */
  26. const char *name;
  27. /* voltage level to be set */
  28. unsigned int low_vol_level;
  29. unsigned int high_vol_level;
  30. /* Load values for low power and high power mode */
  31. unsigned int lpm_uA;
  32. unsigned int hpm_uA;
  33. /*
  34. * is set voltage supported for this regulator?
  35. * false => set voltage is not supported
  36. * true => set voltage is supported
  37. *
  38. * Some regulators (like gpio-regulators, LVS (low voltage swtiches)
  39. * PMIC regulators) dont have the capability to call
  40. * regulator_set_voltage or regulator_set_optimum_mode
  41. * Use this variable to indicate if its a such regulator or not
  42. */
  43. bool set_voltage_sup;
  44. /* is this regulator enabled? */
  45. bool is_enabled;
  46. /* is this regulator needs to be always on? */
  47. bool always_on;
  48. /* is low power mode setting required for this regulator? */
  49. bool lpm_sup;
  50. /*
  51. * Use to indicate if the regulator should be reset at boot time.
  52. * Its needed only when sd card's vdd regulator is always on
  53. * since always on regulators dont get reset at boot time.
  54. *
  55. * It is needed for sd 3.0 card to be detected as a sd 3.0 card
  56. * on device reboot.
  57. */
  58. bool reset_at_init;
  59. };
  60. /*
  61. * This structure keeps information for all the
  62. * regulators required for a SDCC slot.
  63. */
  64. struct msm_mmc_slot_reg_data {
  65. struct msm_mmc_reg_data *vdd_data; /* keeps VDD/VCC regulator info */
  66. struct msm_mmc_reg_data *vdd_io_data; /* keeps VDD IO regulator info */
  67. };
  68. struct msm_mmc_gpio {
  69. u32 no;
  70. const char *name;
  71. bool is_always_on;
  72. bool is_enabled;
  73. };
  74. struct msm_mmc_gpio_data {
  75. struct msm_mmc_gpio *gpio;
  76. u8 size;
  77. };
  78. struct msm_mmc_pad_pull {
  79. enum msm_tlmm_pull_tgt no;
  80. u32 val;
  81. };
  82. struct msm_mmc_pad_pull_data {
  83. struct msm_mmc_pad_pull *on;
  84. struct msm_mmc_pad_pull *off;
  85. u8 size;
  86. };
  87. struct msm_mmc_pad_drv {
  88. enum msm_tlmm_hdrive_tgt no;
  89. u32 val;
  90. };
  91. struct msm_mmc_pad_drv_data {
  92. struct msm_mmc_pad_drv *on;
  93. struct msm_mmc_pad_drv *off;
  94. u8 size;
  95. };
  96. struct msm_mmc_pad_data {
  97. struct msm_mmc_pad_pull_data *pull;
  98. struct msm_mmc_pad_drv_data *drv;
  99. };
  100. struct msm_mmc_pin_data {
  101. /*
  102. * = 1 if controller pins are using gpios
  103. * = 0 if controller has dedicated MSM pads
  104. */
  105. u8 is_gpio;
  106. u8 cfg_sts;
  107. struct msm_mmc_gpio_data *gpio_data;
  108. struct msm_mmc_pad_data *pad_data;
  109. };
  110. struct msm_mmc_bus_voting_data {
  111. struct msm_bus_scale_pdata *use_cases;
  112. unsigned int *bw_vecs;
  113. unsigned int bw_vecs_size;
  114. };
  115. struct mmc_platform_data {
  116. unsigned int ocr_mask; /* available voltages */
  117. int built_in; /* built-in device flag */
  118. int card_present; /* card detect state */
  119. u32 (*translate_vdd)(struct device *, unsigned int);
  120. unsigned int (*status)(struct device *);
  121. struct embedded_sdio_data *embedded_sdio;
  122. int (*register_status_notify)(void (*callback)(int card_present, void *dev_id), void *dev_id, void *mmc_host);
  123. /*
  124. * XPC controls the maximum current in the
  125. * default speed mode of SDXC card.
  126. */
  127. unsigned int xpc_cap;
  128. /* Supported UHS-I Modes */
  129. unsigned int uhs_caps;
  130. /* More capabilities */
  131. unsigned int uhs_caps2;
  132. void (*sdio_lpm_gpio_setup)(struct device *, unsigned int);
  133. unsigned int status_irq;
  134. int status_gpio;
  135. /* Indicates the polarity of the GPIO line when card is inserted */
  136. bool is_status_gpio_active_low;
  137. int sdiowakeup_irq;
  138. unsigned long irq_flags;
  139. unsigned long mmc_bus_width;
  140. int (*wpswitch) (struct device *);
  141. unsigned int msmsdcc_fmin;
  142. unsigned int msmsdcc_fmid;
  143. unsigned int msmsdcc_fmax;
  144. bool nonremovable;
  145. unsigned int mpm_sdiowakeup_int;
  146. int wpswitch_gpio;
  147. bool is_wpswitch_active_low;
  148. struct msm_mmc_slot_reg_data *vreg_data;
  149. int is_sdio_al_client;
  150. unsigned int *sup_clk_table;
  151. unsigned char sup_clk_cnt;
  152. struct msm_mmc_pin_data *pin_data;
  153. bool disable_bam;
  154. bool disable_runtime_pm;
  155. bool disable_cmd23;
  156. u32 cpu_dma_latency;
  157. struct msm_mmc_bus_voting_data *msm_bus_voting_data;
  158. };
  159. #endif