Merge master.kernel.org:/home/rmk/linux-2.6-mmc
This commit is contained in:
@@ -1079,12 +1079,16 @@ static void mmc_setup(struct mmc_host *host)
|
|||||||
/**
|
/**
|
||||||
* mmc_detect_change - process change of state on a MMC socket
|
* mmc_detect_change - process change of state on a MMC socket
|
||||||
* @host: host which changed state.
|
* @host: host which changed state.
|
||||||
|
* @delay: optional delay to wait before detection (jiffies)
|
||||||
*
|
*
|
||||||
* All we know is that card(s) have been inserted or removed
|
* All we know is that card(s) have been inserted or removed
|
||||||
* from the socket(s). We don't know which socket or cards.
|
* from the socket(s). We don't know which socket or cards.
|
||||||
*/
|
*/
|
||||||
void mmc_detect_change(struct mmc_host *host)
|
void mmc_detect_change(struct mmc_host *host, unsigned long delay)
|
||||||
{
|
{
|
||||||
|
if (delay)
|
||||||
|
schedule_delayed_work(&host->detect, delay);
|
||||||
|
else
|
||||||
schedule_work(&host->detect);
|
schedule_work(&host->detect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1189,7 +1193,7 @@ int mmc_add_host(struct mmc_host *host)
|
|||||||
ret = mmc_add_host_sysfs(host);
|
ret = mmc_add_host_sysfs(host);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
mmc_power_off(host);
|
mmc_power_off(host);
|
||||||
mmc_detect_change(host);
|
mmc_detect_change(host, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@@ -1259,7 +1263,7 @@ EXPORT_SYMBOL(mmc_suspend_host);
|
|||||||
*/
|
*/
|
||||||
int mmc_resume_host(struct mmc_host *host)
|
int mmc_resume_host(struct mmc_host *host)
|
||||||
{
|
{
|
||||||
mmc_detect_change(host);
|
mmc_detect_change(host, 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -442,7 +442,7 @@ static void mmci_check_status(unsigned long data)
|
|||||||
|
|
||||||
status = host->plat->status(mmc_dev(host->mmc));
|
status = host->plat->status(mmc_dev(host->mmc));
|
||||||
if (status ^ host->oldstat)
|
if (status ^ host->oldstat)
|
||||||
mmc_detect_change(host->mmc);
|
mmc_detect_change(host->mmc, 0);
|
||||||
|
|
||||||
host->oldstat = status;
|
host->oldstat = status;
|
||||||
mod_timer(&host->timer, jiffies + HZ);
|
mod_timer(&host->timer, jiffies + HZ);
|
||||||
|
@@ -423,7 +423,9 @@ static void pxamci_dma_irq(int dma, void *devid, struct pt_regs *regs)
|
|||||||
|
|
||||||
static irqreturn_t pxamci_detect_irq(int irq, void *devid, struct pt_regs *regs)
|
static irqreturn_t pxamci_detect_irq(int irq, void *devid, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
mmc_detect_change(devid);
|
struct pxamci_host *host = mmc_priv(devid);
|
||||||
|
|
||||||
|
mmc_detect_change(devid, host->pdata->detect_delay);
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1122,7 +1122,7 @@ static void wbsd_detect_card(unsigned long data)
|
|||||||
|
|
||||||
DBG("Executing card detection\n");
|
DBG("Executing card detection\n");
|
||||||
|
|
||||||
mmc_detect_change(host->mmc);
|
mmc_detect_change(host->mmc, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1198,7 +1198,7 @@ static void wbsd_tasklet_card(unsigned long param)
|
|||||||
*/
|
*/
|
||||||
spin_unlock(&host->lock);
|
spin_unlock(&host->lock);
|
||||||
|
|
||||||
mmc_detect_change(host->mmc);
|
mmc_detect_change(host->mmc, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
spin_unlock(&host->lock);
|
spin_unlock(&host->lock);
|
||||||
|
@@ -9,6 +9,7 @@ struct mmc_host;
|
|||||||
|
|
||||||
struct pxamci_platform_data {
|
struct pxamci_platform_data {
|
||||||
unsigned int ocr_mask; /* available voltages */
|
unsigned int ocr_mask; /* available voltages */
|
||||||
|
unsigned long detect_delay; /* delay in jiffies before detecting cards after interrupt */
|
||||||
int (*init)(struct device *, irqreturn_t (*)(int, void *, struct pt_regs *), void *);
|
int (*init)(struct device *, irqreturn_t (*)(int, void *, struct pt_regs *), void *);
|
||||||
int (*get_ro)(struct device *);
|
int (*get_ro)(struct device *);
|
||||||
void (*setpower)(struct device *, unsigned int);
|
void (*setpower)(struct device *, unsigned int);
|
||||||
|
@@ -109,6 +109,8 @@ struct mmc_host {
|
|||||||
struct mmc_card *card_selected; /* the selected MMC card */
|
struct mmc_card *card_selected; /* the selected MMC card */
|
||||||
|
|
||||||
struct work_struct detect;
|
struct work_struct detect;
|
||||||
|
|
||||||
|
unsigned long private[0] ____cacheline_aligned;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct mmc_host *mmc_alloc_host(int extra, struct device *);
|
extern struct mmc_host *mmc_alloc_host(int extra, struct device *);
|
||||||
@@ -116,14 +118,18 @@ extern int mmc_add_host(struct mmc_host *);
|
|||||||
extern void mmc_remove_host(struct mmc_host *);
|
extern void mmc_remove_host(struct mmc_host *);
|
||||||
extern void mmc_free_host(struct mmc_host *);
|
extern void mmc_free_host(struct mmc_host *);
|
||||||
|
|
||||||
#define mmc_priv(x) ((void *)((x) + 1))
|
static inline void *mmc_priv(struct mmc_host *host)
|
||||||
|
{
|
||||||
|
return (void *)host->private;
|
||||||
|
}
|
||||||
|
|
||||||
#define mmc_dev(x) ((x)->dev)
|
#define mmc_dev(x) ((x)->dev)
|
||||||
#define mmc_hostname(x) ((x)->class_dev.class_id)
|
#define mmc_hostname(x) ((x)->class_dev.class_id)
|
||||||
|
|
||||||
extern int mmc_suspend_host(struct mmc_host *, pm_message_t);
|
extern int mmc_suspend_host(struct mmc_host *, pm_message_t);
|
||||||
extern int mmc_resume_host(struct mmc_host *);
|
extern int mmc_resume_host(struct mmc_host *);
|
||||||
|
|
||||||
extern void mmc_detect_change(struct mmc_host *);
|
extern void mmc_detect_change(struct mmc_host *, unsigned long delay);
|
||||||
extern void mmc_request_done(struct mmc_host *, struct mmc_request *);
|
extern void mmc_request_done(struct mmc_host *, struct mmc_request *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user