Skip to content

Commit

Permalink
mmc: quirks: Add/remove quirks conditional support.
Browse files Browse the repository at this point in the history
Conditional add/remove quirks for MMC and SD.

Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Andrei Warkentin authored and Chris Ball committed May 25, 2011
1 parent 88095e7 commit c59de92
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions include/linux/mmc/card.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,16 +273,14 @@ struct mmc_fixup {
card->cid.month)

/*
* This hook just adds a quirk unconditionally.
* Unconditionally quirk add/remove.
*/

static inline void __maybe_unused add_quirk(struct mmc_card *card, int data)
{
card->quirks |= data;
}

/*
* This hook just removes a quirk unconditionally.
*/
static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data)
{
card->quirks &= ~data;
Expand All @@ -308,6 +306,40 @@ static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data)
#define mmc_sd_card_set_uhs(c) ((c)->state |= MMC_STATE_ULTRAHIGHSPEED)
#define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC)

/*
* Quirk add/remove for MMC products.
*/

static inline void __maybe_unused add_quirk_mmc(struct mmc_card *card, int data)
{
if (mmc_card_mmc(card))
card->quirks |= data;
}

static inline void __maybe_unused remove_quirk_mmc(struct mmc_card *card,
int data)
{
if (mmc_card_mmc(card))
card->quirks &= ~data;
}

/*
* Quirk add/remove for SD products.
*/

static inline void __maybe_unused add_quirk_sd(struct mmc_card *card, int data)
{
if (mmc_card_sd(card))
card->quirks |= data;
}

static inline void __maybe_unused remove_quirk_sd(struct mmc_card *card,
int data)
{
if (mmc_card_sd(card))
card->quirks &= ~data;
}

static inline int mmc_card_lenient_fn0(const struct mmc_card *c)
{
return c->quirks & MMC_QUIRK_LENIENT_FN0;
Expand Down

0 comments on commit c59de92

Please sign in to comment.