linux/drivers/mmc/core/card.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Private header for the mmc subsystem
 *
 * Copyright (C) 2016 Linaro Ltd
 *
 * Author: Ulf Hansson <[email protected]>
 */

#ifndef _MMC_CORE_CARD_H
#define _MMC_CORE_CARD_H

#include <linux/mmc/card.h>

#define mmc_card_name(c)
#define mmc_card_id(c)
#define mmc_dev_to_card(d)

/* Card states */
#define MMC_STATE_PRESENT
#define MMC_STATE_READONLY
#define MMC_STATE_BLOCKADDR
#define MMC_CARD_SDXC
#define MMC_CARD_REMOVED
#define MMC_STATE_SUSPENDED

#define mmc_card_present(c)
#define mmc_card_readonly(c)
#define mmc_card_blockaddr(c)
#define mmc_card_ext_capacity(c)
#define mmc_card_removed(c)
#define mmc_card_suspended(c)

#define mmc_card_set_present(c)
#define mmc_card_set_readonly(c)
#define mmc_card_set_blockaddr(c)
#define mmc_card_set_ext_capacity(c)
#define mmc_card_set_removed(c)
#define mmc_card_set_suspended(c)
#define mmc_card_clr_suspended(c)

/*
 * The world is not perfect and supplies us with broken mmc/sdio devices.
 * For at least some of these bugs we need a work-around.
 */
struct mmc_fixup {};

#define CID_MANFID_ANY
#define CID_OEMID_ANY
#define CID_YEAR_ANY
#define CID_MONTH_ANY
#define CID_NAME_ANY

#define EXT_CSD_REV_ANY

#define CID_MANFID_SANDISK
#define CID_MANFID_SANDISK_SD
#define CID_MANFID_ATP
#define CID_MANFID_TOSHIBA
#define CID_MANFID_MICRON
#define CID_MANFID_SAMSUNG
#define CID_MANFID_APACER
#define CID_MANFID_KINGSTON
#define CID_MANFID_HYNIX
#define CID_MANFID_KINGSTON_SD
#define CID_MANFID_NUMONYX

#define END_FIXUP

#define _FIXUP_EXT(_name, _manfid, _oemid, _year, _month,	\
		   _rev_start, _rev_end,			\
		   _cis_vendor, _cis_device,			\
		   _fixup, _data, _ext_csd_rev)

#define MMC_FIXUP_REV(_name, _manfid, _oemid, _rev_start, _rev_end,	\
		      _fixup, _data, _ext_csd_rev)				\

#define MMC_FIXUP(_name, _manfid, _oemid, _fixup, _data)

#define MMC_FIXUP_EXT_CSD_REV(_name, _manfid, _oemid, _fixup, _data,	\
			      _ext_csd_rev)

#define SDIO_FIXUP(_vendor, _device, _fixup, _data)			\

#define SDIO_FIXUP_COMPATIBLE(_compatible, _fixup, _data)

#define cid_rev(hwrev, fwrev, year, month)

#define cid_rev_card(card)

/*
 * Unconditionally quirk add/remove.
 */
static inline void __maybe_unused add_quirk(struct mmc_card *card, int data)
{}

static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data)
{}

static inline void __maybe_unused add_limit_rate_quirk(struct mmc_card *card,
						       int data)
{}

static inline void __maybe_unused wl1251_quirk(struct mmc_card *card,
					       int data)
{}

/*
 * Quirk add/remove for MMC products.
 */
static inline void __maybe_unused add_quirk_mmc(struct mmc_card *card, int data)
{}

static inline void __maybe_unused remove_quirk_mmc(struct mmc_card *card,
						   int data)
{}

/*
 * Quirk add/remove for SD products.
 */
static inline void __maybe_unused add_quirk_sd(struct mmc_card *card, int data)
{}

static inline void __maybe_unused remove_quirk_sd(struct mmc_card *card,
						   int data)
{}

static inline int mmc_card_lenient_fn0(const struct mmc_card *c)
{}

static inline int mmc_blksz_for_byte_mode(const struct mmc_card *c)
{}

static inline int mmc_card_disable_cd(const struct mmc_card *c)
{}

static inline int mmc_card_nonstd_func_interface(const struct mmc_card *c)
{}

static inline int mmc_card_broken_byte_mode_512(const struct mmc_card *c)
{}

static inline int mmc_card_long_read_time(const struct mmc_card *c)
{}

static inline int mmc_card_broken_irq_polling(const struct mmc_card *c)
{}

static inline int mmc_card_broken_hpi(const struct mmc_card *c)
{}

static inline int mmc_card_broken_sd_discard(const struct mmc_card *c)
{}

static inline int mmc_card_broken_sd_cache(const struct mmc_card *c)
{}

static inline int mmc_card_broken_cache_flush(const struct mmc_card *c)
{}
#endif