Skip to content

Commit

Permalink
mmc: sync with the new kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziyann committed May 1, 2016
1 parent 37072c8 commit 14bb924
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 24 deletions.
26 changes: 4 additions & 22 deletions drivers/mmc/core/core.c
Expand Up @@ -1576,9 +1576,9 @@ EXPORT_SYMBOL(mmc_can_trim);
int mmc_can_discard(struct mmc_card *card)
{
/*
* As there's no way to detect the discard support bit at v4.5
* use the s/w feature support filed.
*/
* As there's no way to detect the discard support bit at v4.5
* use the s/w feature support filed.
*/
if (card->ext_csd.feature_support & MMC_DISCARD_FEATURE)
return 1;
return 0;
Expand Down Expand Up @@ -1701,12 +1701,6 @@ void mmc_rescan(struct work_struct *work)

mmc_claim_host(host);
for (i = 0; i < ARRAY_SIZE(freqs); i++) {
if (!mmc_rescan_try_freq(host, max(freqs[i], host->f_min))) {
extend_wakelock = true;
break;
}
/*retry again after power off/on if detection is failed*/
mdelay(50);
if (!mmc_rescan_try_freq(host, max(freqs[i], host->f_min))) {
extend_wakelock = true;
break;
Expand Down Expand Up @@ -1896,9 +1890,6 @@ int mmc_suspend_host(struct mmc_host *host)
if (!err && !mmc_card_keep_power(host))
mmc_power_off(host);

if (host->nesting_cnt < 0)
host->nesting_cnt = 0;

return err;
}

Expand Down Expand Up @@ -1961,7 +1952,6 @@ int mmc_pm_notify(struct notifier_block *notify_block,
{
struct mmc_host *host = container_of(
notify_block, struct mmc_host, pm_notify);
struct omapsdcc_host *omaphost = mmc_priv(host);
unsigned long flags;


Expand All @@ -1988,10 +1978,6 @@ int mmc_pm_notify(struct notifier_block *notify_block,
host->bus_ops->remove(host);

mmc_detach_bus(host);
/* for BCM WIFI */
if (host->card && omaphost)
printk(KERN_WARNING"%s(): WIFI SKIP MMC POWER OFF\n",__func__);
else
mmc_power_off(host);
mmc_release_host(host);
host->pm_flags = 0;
Expand All @@ -2008,11 +1994,7 @@ int mmc_pm_notify(struct notifier_block *notify_block,
}
host->rescan_disable = 0;
spin_unlock_irqrestore(&host->lock, flags);
/* for BCM WIFI */
if (host->card && omaphost)
printk(KERN_WARNING"%s(): WIFI SKIP DETECT CHANGE\n",__func__);
else
mmc_detect_change(host, 0);
mmc_detect_change(host, 0);

}

Expand Down
4 changes: 4 additions & 0 deletions drivers/mmc/core/mmc.c
Expand Up @@ -407,6 +407,10 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
if (card->ext_csd.rev >= 5)
card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM];

/* eMMC v4.5 or later */
if (card->ext_csd.rev >= 6)
card->ext_csd.feature_support |= MMC_DISCARD_FEATURE;

/* moviNAND VHX 4.41 device supports a discard*/
if (card->cid.movi_pnm == 0x47324741 ||
card->cid.movi_pnm == 0x47344741 ||
Expand Down
3 changes: 2 additions & 1 deletion include/linux/mmc/card.h
Expand Up @@ -78,8 +78,9 @@ struct mmc_ext_csd {
u8 raw_sec_feature_support;/* 231 */
u8 raw_trim_mult; /* 232 */
u8 raw_sectors[4]; /* 212 - 4 bytes */

unsigned int feature_support;
#define MMC_DISCARD_FEATURE BIT(0) /* CMD38 feature */
#define MMC_DISCARD_FEATURE BIT(0) /* CMD38 feature */
};

struct sd_scr {
Expand Down
1 change: 0 additions & 1 deletion include/linux/mmc/core.h
Expand Up @@ -138,7 +138,6 @@ extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *);
extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *,
struct mmc_command *, int);
extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int);
extern int mmc_send_ext_csd(struct mmc_card *card, u8 *ext_csd);

#define MMC_ERASE_ARG 0x00000000
#define MMC_SECURE_ERASE_ARG 0x80000000
Expand Down

0 comments on commit 14bb924

Please sign in to comment.