From 4265900e0be653f5b78baf2816857ef57cf1332f Mon Sep 17 00:00:00 2001 From: Saugata Das Date: Wed, 21 Dec 2011 13:09:17 +0530 Subject: mmc: MMC-4.5 Data Tag Support MMC-4.5 data tag feature will be used to store the file system meta-data in the tagged region of eMMC. This will improve the write and subsequent read transfer time for the meta data. Signed-off-by: Saugata Das Tested-by: Venkatraman S Signed-off-by: Chris Ball --- include/linux/mmc/card.h | 2 ++ include/linux/mmc/mmc.h | 3 +++ 2 files changed, 5 insertions(+) (limited to 'include') diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 19a41d1737a..1a1ca716983 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h @@ -71,6 +71,8 @@ struct mmc_ext_csd { bool hpi_en; /* HPI enablebit */ bool hpi; /* HPI support bit */ unsigned int hpi_cmd; /* cmd used as HPI */ + unsigned int data_sector_size; /* 512 bytes or 4KB */ + unsigned int data_tag_unit_size; /* DATA TAG UNIT size */ unsigned int boot_ro_lock; /* ro lock support */ bool boot_ro_lockable; u8 raw_partition_support; /* 160 */ diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index fb9f6e116e1..b822a2cb600 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h @@ -274,6 +274,7 @@ struct _mmc_csd { #define EXT_CSD_FLUSH_CACHE 32 /* W */ #define EXT_CSD_CACHE_CTRL 33 /* R/W */ #define EXT_CSD_POWER_OFF_NOTIFICATION 34 /* R/W */ +#define EXT_CSD_DATA_SECTOR_SIZE 61 /* R */ #define EXT_CSD_GP_SIZE_MULT 143 /* R/W */ #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ #define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ @@ -315,6 +316,8 @@ struct _mmc_csd { #define EXT_CSD_POWER_OFF_LONG_TIME 247 /* RO */ #define EXT_CSD_GENERIC_CMD6_TIME 248 /* RO */ #define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */ +#define EXT_CSD_TAG_UNIT_SIZE 498 /* RO */ +#define EXT_CSD_DATA_TAG_SUPPORT 499 /* RO */ #define EXT_CSD_HPI_FEATURES 503 /* RO */ /* -- cgit v1.2.3-18-g5258 From 62ca8034d940439490a450ae7e2b7702591e3192 Mon Sep 17 00:00:00 2001 From: Shashidhar Hiremath Date: Fri, 13 Jan 2012 16:04:57 +0530 Subject: mmc: Support of PCI mode in the dw_mmc driver Support of PCI mode for the dw_mmc driver. This Patch adds the support for the scenario where the Synopsys Designware IP is present on the PCI bus. The patch adds the minimal modifications necessary for the driver to work on PCI platform. Also added separate files for PCI and PLATFORM modes of operation. Signed-off-by: Shashidhar Hiremath Acked-by: James Hogan Signed-off-by: Chris Ball --- include/linux/mmc/dw_mmc.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index aae5d1f1bb3..8f66e28f5a0 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h @@ -76,7 +76,7 @@ struct mmc_data; * @num_slots: Number of slots available. * @verid: Denote Version ID. * @data_offset: Set the offset of DATA register according to VERID. - * @pdev: Platform device associated with the MMC controller. + * @dev: Device associated with the MMC controller. * @pdata: Platform data associated with the MMC controller. * @slot: Slots sharing this MMC controller. * @fifo_depth: depth of FIFO. @@ -87,6 +87,8 @@ struct mmc_data; * @push_data: Pointer to FIFO push function. * @pull_data: Pointer to FIFO pull function. * @quirks: Set of quirks that apply to specific versions of the IP. + * @irq_flags: The flags to be passed to request_irq. + * @irq: The irq value to be passed to request_irq. * * Locking * ======= @@ -153,7 +155,7 @@ struct dw_mci { u32 fifoth_val; u16 verid; u16 data_offset; - struct platform_device *pdev; + struct device dev; struct dw_mci_board *pdata; struct dw_mci_slot *slot[MAX_MCI_SLOTS]; @@ -174,6 +176,8 @@ struct dw_mci { u32 quirks; struct regulator *vmmc; /* Power regulator */ + unsigned long irq_flags; /* IRQ flags */ + unsigned int irq; }; /* DMA ops for Internal/External DMAC interface */ -- cgit v1.2.3-18-g5258 From f0cc9cf99326926fd76f77645c48d16d647802eb Mon Sep 17 00:00:00 2001 From: Ulf Hansson Date: Mon, 6 Feb 2012 10:42:39 +0100 Subject: mmc: core: Detect card removal on I/O error To prevent I/O as soon as possible at card removal, a new detect work is re-scheduled without a delay to let a rescan remove the card device as soon as possible. Additionally, MMC_CAP2_DETECT_ON_ERR can now be used to handle "slowly" removed cards that a scheduled detect work did not detect as removed. To prevent further I/O requests for these lingering removed cards, check if card has been removed and then schedule a detect work to properly remove it. Signed-off-by: Ulf Hansson Reviewed-by: Namjae Jeon Acked-by: Linus Walleij Signed-off-by: Chris Ball --- include/linux/mmc/host.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index ee2b0363c04..d1d3743fde9 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -258,6 +258,7 @@ struct mmc_host { #define MMC_CAP2_HS200 (MMC_CAP2_HS200_1_8V_SDR | \ MMC_CAP2_HS200_1_2V_SDR) #define MMC_CAP2_BROKEN_VOLTAGE (1 << 7) /* Use the broken voltage */ +#define MMC_CAP2_DETECT_ON_ERR (1 << 8) /* On I/O err check card removal */ mmc_pm_flag_t pm_caps; /* supported pm features */ unsigned int power_notify_type; -- cgit v1.2.3-18-g5258 From 907d2e7cc7ebba4ab398422a7f0435e1802be65b Mon Sep 17 00:00:00 2001 From: Adrian Hunter Date: Wed, 29 Feb 2012 09:17:21 +0200 Subject: mmc: start removing enable / disable API Most parts of the enable / disable API are no longer used and can be removed. Signed-off-by: Adrian Hunter Tested-by: Venkatraman S Tested-by: Jaehoon Chung Signed-off-by: Chris Ball --- include/linux/mmc/core.h | 1 - include/linux/mmc/host.h | 46 ++++------------------------------------------ 2 files changed, 4 insertions(+), 43 deletions(-) (limited to 'include') diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 87a976cc565..2bfa589764d 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h @@ -175,7 +175,6 @@ extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int); extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort); extern void mmc_release_host(struct mmc_host *host); -extern void mmc_do_release_host(struct mmc_host *host); extern int mmc_try_claim_host(struct mmc_host *host); extern int mmc_flush_cache(struct mmc_card *); diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index d1d3743fde9..e05bd241c67 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -80,34 +80,11 @@ struct mmc_ios { struct mmc_host_ops { /* - * Hosts that support power saving can use the 'enable' and 'disable' - * methods to exit and enter power saving states. 'enable' is called - * when the host is claimed and 'disable' is called (or scheduled with - * a delay) when the host is released. The 'disable' is scheduled if - * the disable delay set by 'mmc_set_disable_delay()' is non-zero, - * otherwise 'disable' is called immediately. 'disable' may be - * scheduled repeatedly, to permit ever greater power saving at the - * expense of ever greater latency to re-enable. Rescheduling is - * determined by the return value of the 'disable' method. A positive - * value gives the delay in milliseconds. - * - * In the case where a host function (like set_ios) may be called - * with or without the host claimed, enabling and disabling can be - * done directly and will nest correctly. Call 'mmc_host_enable()' and - * 'mmc_host_lazy_disable()' for this purpose, but note that these - * functions must be paired. - * - * Alternatively, 'mmc_host_enable()' may be paired with - * 'mmc_host_disable()' which calls 'disable' immediately. In this - * case the 'disable' method will be called with 'lazy' set to 0. - * This is mainly useful for error paths. - * - * Because lazy disable may be called from a work queue, the 'disable' - * method must claim the host when 'lazy' != 0, which will work - * correctly because recursion is detected and handled. + * 'enable' is called when the host is claimed and 'disable' is called + * when the host is released. 'enable' and 'disable' are deprecated. */ int (*enable)(struct mmc_host *host); - int (*disable)(struct mmc_host *host, int lazy); + int (*disable)(struct mmc_host *host); /* * It is optional for the host to implement pre_req and post_req in * order to support double buffering of requests (prepare one @@ -218,7 +195,7 @@ struct mmc_host { #define MMC_CAP_SPI (1 << 4) /* Talks only SPI protocols */ #define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */ #define MMC_CAP_8_BIT_DATA (1 << 6) /* Can the host do 8 bit transfers */ -#define MMC_CAP_DISABLE (1 << 7) /* Can the host be disabled */ + #define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */ #define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */ #define MMC_CAP_ERASE (1 << 10) /* Allow erase/trim commands */ @@ -301,13 +278,7 @@ struct mmc_host { unsigned int removed:1; /* host is being removed */ #endif - /* Only used with MMC_CAP_DISABLE */ - int enabled; /* host is enabled */ int rescan_disable; /* disable card detection */ - int nesting_cnt; /* "enable" nesting count */ - int en_dis_recurs; /* detect recursion */ - unsigned int disable_delay; /* disable delay in msecs */ - struct delayed_work disable; /* disabling work */ struct mmc_card *card; /* device attached to this host */ @@ -407,17 +378,8 @@ int mmc_card_awake(struct mmc_host *host); int mmc_card_sleep(struct mmc_host *host); int mmc_card_can_sleep(struct mmc_host *host); -int mmc_host_enable(struct mmc_host *host); -int mmc_host_disable(struct mmc_host *host); -int mmc_host_lazy_disable(struct mmc_host *host); int mmc_pm_notify(struct notifier_block *notify_block, unsigned long, void *); -static inline void mmc_set_disable_delay(struct mmc_host *host, - unsigned int disable_delay) -{ - host->disable_delay = disable_delay; -} - /* Module parameter */ extern bool mmc_assume_removable; -- cgit v1.2.3-18-g5258 From 83bb24aaa4af2ec7c127cc2a5fa7ca9f64cdd13d Mon Sep 17 00:00:00 2001 From: Adrian Hunter Date: Tue, 13 Mar 2012 05:19:13 -0400 Subject: mmc: core: add high-capacity erase size capability flag Let drivers specify the use of high-capacity erase size. Signed-off-by: Adrian Hunter Signed-off-by: Chris Ball --- include/linux/mmc/host.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index e05bd241c67..33a4d08d810 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -236,6 +236,7 @@ struct mmc_host { MMC_CAP2_HS200_1_2V_SDR) #define MMC_CAP2_BROKEN_VOLTAGE (1 << 7) /* Use the broken voltage */ #define MMC_CAP2_DETECT_ON_ERR (1 << 8) /* On I/O err check card removal */ +#define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */ mmc_pm_flag_t pm_caps; /* supported pm features */ unsigned int power_notify_type; -- cgit v1.2.3-18-g5258 From 6308d2905bd30290d90f28730828fd572161dd11 Mon Sep 17 00:00:00 2001 From: Adrian Hunter Date: Tue, 7 Feb 2012 14:48:54 +0200 Subject: mmc: sdhci: add quirk for keeping card power during suspend Add quirk SDHCI_QUIRK2_HOST_OFF_CARD_ON to cater for the case when the card keeps power during suspend but the host controller does not i.e. the card power is not controlled by the host controller. In that case, the controller must be fully reset on resume. Signed-off-by: Adrian Hunter Signed-off-by: Chris Ball --- include/linux/mmc/sdhci.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index c750f85177d..e9051e1cb1c 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h @@ -90,6 +90,8 @@ struct sdhci_host { unsigned int quirks2; /* More deviations from spec. */ +#define SDHCI_QUIRK2_HOST_OFF_CARD_ON (1<<0) + int irq; /* Device IRQ */ void __iomem *ioaddr; /* Mapped address */ -- cgit v1.2.3-18-g5258 From c9b0546a59293cabf54c85e1218da595af3274ff Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Thu, 9 Feb 2012 22:57:07 +0100 Subject: mmc: simplify mmc_cd_gpio_request() by removing two parameters Calculate the IRQ number, using gpio_to_irq() and use fixed flags: trigger on both edges. This makes two out of four arguments of the mmc_cd_gpio_request() function redundant. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Chris Ball --- include/linux/mmc/cd-gpio.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/mmc/cd-gpio.h b/include/linux/mmc/cd-gpio.h index a8e46978331..cefaba038cc 100644 --- a/include/linux/mmc/cd-gpio.h +++ b/include/linux/mmc/cd-gpio.h @@ -12,8 +12,7 @@ #define MMC_CD_GPIO_H struct mmc_host; -int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio, - unsigned int irq, unsigned long flags); +int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio); void mmc_cd_gpio_free(struct mmc_host *host); #endif -- cgit v1.2.3-18-g5258 From c8be24c2afd3ed2445bbf8f542af35a9787fc0e8 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Thu, 9 Feb 2012 22:57:09 +0100 Subject: mmc: tmio_mmc: support the generic MMC GPIO card hotplug helper If the platform specifies the TMIO_MMC_HAS_COLD_CD flag, use the generic MMC GPIO card hotplug helper. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Chris Ball --- include/linux/mfd/tmio.h | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 0dc98044d8b..5a197de4aac 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h @@ -1,8 +1,10 @@ #ifndef MFD_TMIO_H #define MFD_TMIO_H +#include #include #include +#include #include #include @@ -64,8 +66,8 @@ #define TMIO_MMC_SDIO_IRQ (1 << 2) /* * Some platforms can detect card insertion events with controller powered - * down, in which case they have to call tmio_mmc_cd_wakeup() to power up the - * controller and report the event to the driver. + * down, using a GPIO IRQ, in which case they have to fill in cd_irq, cd_gpio, + * and cd_flags fields of struct tmio_mmc_data. */ #define TMIO_MMC_HAS_COLD_CD (1 << 3) /* @@ -73,6 +75,12 @@ * idle before writing to some registers. */ #define TMIO_MMC_HAS_IDLE_WAIT (1 << 4) +/* + * A GPIO is used for card hotplug detection. We need an extra flag for this, + * because 0 is a valid GPIO number too, and requiring users to specify + * cd_gpio < 0 to disable GPIO hotplug would break backwards compatibility. + */ +#define TMIO_MMC_USE_GPIO_CD (1 << 5) int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); @@ -98,18 +106,23 @@ struct tmio_mmc_data { struct tmio_mmc_dma *dma; struct device *dev; bool power; + unsigned int cd_gpio; void (*set_pwr)(struct platform_device *host, int state); void (*set_clk_div)(struct platform_device *host, int state); int (*get_cd)(struct platform_device *host); int (*write16_hook)(struct tmio_mmc_host *host, int addr); }; +/* + * This function is deprecated and will be removed soon. Please, convert your + * platform to use drivers/mmc/core/cd-gpio.c + */ +#include static inline void tmio_mmc_cd_wakeup(struct tmio_mmc_data *pdata) { - if (pdata && !pdata->power) { - pdata->power = true; - pm_runtime_get(pdata->dev); - } + if (pdata) + mmc_detect_change(dev_get_drvdata(pdata->dev), + msecs_to_jiffies(100)); } /* -- cgit v1.2.3-18-g5258 From 58126c878b4a4f658015e383614bafb6331e46d3 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Thu, 9 Feb 2012 22:57:10 +0100 Subject: mmc: sh_mobile_sdhi: pass card hotplug GPIO number to TMIO MMC To use TMIO MMC driver ability to interface to the generic MMC GPIO card hotplug detection helper, the SDHI driver has to pass the GPIO number from its own platform data. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Chris Ball --- include/linux/mmc/sh_mobile_sdhi.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h index 71b805451bd..082a736a9bf 100644 --- a/include/linux/mmc/sh_mobile_sdhi.h +++ b/include/linux/mmc/sh_mobile_sdhi.h @@ -16,6 +16,7 @@ struct sh_mobile_sdhi_info { unsigned long tmio_flags; unsigned long tmio_caps; u32 tmio_ocr_mask; /* available MMC voltages */ + unsigned int cd_gpio; struct tmio_mmc_data *pdata; void (*set_pwr)(struct platform_device *pdev, int state); int (*get_cd)(struct platform_device *pdev); -- cgit v1.2.3-18-g5258 From c391e1b9ebfe31514fa95a0cdd30c2cbc9652c89 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Thu, 9 Feb 2012 22:57:13 +0100 Subject: mmc: tmio_mmc: power status flag doesn't have to be exposed in platform data The controller power status flag does not have to be accessed from the hot-plug detection code any more, it can now be removed from the platform data and put in the controller private struct. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Chris Ball --- include/linux/mfd/tmio.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 5a197de4aac..f5171dbf885 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h @@ -105,7 +105,6 @@ struct tmio_mmc_data { u32 ocr_mask; /* available voltages */ struct tmio_mmc_dma *dma; struct device *dev; - bool power; unsigned int cd_gpio; void (*set_pwr)(struct platform_device *host, int state); void (*set_clk_div)(struct platform_device *host, int state); -- cgit v1.2.3-18-g5258 From e82b4ac94e5c43fad51b975aed058858ceda1f0f Mon Sep 17 00:00:00 2001 From: Bastian Hecht Date: Fri, 16 Mar 2012 12:19:29 -0400 Subject: mmc: sh_mobile_sdhi: add a callback for board specific init code Some boards need a preliminary setup stage to prepare the sdhi controller. Signed-off-by: Bastian Hecht Signed-off-by: Chris Ball --- include/linux/mmc/sh_mobile_sdhi.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h index 082a736a9bf..686b85bfb7a 100644 --- a/include/linux/mmc/sh_mobile_sdhi.h +++ b/include/linux/mmc/sh_mobile_sdhi.h @@ -20,6 +20,10 @@ struct sh_mobile_sdhi_info { struct tmio_mmc_data *pdata; void (*set_pwr)(struct platform_device *pdev, int state); int (*get_cd)(struct platform_device *pdev); + + /* callbacks for board specific setup code */ + int (*init)(struct platform_device *pdev); + void (*cleanup)(struct platform_device *pdev); }; #endif /* LINUX_MMC_SH_MOBILE_SDHI_H */ -- cgit v1.2.3-18-g5258 From 7f524217439cc17da74523582c303cced432713e Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Fri, 9 Mar 2012 10:16:00 +0100 Subject: mmc: sh_mobile_sdhi: support modular mmc-core with non-standard hotplug Currently if a platform wants to implement a non-standard card-detection method, it would need to call tmio_mmc_cd_wakeup(), which is an inline function, calling mmc_detect_change(). For this the platform would have to link mmc_core statically into the kernel, losing the ability to build it as a module. This patch adds a callback to the sh_mobile_sdhi driver, which eliminates this dependency. Signed-off-by: Guennadi Liakhovetski Acked-by: Magnus Damm Signed-off-by: Chris Ball --- include/linux/mmc/sh_mobile_sdhi.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h index 686b85bfb7a..e94e620aedd 100644 --- a/include/linux/mmc/sh_mobile_sdhi.h +++ b/include/linux/mmc/sh_mobile_sdhi.h @@ -10,6 +10,14 @@ struct tmio_mmc_data; #define SH_MOBILE_SDHI_IRQ_SDCARD "sdcard" #define SH_MOBILE_SDHI_IRQ_SDIO "sdio" +/** + * struct sh_mobile_sdhi_ops - SDHI driver callbacks + * @cd_wakeup: trigger a card-detection run + */ +struct sh_mobile_sdhi_ops { + void (*cd_wakeup)(const struct platform_device *pdev); +}; + struct sh_mobile_sdhi_info { int dma_slave_tx; int dma_slave_rx; @@ -22,7 +30,8 @@ struct sh_mobile_sdhi_info { int (*get_cd)(struct platform_device *pdev); /* callbacks for board specific setup code */ - int (*init)(struct platform_device *pdev); + int (*init)(struct platform_device *pdev, + const struct sh_mobile_sdhi_ops *ops); void (*cleanup)(struct platform_device *pdev); }; -- cgit v1.2.3-18-g5258 From 135111cc5595c6a24dd826d503e2d2bae92da1c4 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Fri, 16 Mar 2012 12:49:04 +0100 Subject: mmc: sh_mmcif: simplify bitmask macros Purely cosmetic readability improvement, no functional change. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Chris Ball --- include/linux/mmc/sh_mmcif.h | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h index 04ff452bf5c..05f0e3db1c1 100644 --- a/include/linux/mmc/sh_mmcif.h +++ b/include/linux/mmc/sh_mmcif.h @@ -77,18 +77,15 @@ struct sh_mmcif_plat_data { /* CE_CLK_CTRL */ #define CLK_ENABLE (1 << 24) /* 1: output mmc clock */ -#define CLK_CLEAR ((1 << 19) | (1 << 18) | (1 << 17) | (1 << 16)) -#define CLK_SUP_PCLK ((1 << 19) | (1 << 18) | (1 << 17) | (1 << 16)) -#define CLKDIV_4 (1<<16) /* mmc clock frequency. - * n: bus clock/(2^(n+1)) */ -#define CLKDIV_256 (7<<16) /* mmc clock frequency. (see above) */ -#define SRSPTO_256 ((1 << 13) | (0 << 12)) /* resp timeout */ -#define SRBSYTO_29 ((1 << 11) | (1 << 10) | \ - (1 << 9) | (1 << 8)) /* resp busy timeout */ -#define SRWDTO_29 ((1 << 7) | (1 << 6) | \ - (1 << 5) | (1 << 4)) /* read/write timeout */ -#define SCCSTO_29 ((1 << 3) | (1 << 2) | \ - (1 << 1) | (1 << 0)) /* ccs timeout */ +#define CLK_CLEAR (0xf << 16) +#define CLK_SUP_PCLK (0xf << 16) +#define CLKDIV_4 (1 << 16) /* mmc clock frequency. + * n: bus clock/(2^(n+1)) */ +#define CLKDIV_256 (7 << 16) /* mmc clock frequency. (see above) */ +#define SRSPTO_256 (2 << 12) /* resp timeout */ +#define SRBSYTO_29 (0xf << 8) /* resp busy timeout */ +#define SRWDTO_29 (0xf << 4) /* read/write timeout */ +#define SCCSTO_29 (0xf << 0) /* ccs timeout */ /* CE_VERSION */ #define SOFT_RST_ON (1 << 31) -- cgit v1.2.3-18-g5258