diff options
| author | Andrei Warkentin <andreiw@motorola.com> | 2011-05-23 16:06:35 -0400 |
|---|---|---|
| committer | Chris Ball <cjb@laptop.org> | 2011-05-24 23:54:01 -0400 |
| commit | c59de9287993b5c36f9005f745a3ce0b1008131d (patch) | |
| tree | f9b4017f54beea7657697bd279266aff2b299c7b /include/linux | |
| parent | 88095e7b473a3d9ec3b9c60429576e9cbd327c89 (diff) | |
mmc: quirks: Add/remove quirks conditional support.
Conditional add/remove quirks for MMC and SD.
Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mmc/card.h | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 4910dec47bb7..7190aa2096f7 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
| @@ -273,16 +273,14 @@ struct mmc_fixup { | |||
| 273 | card->cid.month) | 273 | card->cid.month) |
| 274 | 274 | ||
| 275 | /* | 275 | /* |
| 276 | * This hook just adds a quirk unconditionally. | 276 | * Unconditionally quirk add/remove. |
| 277 | */ | 277 | */ |
| 278 | |||
| 278 | static inline void __maybe_unused add_quirk(struct mmc_card *card, int data) | 279 | static inline void __maybe_unused add_quirk(struct mmc_card *card, int data) |
| 279 | { | 280 | { |
| 280 | card->quirks |= data; | 281 | card->quirks |= data; |
| 281 | } | 282 | } |
| 282 | 283 | ||
| 283 | /* | ||
| 284 | * This hook just removes a quirk unconditionally. | ||
| 285 | */ | ||
| 286 | static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data) | 284 | static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data) |
| 287 | { | 285 | { |
| 288 | card->quirks &= ~data; | 286 | card->quirks &= ~data; |
| @@ -308,6 +306,40 @@ static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data) | |||
| 308 | #define mmc_sd_card_set_uhs(c) ((c)->state |= MMC_STATE_ULTRAHIGHSPEED) | 306 | #define mmc_sd_card_set_uhs(c) ((c)->state |= MMC_STATE_ULTRAHIGHSPEED) |
| 309 | #define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC) | 307 | #define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC) |
| 310 | 308 | ||
| 309 | /* | ||
| 310 | * Quirk add/remove for MMC products. | ||
| 311 | */ | ||
| 312 | |||
| 313 | static inline void __maybe_unused add_quirk_mmc(struct mmc_card *card, int data) | ||
| 314 | { | ||
| 315 | if (mmc_card_mmc(card)) | ||
| 316 | card->quirks |= data; | ||
| 317 | } | ||
| 318 | |||
| 319 | static inline void __maybe_unused remove_quirk_mmc(struct mmc_card *card, | ||
| 320 | int data) | ||
| 321 | { | ||
| 322 | if (mmc_card_mmc(card)) | ||
| 323 | card->quirks &= ~data; | ||
| 324 | } | ||
| 325 | |||
| 326 | /* | ||
| 327 | * Quirk add/remove for SD products. | ||
| 328 | */ | ||
| 329 | |||
| 330 | static inline void __maybe_unused add_quirk_sd(struct mmc_card *card, int data) | ||
| 331 | { | ||
| 332 | if (mmc_card_sd(card)) | ||
| 333 | card->quirks |= data; | ||
| 334 | } | ||
| 335 | |||
| 336 | static inline void __maybe_unused remove_quirk_sd(struct mmc_card *card, | ||
| 337 | int data) | ||
| 338 | { | ||
| 339 | if (mmc_card_sd(card)) | ||
| 340 | card->quirks &= ~data; | ||
| 341 | } | ||
| 342 | |||
| 311 | static inline int mmc_card_lenient_fn0(const struct mmc_card *c) | 343 | static inline int mmc_card_lenient_fn0(const struct mmc_card *c) |
| 312 | { | 344 | { |
| 313 | return c->quirks & MMC_QUIRK_LENIENT_FN0; | 345 | return c->quirks & MMC_QUIRK_LENIENT_FN0; |
