Colin Cross | b44b7d7 | 2011-04-08 22:20:53 -0700 | [diff] [blame] | 1 | /* |
| 2 | * arch/arm/include/asm/mach/mmc.h |
| 3 | */ |
| 4 | #ifndef ASMARM_MACH_MMC_H |
| 5 | #define ASMARM_MACH_MMC_H |
| 6 | |
| 7 | #include <linux/mmc/host.h> |
| 8 | #include <linux/mmc/card.h> |
| 9 | #include <linux/mmc/sdio_func.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 10 | #include <mach/gpio.h> |
| 11 | |
| 12 | #define SDC_DAT1_DISABLE 0 |
| 13 | #define SDC_DAT1_ENABLE 1 |
| 14 | #define SDC_DAT1_ENWAKE 2 |
| 15 | #define SDC_DAT1_DISWAKE 3 |
Colin Cross | b44b7d7 | 2011-04-08 22:20:53 -0700 | [diff] [blame] | 16 | |
| 17 | struct embedded_sdio_data { |
| 18 | struct sdio_cis cis; |
| 19 | struct sdio_cccr cccr; |
| 20 | struct sdio_embedded_func *funcs; |
| 21 | int num_funcs; |
| 22 | }; |
| 23 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 24 | /* This structure keeps information per regulator */ |
| 25 | struct msm_mmc_reg_data { |
| 26 | /* voltage regulator handle */ |
| 27 | struct regulator *reg; |
| 28 | /* regulator name */ |
| 29 | const char *name; |
| 30 | /* voltage level to be set */ |
Subhash Jadavani | 99ba53a | 2011-08-01 16:04:18 +0530 | [diff] [blame] | 31 | unsigned int low_vol_level; |
| 32 | unsigned int high_vol_level; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 33 | /* Load values for low power and high power mode */ |
| 34 | unsigned int lpm_uA; |
| 35 | unsigned int hpm_uA; |
| 36 | /* |
| 37 | * is set voltage supported for this regulator? |
| 38 | * false => set voltage is not supported |
| 39 | * true => set voltage is supported |
| 40 | */ |
| 41 | bool set_voltage_sup; |
| 42 | /* is this regulator enabled? */ |
| 43 | bool is_enabled; |
| 44 | /* is this regulator needs to be always on? */ |
| 45 | bool always_on; |
| 46 | /* is low power mode setting required for this regulator? */ |
| 47 | bool lpm_sup; |
| 48 | }; |
| 49 | |
| 50 | /* |
| 51 | * This structure keeps information for all the |
| 52 | * regulators required for a SDCC slot. |
| 53 | */ |
| 54 | struct msm_mmc_slot_reg_data { |
| 55 | struct msm_mmc_reg_data *vdd_data; /* keeps VDD/VCC regulator info */ |
| 56 | struct msm_mmc_reg_data *vccq_data; /* keeps VCCQ regulator info */ |
| 57 | struct msm_mmc_reg_data *vddp_data; /* keeps VDD Pad regulator info */ |
| 58 | }; |
| 59 | |
| 60 | struct msm_mmc_gpio { |
| 61 | u32 no; |
| 62 | const char *name; |
| 63 | bool is_always_on; |
| 64 | bool is_enabled; |
| 65 | }; |
| 66 | |
| 67 | struct msm_mmc_gpio_data { |
| 68 | struct msm_mmc_gpio *gpio; |
| 69 | u8 size; |
| 70 | }; |
| 71 | |
| 72 | struct msm_mmc_pad_pull { |
| 73 | enum msm_tlmm_pull_tgt no; |
| 74 | u32 val; |
| 75 | }; |
| 76 | |
| 77 | struct msm_mmc_pad_pull_data { |
| 78 | struct msm_mmc_pad_pull *on; |
| 79 | struct msm_mmc_pad_pull *off; |
| 80 | u8 size; |
| 81 | }; |
| 82 | |
| 83 | struct msm_mmc_pad_drv { |
| 84 | enum msm_tlmm_hdrive_tgt no; |
| 85 | u32 val; |
| 86 | }; |
| 87 | |
| 88 | struct msm_mmc_pad_drv_data { |
| 89 | struct msm_mmc_pad_drv *on; |
| 90 | struct msm_mmc_pad_drv *off; |
| 91 | u8 size; |
| 92 | }; |
| 93 | |
| 94 | struct msm_mmc_pad_data { |
| 95 | struct msm_mmc_pad_pull_data *pull; |
| 96 | struct msm_mmc_pad_drv_data *drv; |
| 97 | }; |
| 98 | |
| 99 | struct msm_mmc_pin_data { |
| 100 | /* |
| 101 | * = 1 if controller pins are using gpios |
| 102 | * = 0 if controller has dedicated MSM pads |
| 103 | */ |
| 104 | u8 is_gpio; |
| 105 | u8 cfg_sts; |
| 106 | struct msm_mmc_gpio_data *gpio_data; |
| 107 | struct msm_mmc_pad_data *pad_data; |
| 108 | }; |
| 109 | |
Colin Cross | b44b7d7 | 2011-04-08 22:20:53 -0700 | [diff] [blame] | 110 | struct mmc_platform_data { |
| 111 | unsigned int ocr_mask; /* available voltages */ |
| 112 | int built_in; /* built-in device flag */ |
Dmitry Shmidt | 5228a59 | 2011-05-03 11:05:04 -0700 | [diff] [blame] | 113 | int card_present; /* card detect state */ |
Colin Cross | b44b7d7 | 2011-04-08 22:20:53 -0700 | [diff] [blame] | 114 | u32 (*translate_vdd)(struct device *, unsigned int); |
| 115 | unsigned int (*status)(struct device *); |
| 116 | struct embedded_sdio_data *embedded_sdio; |
| 117 | int (*register_status_notify)(void (*callback)(int card_present, void *dev_id), void *dev_id); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 118 | /* |
| 119 | * XPC controls the maximum current in the |
| 120 | * default speed mode of SDXC card. |
| 121 | */ |
| 122 | unsigned int xpc_cap; |
| 123 | /* Supported UHS-I Modes */ |
| 124 | unsigned int uhs_caps; |
| 125 | void (*sdio_lpm_gpio_setup)(struct device *, unsigned int); |
| 126 | unsigned int status_irq; |
| 127 | unsigned int status_gpio; |
| 128 | unsigned int sdiowakeup_irq; |
| 129 | unsigned long irq_flags; |
| 130 | unsigned long mmc_bus_width; |
| 131 | int (*wpswitch) (struct device *); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 132 | unsigned int msmsdcc_fmin; |
| 133 | unsigned int msmsdcc_fmid; |
| 134 | unsigned int msmsdcc_fmax; |
| 135 | bool nonremovable; |
| 136 | bool pclk_src_dfab; |
| 137 | int (*cfg_mpm_sdiowakeup)(struct device *, unsigned); |
| 138 | bool sdcc_v4_sup; |
| 139 | unsigned int wpswitch_gpio; |
| 140 | unsigned char wpswitch_polarity; |
| 141 | struct msm_mmc_slot_reg_data *vreg_data; |
| 142 | int is_sdio_al_client; |
| 143 | unsigned int *sup_clk_table; |
| 144 | unsigned char sup_clk_cnt; |
| 145 | struct msm_mmc_pin_data *pin_data; |
Sahitya Tummala | d9df327 | 2011-08-19 16:50:46 +0530 | [diff] [blame] | 146 | bool disable_bam; |
Sahitya Tummala | b07e1ae | 2011-09-02 11:58:42 +0530 | [diff] [blame] | 147 | bool disable_runtime_pm; |
Sahitya Tummala | 85fa070 | 2011-09-15 09:39:37 +0530 | [diff] [blame^] | 148 | bool disable_cmd23; |
Colin Cross | b44b7d7 | 2011-04-08 22:20:53 -0700 | [diff] [blame] | 149 | }; |
| 150 | |
| 151 | #endif |