aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2012-05-01 09:40:15 -0400
committerChris Ball <cjb@laptop.org>2012-07-21 00:02:16 -0400
commit27410ee7e391ce650d6d0242805f080599be7ad7 (patch)
treeca1a99eb74e56504be7d2bf34fecf11271f361b5
parent7d17baa05da6a2e64ee15011cdf4319bd3e0ff61 (diff)
mmc: core: use a more generic name for slot function types and fields
struct mmc_host::hotplug is becoming a generic hook for slot functions. Rename it accordingly. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/core/host.c2
-rw-r--r--drivers/mmc/core/slot-gpio.c8
-rw-r--r--include/linux/mmc/host.h17
3 files changed, 20 insertions, 7 deletions
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 91c84c7a1829..b8c5290571f1 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -327,6 +327,8 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev)
327 327
328 mmc_host_clk_init(host); 328 mmc_host_clk_init(host);
329 329
330 host->slot.cd_irq = -EINVAL;
331
330 spin_lock_init(&host->lock); 332 spin_lock_init(&host->lock);
331 init_waitqueue_head(&host->wq); 333 init_waitqueue_head(&host->wq);
332 INIT_DELAYED_WORK(&host->detect, mmc_rescan); 334 INIT_DELAYED_WORK(&host->detect, mmc_rescan);
diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c
index 979671053436..468e5a0e5126 100644
--- a/drivers/mmc/core/slot-gpio.c
+++ b/drivers/mmc/core/slot-gpio.c
@@ -56,8 +56,8 @@ int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio)
56 goto eirqreq; 56 goto eirqreq;
57 57
58 ctx->cd_gpio = gpio; 58 ctx->cd_gpio = gpio;
59 host->hotplug.irq = irq; 59 host->slot.cd_irq = irq;
60 host->hotplug.handler_priv = ctx; 60 host->slot.handler_priv = ctx;
61 61
62 return 0; 62 return 0;
63 63
@@ -71,12 +71,12 @@ EXPORT_SYMBOL(mmc_gpio_request_cd);
71 71
72void mmc_gpio_free_cd(struct mmc_host *host) 72void mmc_gpio_free_cd(struct mmc_host *host)
73{ 73{
74 struct mmc_gpio *ctx = host->hotplug.handler_priv; 74 struct mmc_gpio *ctx = host->slot.handler_priv;
75 75
76 if (!ctx) 76 if (!ctx)
77 return; 77 return;
78 78
79 free_irq(host->hotplug.irq, host); 79 free_irq(host->slot.cd_irq, host);
80 gpio_free(ctx->cd_gpio); 80 gpio_free(ctx->cd_gpio);
81 kfree(ctx); 81 kfree(ctx);
82} 82}
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 9deb725799e7..90b6a38b0374 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -150,8 +150,19 @@ struct mmc_async_req {
150 int (*err_check) (struct mmc_card *, struct mmc_async_req *); 150 int (*err_check) (struct mmc_card *, struct mmc_async_req *);
151}; 151};
152 152
153struct mmc_hotplug { 153/**
154 unsigned int irq; 154 * struct mmc_slot - MMC slot functions
155 *
156 * @cd_irq: MMC/SD-card slot hotplug detection IRQ or -EINVAL
157 * @handler_priv: MMC/SD-card slot context
158 *
159 * Some MMC/SD host controllers implement slot-functions like card and
160 * write-protect detection natively. However, a large number of controllers
161 * leave these functions to the CPU. This struct provides a hook to attach
162 * such slot-function drivers.
163 */
164struct mmc_slot {
165 int cd_irq;
155 void *handler_priv; 166 void *handler_priv;
156}; 167};
157 168
@@ -297,7 +308,7 @@ struct mmc_host {
297 308
298 struct delayed_work detect; 309 struct delayed_work detect;
299 int detect_change; /* card detect flag */ 310 int detect_change; /* card detect flag */
300 struct mmc_hotplug hotplug; 311 struct mmc_slot slot;
301 312
302 const struct mmc_bus_ops *bus_ops; /* current bus driver */ 313 const struct mmc_bus_ops *bus_ops; /* current bus driver */
303 unsigned int bus_refs; /* reference counter */ 314 unsigned int bus_refs; /* reference counter */