blob: 75ec1432f0ecc5423f36121cdcc43eaca6c81426 [file] [log] [blame]
Colin Crossb44b7d72011-04-08 22:20:53 -07001/*
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 Huntsman3f2bc4d2011-08-16 17:27:22 -070010#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 Crossb44b7d72011-04-08 22:20:53 -070016
17struct 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 Huntsman3f2bc4d2011-08-16 17:27:22 -070024/* This structure keeps information per regulator */
25struct 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 Jadavani99ba53a2011-08-01 16:04:18 +053031 unsigned int low_vol_level;
32 unsigned int high_vol_level;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070033 /* 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
Krishna Kondafea60182011-11-01 16:01:34 -070040 *
41 * Some regulators (like gpio-regulators, LVS (low voltage swtiches)
42 * PMIC regulators) dont have the capability to call
43 * regulator_set_voltage or regulator_set_optimum_mode
44 * Use this variable to indicate if its a such regulator or not
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070045 */
46 bool set_voltage_sup;
47 /* is this regulator enabled? */
48 bool is_enabled;
49 /* is this regulator needs to be always on? */
50 bool always_on;
51 /* is low power mode setting required for this regulator? */
52 bool lpm_sup;
53};
54
55/*
56 * This structure keeps information for all the
57 * regulators required for a SDCC slot.
58 */
59struct msm_mmc_slot_reg_data {
60 struct msm_mmc_reg_data *vdd_data; /* keeps VDD/VCC regulator info */
61 struct msm_mmc_reg_data *vccq_data; /* keeps VCCQ regulator info */
62 struct msm_mmc_reg_data *vddp_data; /* keeps VDD Pad regulator info */
63};
64
65struct msm_mmc_gpio {
66 u32 no;
67 const char *name;
68 bool is_always_on;
69 bool is_enabled;
70};
71
72struct msm_mmc_gpio_data {
73 struct msm_mmc_gpio *gpio;
74 u8 size;
75};
76
77struct msm_mmc_pad_pull {
78 enum msm_tlmm_pull_tgt no;
79 u32 val;
80};
81
82struct msm_mmc_pad_pull_data {
83 struct msm_mmc_pad_pull *on;
84 struct msm_mmc_pad_pull *off;
85 u8 size;
86};
87
88struct msm_mmc_pad_drv {
89 enum msm_tlmm_hdrive_tgt no;
90 u32 val;
91};
92
93struct msm_mmc_pad_drv_data {
94 struct msm_mmc_pad_drv *on;
95 struct msm_mmc_pad_drv *off;
96 u8 size;
97};
98
99struct msm_mmc_pad_data {
100 struct msm_mmc_pad_pull_data *pull;
101 struct msm_mmc_pad_drv_data *drv;
102};
103
104struct msm_mmc_pin_data {
105 /*
106 * = 1 if controller pins are using gpios
107 * = 0 if controller has dedicated MSM pads
108 */
109 u8 is_gpio;
110 u8 cfg_sts;
111 struct msm_mmc_gpio_data *gpio_data;
112 struct msm_mmc_pad_data *pad_data;
113};
114
Colin Crossb44b7d72011-04-08 22:20:53 -0700115struct mmc_platform_data {
116 unsigned int ocr_mask; /* available voltages */
117 int built_in; /* built-in device flag */
Dmitry Shmidt5228a592011-05-03 11:05:04 -0700118 int card_present; /* card detect state */
Colin Crossb44b7d72011-04-08 22:20:53 -0700119 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);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700123 /*
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 void (*sdio_lpm_gpio_setup)(struct device *, unsigned int);
131 unsigned int status_irq;
132 unsigned int status_gpio;
Krishna Konda360aa422011-12-06 18:27:41 -0800133 /* Indicates the polarity of the GPIO line when card is inserted */
134 bool is_status_gpio_active_low;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700135 unsigned int sdiowakeup_irq;
136 unsigned long irq_flags;
137 unsigned long mmc_bus_width;
138 int (*wpswitch) (struct device *);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700139 unsigned int msmsdcc_fmin;
140 unsigned int msmsdcc_fmid;
141 unsigned int msmsdcc_fmax;
142 bool nonremovable;
143 bool pclk_src_dfab;
144 int (*cfg_mpm_sdiowakeup)(struct device *, unsigned);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700145 unsigned int wpswitch_gpio;
146 unsigned char wpswitch_polarity;
147 struct msm_mmc_slot_reg_data *vreg_data;
148 int is_sdio_al_client;
149 unsigned int *sup_clk_table;
150 unsigned char sup_clk_cnt;
151 struct msm_mmc_pin_data *pin_data;
Sahitya Tummalad9df3272011-08-19 16:50:46 +0530152 bool disable_bam;
Sahitya Tummalab07e1ae2011-09-02 11:58:42 +0530153 bool disable_runtime_pm;
Sahitya Tummala85fa0702011-09-15 09:39:37 +0530154 bool disable_cmd23;
Colin Crossb44b7d72011-04-08 22:20:53 -0700155};
156
157#endif