9
9
*/
10
10
11
11
#include <linux/err.h>
12
- #include <linux/gpio.h>
13
12
#include <linux/gpio/consumer.h>
14
13
#include <linux/interrupt.h>
15
14
#include <linux/jiffies.h>
@@ -102,36 +101,6 @@ int mmc_gpio_get_cd(struct mmc_host *host)
102
101
}
103
102
EXPORT_SYMBOL (mmc_gpio_get_cd );
104
103
105
- /**
106
- * mmc_gpio_request_ro - request a gpio for write-protection
107
- * @host: mmc host
108
- * @gpio: gpio number requested
109
- *
110
- * As devm_* managed functions are used in mmc_gpio_request_ro(), client
111
- * drivers do not need to worry about freeing up memory.
112
- *
113
- * Returns zero on success, else an error.
114
- */
115
- int mmc_gpio_request_ro (struct mmc_host * host , unsigned int gpio )
116
- {
117
- struct mmc_gpio * ctx = host -> slot .handler_priv ;
118
- int ret ;
119
-
120
- if (!gpio_is_valid (gpio ))
121
- return - EINVAL ;
122
-
123
- ret = devm_gpio_request_one (host -> parent , gpio , GPIOF_DIR_IN ,
124
- ctx -> ro_label );
125
- if (ret < 0 )
126
- return ret ;
127
-
128
- ctx -> override_ro_active_level = true;
129
- ctx -> ro_gpio = gpio_to_desc (gpio );
130
-
131
- return 0 ;
132
- }
133
- EXPORT_SYMBOL (mmc_gpio_request_ro );
134
-
135
104
void mmc_gpiod_request_cd_irq (struct mmc_host * host )
136
105
{
137
106
struct mmc_gpio * ctx = host -> slot .handler_priv ;
@@ -200,50 +169,6 @@ void mmc_gpio_set_cd_isr(struct mmc_host *host,
200
169
}
201
170
EXPORT_SYMBOL (mmc_gpio_set_cd_isr );
202
171
203
- /**
204
- * mmc_gpio_request_cd - request a gpio for card-detection
205
- * @host: mmc host
206
- * @gpio: gpio number requested
207
- * @debounce: debounce time in microseconds
208
- *
209
- * As devm_* managed functions are used in mmc_gpio_request_cd(), client
210
- * drivers do not need to worry about freeing up memory.
211
- *
212
- * If GPIO debouncing is desired, set the debounce parameter to a non-zero
213
- * value. The caller is responsible for ensuring that the GPIO driver associated
214
- * with the GPIO supports debouncing, otherwise an error will be returned.
215
- *
216
- * Returns zero on success, else an error.
217
- */
218
- int mmc_gpio_request_cd (struct mmc_host * host , unsigned int gpio ,
219
- unsigned int debounce )
220
- {
221
- struct mmc_gpio * ctx = host -> slot .handler_priv ;
222
- int ret ;
223
-
224
- ret = devm_gpio_request_one (host -> parent , gpio , GPIOF_DIR_IN ,
225
- ctx -> cd_label );
226
- if (ret < 0 )
227
- /*
228
- * don't bother freeing memory. It might still get used by other
229
- * slot functions, in any case it will be freed, when the device
230
- * is destroyed.
231
- */
232
- return ret ;
233
-
234
- if (debounce ) {
235
- ret = gpio_set_debounce (gpio , debounce );
236
- if (ret < 0 )
237
- return ret ;
238
- }
239
-
240
- ctx -> override_cd_active_level = true;
241
- ctx -> cd_gpio = gpio_to_desc (gpio );
242
-
243
- return 0 ;
244
- }
245
- EXPORT_SYMBOL (mmc_gpio_request_cd );
246
-
247
172
/**
248
173
* mmc_gpiod_request_cd - request a gpio descriptor for card-detection
249
174
* @host: mmc host
@@ -254,8 +179,7 @@ EXPORT_SYMBOL(mmc_gpio_request_cd);
254
179
* @gpio_invert: will return whether the GPIO line is inverted or not, set
255
180
* to NULL to ignore
256
181
*
257
- * Use this function in place of mmc_gpio_request_cd() to use the GPIO
258
- * descriptor API. Note that it must be called prior to mmc_add_host()
182
+ * Note that this must be called prior to mmc_add_host()
259
183
* otherwise the caller must also call mmc_gpiod_request_cd_irq().
260
184
*
261
185
* Returns zero on success, else an error.
@@ -306,9 +230,6 @@ EXPORT_SYMBOL(mmc_can_gpio_cd);
306
230
* @gpio_invert: will return whether the GPIO line is inverted or not,
307
231
* set to NULL to ignore
308
232
*
309
- * Use this function in place of mmc_gpio_request_ro() to use the GPIO
310
- * descriptor API.
311
- *
312
233
* Returns zero on success, else an error.
313
234
*/
314
235
int mmc_gpiod_request_ro (struct mmc_host * host , const char * con_id ,
0 commit comments