Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312823
b: refs/heads/master
c: 27410ee
h: refs/heads/master
i:
  312821: 12550d2
  312819: 9410cf8
  312815: 46153cd
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Chris Ball committed Jul 21, 2012
1 parent 4d1608d commit 95d1642
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7d17baa05da6a2e64ee15011cdf4319bd3e0ff61
refs/heads/master: 27410ee7e391ce650d6d0242805f080599be7ad7
2 changes: 2 additions & 0 deletions trunk/drivers/mmc/core/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev)

mmc_host_clk_init(host);

host->slot.cd_irq = -EINVAL;

spin_lock_init(&host->lock);
init_waitqueue_head(&host->wq);
INIT_DELAYED_WORK(&host->detect, mmc_rescan);
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/mmc/core/slot-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio)
goto eirqreq;

ctx->cd_gpio = gpio;
host->hotplug.irq = irq;
host->hotplug.handler_priv = ctx;
host->slot.cd_irq = irq;
host->slot.handler_priv = ctx;

return 0;

Expand All @@ -71,12 +71,12 @@ EXPORT_SYMBOL(mmc_gpio_request_cd);

void mmc_gpio_free_cd(struct mmc_host *host)
{
struct mmc_gpio *ctx = host->hotplug.handler_priv;
struct mmc_gpio *ctx = host->slot.handler_priv;

if (!ctx)
return;

free_irq(host->hotplug.irq, host);
free_irq(host->slot.cd_irq, host);
gpio_free(ctx->cd_gpio);
kfree(ctx);
}
Expand Down
17 changes: 14 additions & 3 deletions trunk/include/linux/mmc/host.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,19 @@ struct mmc_async_req {
int (*err_check) (struct mmc_card *, struct mmc_async_req *);
};

struct mmc_hotplug {
unsigned int irq;
/**
* struct mmc_slot - MMC slot functions
*
* @cd_irq: MMC/SD-card slot hotplug detection IRQ or -EINVAL
* @handler_priv: MMC/SD-card slot context
*
* Some MMC/SD host controllers implement slot-functions like card and
* write-protect detection natively. However, a large number of controllers
* leave these functions to the CPU. This struct provides a hook to attach
* such slot-function drivers.
*/
struct mmc_slot {
int cd_irq;
void *handler_priv;
};

Expand Down Expand Up @@ -297,7 +308,7 @@ struct mmc_host {

struct delayed_work detect;
int detect_change; /* card detect flag */
struct mmc_hotplug hotplug;
struct mmc_slot slot;

const struct mmc_bus_ops *bus_ops; /* current bus driver */
unsigned int bus_refs; /* reference counter */
Expand Down

0 comments on commit 95d1642

Please sign in to comment.