Skip to content

Commit

Permalink
mmc: add a card hotplug handler context
Browse files Browse the repository at this point in the history
SD/MMC controllers provide different card insertion and removal detection
methods. On some of them the controller itself issues an interrupt, on
others polling is used, on yet others auxiliary means are used for this
purpose, e.g., a GPIO IRQ. Further, on some systems one of those methods
can be chosen at driver probing time and configured in software. E.g., on
some systems the SD/MMC controller card hot-plug detection pin can be
configured either as a respective controller functions, or an IRQ-capable
GPIO. To support such flexible configurations a card hot-plug context
is added by this patch.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Guennadi Liakhovetski authored and Chris Ball committed Jan 12, 2012
1 parent cbb18b3 commit b67e198
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/linux/mmc/host.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ struct mmc_async_req {
int (*err_check) (struct mmc_card *, struct mmc_async_req *);
};

struct mmc_hotplug {
unsigned int irq;
void *handler_priv;
};

struct mmc_host {
struct device *parent;
struct device class_dev;
Expand Down Expand Up @@ -300,6 +305,7 @@ struct mmc_host {

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

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

0 comments on commit b67e198

Please sign in to comment.