diff options
author | Oleksandr Suvorov <oleksandr.suvorov@toradex.com> | 2020-03-26 12:44:27 +0200 |
---|---|---|
committer | Oleksandr Suvorov <oleksandr.suvorov@toradex.com> | 2020-03-26 12:46:50 +0200 |
commit | 87d308708712ff6075c4dd54b0519b47fdad8816 (patch) | |
tree | 2fb6458b1db7dd21be2648f42412dd2485846c76 /backport-include/linux/mmc |
Backports v5.4.27
Backports generated by toradex backports f6e8852f1ef28e6d3c9bae8400eb6a87a6b0c3e7
against mainline kernel tag v5.4.27
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Diffstat (limited to 'backport-include/linux/mmc')
-rw-r--r-- | backport-include/linux/mmc/host.h | 16 | ||||
-rw-r--r-- | backport-include/linux/mmc/sdio.h | 21 | ||||
-rw-r--r-- | backport-include/linux/mmc/sdio_func.h | 86 | ||||
-rw-r--r-- | backport-include/linux/mmc/sdio_ids.h | 14 |
4 files changed, 137 insertions, 0 deletions
diff --git a/backport-include/linux/mmc/host.h b/backport-include/linux/mmc/host.h new file mode 100644 index 0000000..2a60cde --- /dev/null +++ b/backport-include/linux/mmc/host.h @@ -0,0 +1,16 @@ +#ifndef _BACKPORTLINUX_MMC_HOST_H +#define _BACKPORTLINUX_MMC_HOST_H +#include_next <linux/mmc/host.h> +#include <linux/version.h> +#include <linux/mmc/card.h> + +#if LINUX_VERSION_IS_LESS(3,16,0) +#define mmc_card_hs LINUX_BACKPORT(mmc_card_hs) +static inline int mmc_card_hs(struct mmc_card *card) +{ + return card->host->ios.timing == MMC_TIMING_SD_HS || + card->host->ios.timing == MMC_TIMING_MMC_HS; +} +#endif /* LINUX_VERSION_IS_LESS(3,16,0) */ + +#endif /* _BACKPORTLINUX_MMC_HOST_H */ diff --git a/backport-include/linux/mmc/sdio.h b/backport-include/linux/mmc/sdio.h new file mode 100644 index 0000000..31d8833 --- /dev/null +++ b/backport-include/linux/mmc/sdio.h @@ -0,0 +1,21 @@ +#ifndef __BACKPORT_MMC_SDIO_H +#define __BACKPORT_MMC_SDIO_H +#include <linux/version.h> +#include_next <linux/mmc/sdio.h> + +/* backports b4625dab */ +#ifndef SDIO_CCCR_REV_3_00 +#define SDIO_CCCR_REV_3_00 3 /* CCCR/FBR Version 3.00 */ +#endif +#ifndef SDIO_SDIO_REV_3_00 +#define SDIO_SDIO_REV_3_00 4 /* SDIO Spec Version 3.00 */ +#endif + +#ifndef SDIO_BUS_ECSI +#define SDIO_BUS_ECSI 0x20 /* Enable continuous SPI interrupt */ +#endif +#ifndef SDIO_BUS_SCSI +#define SDIO_BUS_SCSI 0x40 /* Support continuous SPI interrupt */ +#endif + +#endif /* __BACKPORT_MMC_SDIO_H */ diff --git a/backport-include/linux/mmc/sdio_func.h b/backport-include/linux/mmc/sdio_func.h new file mode 100644 index 0000000..0a67f99 --- /dev/null +++ b/backport-include/linux/mmc/sdio_func.h @@ -0,0 +1,86 @@ +#ifndef __BACKPORT_MMC_SDIO_FUNC_H +#define __BACKPORT_MMC_SDIO_FUNC_H +#include <linux/version.h> +#include_next <linux/mmc/sdio_func.h> + +#ifndef dev_to_sdio_func +#define dev_to_sdio_func(d) container_of(d, struct sdio_func, dev) +#endif + +#if LINUX_VERSION_IS_LESS(5,2,0) && \ + !LINUX_VERSION_IN_RANGE(5,1,15, 5,2,0) && \ + !LINUX_VERSION_IN_RANGE(4,19,56, 4,20,0) + +#include <linux/mmc/card.h> +#include <linux/mmc/host.h> + +/** + * sdio_retune_hold_now - start deferring retuning requests till release + * @func: SDIO function attached to host + * + * This function can be called if it's currently a bad time to do + * a retune of the SDIO card. Retune requests made during this time + * will be held and we'll actually do the retune sometime after the + * release. + * + * This function could be useful if an SDIO card is in a power state + * where it can respond to a small subset of commands that doesn't + * include the retuning command. Care should be taken when using + * this function since (presumably) the retuning request we might be + * deferring was made for a good reason. + * + * This function should be called while the host is claimed. + */ +#define sdio_retune_hold_now LINUX_BACKPORT(sdio_retune_hold_now) +#if LINUX_VERSION_IS_LESS(4,3,0) +static inline void sdio_retune_hold_now(struct sdio_func *func) +{ +} +#else +static inline void sdio_retune_hold_now(struct sdio_func *func) +{ + struct mmc_host *host = func->card->host; + + host->retune_now = 0; + host->hold_retune += 1; +} +#endif /* < 4.3 */ + +/** + * sdio_retune_release - signal that it's OK to retune now + * @func: SDIO function attached to host + * + * This is the complement to sdio_retune_hold_now(). Calling this + * function won't make a retune happen right away but will allow + * them to be scheduled normally. + * + * This function should be called while the host is claimed. + */ +#define sdio_retune_release LINUX_BACKPORT(sdio_retune_release) +#if LINUX_VERSION_IS_LESS(4,3,0) +static inline void sdio_retune_release(struct sdio_func *func) +{ +} +#else +static inline void sdio_retune_release(struct sdio_func *func) +{ + struct mmc_host *host = func->card->host; + + if (host->hold_retune) + host->hold_retune -= 1; + else + WARN_ON(1); +} +#endif + +#define sdio_retune_crc_disable LINUX_BACKPORT(sdio_retune_crc_disable) +static inline void sdio_retune_crc_disable(struct sdio_func *func) +{ +} +#define sdio_retune_crc_enable LINUX_BACKPORT(sdio_retune_crc_enable) +static inline void sdio_retune_crc_enable(struct sdio_func *func) +{ +} +#endif /* < 5.2 */ + +#endif /* __BACKPORT_MMC_SDIO_FUNC_H */ diff --git a/backport-include/linux/mmc/sdio_ids.h b/backport-include/linux/mmc/sdio_ids.h new file mode 100644 index 0000000..64fe8ec --- /dev/null +++ b/backport-include/linux/mmc/sdio_ids.h @@ -0,0 +1,14 @@ +#ifndef __BACKPORT_MMC_SDIO_IDS_H +#define __BACKPORT_MMC_SDIO_IDS_H +#include <linux/version.h> +#include_next <linux/mmc/sdio_ids.h> + +#ifndef SDIO_CLASS_BT_AMP +#define SDIO_CLASS_BT_AMP 0x09 /* Type-A Bluetooth AMP interface */ +#endif + +#ifndef SDIO_DEVICE_ID_MARVELL_8688WLAN +#define SDIO_DEVICE_ID_MARVELL_8688WLAN 0x9104 +#endif + +#endif /* __BACKPORT_MMC_SDIO_IDS_H */ |