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