Skip to content

Commit b5174fa

Browse files
committed
Merge tag 'mmc-merge-for-3.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc
Pull MMC updates from Chris Ball: Core: * Support for MMC 4.5 Data Tag feature -- we tag REQ_META, so devices that support Data Tag will provide increased throughput for metadata. * Faster detection of card removal on I/O errors. Drivers: * dw_mmc now supports eMMC Power Off Notify, has PCI support, and implements pre_req and post_req for asynchronous requests. * omap_hsmmc now supports device tree. * esdhc now has power management support. * sdhci-tegra now supports Tegra30 devices. * sdhci-spear now supports hibernation. * tmio_mmc now supports using a GPIO for card detection. * Intel PCH now supports 8-bit bus transfers. * tag 'mmc-merge-for-3.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (53 commits) mmc: sh_mmcif: simplify bitmask macros mmc: sh_mobile_sdhi: support modular mmc-core with non-standard hotplug mmc: sh_mobile_sdhi: add a callback for board specific init code mmc: tmio: cosmetic: prettify the tmio_mmc_set_ios() function mmc: sh_mobile_sdhi: do not manage PM clocks manually mmc: tmio_mmc: remove unused sdio_irq_enabled flag mmc: tmio_mmc: power status flag doesn't have to be exposed in platform data mmc: sh_mobile_sdhi: pass card hotplug GPIO number to TMIO MMC mmc: tmio_mmc: support the generic MMC GPIO card hotplug helper mmc: tmio: calculate the native hotplug condition only once mmc: simplify mmc_cd_gpio_request() by removing two parameters mmc: sdhci-pci: allow 8-bit bus width for Intel PCH mmc: sdhci: check interrupt flags in ISR again mmc: sdhci-pci: Add MSI support mmc: core: warn when card doesn't support HPI mmc: davinci: Poll status for small size transfers mmc: davinci: Eliminate spurious interrupts mmc: omap_hsmmc: Avoid a regulator voltage change with dt mmc: omap_hsmmc: Convert hsmmc driver to use device tree mmc: sdhci-pci: add SDHCI_QUIRK2_HOST_OFF_CARD_ON for Medfield SDIO ...
2 parents afb9bd7 + 135111c commit b5174fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1161
-722
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
* TI Highspeed MMC host controller for OMAP
2+
3+
The Highspeed MMC Host Controller on TI OMAP family
4+
provides an interface for MMC, SD, and SDIO types of memory cards.
5+
6+
Required properties:
7+
- compatible:
8+
Should be "ti,omap2-hsmmc", for OMAP2 controllers
9+
Should be "ti,omap3-hsmmc", for OMAP3 controllers
10+
Should be "ti,omap4-hsmmc", for OMAP4 controllers
11+
- ti,hwmods: Must be "mmc<n>", n is controller instance starting 1
12+
- reg : should contain hsmmc registers location and length
13+
14+
Optional properties:
15+
ti,dual-volt: boolean, supports dual voltage cards
16+
<supply-name>-supply: phandle to the regulator device tree node
17+
"supply-name" examples are "vmmc", "vmmc_aux" etc
18+
ti,bus-width: Number of data lines, default assumed is 1 if the property is missing.
19+
cd-gpios: GPIOs for card detection
20+
wp-gpios: GPIOs for write protection
21+
ti,non-removable: non-removable slot (like eMMC)
22+
ti,needs-special-reset: Requires a special softreset sequence
23+
24+
Example:
25+
mmc1: mmc@0x4809c000 {
26+
compatible = "ti,omap4-hsmmc";
27+
reg = <0x4809c000 0x400>;
28+
ti,hwmods = "mmc1";
29+
ti,dual-volt;
30+
ti,bus-width = <4>;
31+
vmmc-supply = <&vmmc>; /* phandle to regulator node */
32+
ti,non-removable;
33+
};

arch/arm/mach-exynos/mach-nuri.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static struct s3c_sdhci_platdata nuri_hsmmc0_data __initdata = {
111111
.max_width = 8,
112112
.host_caps = (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA |
113113
MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
114-
MMC_CAP_DISABLE | MMC_CAP_ERASE),
114+
MMC_CAP_ERASE),
115115
.cd_type = S3C_SDHCI_CD_PERMANENT,
116116
.clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
117117
};
@@ -150,8 +150,7 @@ static struct platform_device emmc_fixed_voltage = {
150150
static struct s3c_sdhci_platdata nuri_hsmmc2_data __initdata = {
151151
.max_width = 4,
152152
.host_caps = MMC_CAP_4_BIT_DATA |
153-
MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
154-
MMC_CAP_DISABLE,
153+
MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
155154
.ext_cd_gpio = EXYNOS4_GPX3(3), /* XEINT_27 */
156155
.ext_cd_gpio_invert = 1,
157156
.cd_type = S3C_SDHCI_CD_GPIO,

arch/arm/mach-exynos/mach-universal_c210.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -745,8 +745,7 @@ static struct platform_device universal_gpio_keys = {
745745
static struct s3c_sdhci_platdata universal_hsmmc0_data __initdata = {
746746
.max_width = 8,
747747
.host_caps = (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA |
748-
MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
749-
MMC_CAP_DISABLE),
748+
MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
750749
.cd_type = S3C_SDHCI_CD_PERMANENT,
751750
.clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
752751
};
@@ -784,8 +783,7 @@ static struct platform_device mmc0_fixed_voltage = {
784783
static struct s3c_sdhci_platdata universal_hsmmc2_data __initdata = {
785784
.max_width = 4,
786785
.host_caps = MMC_CAP_4_BIT_DATA |
787-
MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
788-
MMC_CAP_DISABLE,
786+
MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
789787
.ext_cd_gpio = EXYNOS4_GPX3(4), /* XEINT_28 */
790788
.ext_cd_gpio_invert = 1,
791789
.cd_type = S3C_SDHCI_CD_GPIO,
@@ -796,8 +794,7 @@ static struct s3c_sdhci_platdata universal_hsmmc2_data __initdata = {
796794
static struct s3c_sdhci_platdata universal_hsmmc3_data __initdata = {
797795
.max_width = 4,
798796
.host_caps = MMC_CAP_4_BIT_DATA |
799-
MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
800-
MMC_CAP_DISABLE,
797+
MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
801798
.cd_type = S3C_SDHCI_CD_EXTERNAL,
802799
};
803800

arch/arm/mach-omap2/hsmmc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
316316
mmc->slots[0].pm_caps = c->pm_caps;
317317
mmc->slots[0].internal_clock = !c->ext_clock;
318318
mmc->dma_mask = 0xffffffff;
319+
mmc->max_freq = c->max_freq;
319320
if (cpu_is_omap44xx())
320321
mmc->reg_offset = OMAP4_MMC_REG_OFFSET;
321322
else

arch/arm/mach-omap2/hsmmc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ struct omap2_hsmmc_info {
2727
char *name; /* or NULL for default */
2828
struct platform_device *pdev; /* mmc controller instance */
2929
int ocr_mask; /* temporary HACK */
30+
int max_freq; /* maximum clock, if constrained by external
31+
* circuitry, or 0 for default */
3032
/* Remux (pad configuration) when powering on/off */
3133
void (*remux)(struct device *dev, int slot, int power_on);
3234
/* init some special card */

arch/arm/plat-omap/include/plat/mmc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ struct omap_mmc_platform_data {
137137
int (*set_power)(struct device *dev, int slot,
138138
int power_on, int vdd);
139139
int (*get_ro)(struct device *dev, int slot);
140-
int (*set_sleep)(struct device *dev, int slot, int sleep,
141-
int vdd, int cardsleep);
142140
void (*remux)(struct device *dev, int slot, int power_on);
143141
/* Call back before enabling / disabling regulators */
144142
void (*before_set_reg)(struct device *dev, int slot,

drivers/mmc/card/block.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,7 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
10791079
struct mmc_blk_request *brq = &mqrq->brq;
10801080
struct request *req = mqrq->req;
10811081
struct mmc_blk_data *md = mq->data;
1082+
bool do_data_tag;
10821083

10831084
/*
10841085
* Reliable writes are used to implement Forced Unit Access and
@@ -1154,6 +1155,16 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
11541155
if (do_rel_wr)
11551156
mmc_apply_rel_rw(brq, card, req);
11561157

1158+
/*
1159+
* Data tag is used only during writing meta data to speed
1160+
* up write and any subsequent read of this meta data
1161+
*/
1162+
do_data_tag = (card->ext_csd.data_tag_unit_size) &&
1163+
(req->cmd_flags & REQ_META) &&
1164+
(rq_data_dir(req) == WRITE) &&
1165+
((brq->data.blocks * brq->data.blksz) >=
1166+
card->ext_csd.data_tag_unit_size);
1167+
11571168
/*
11581169
* Pre-defined multi-block transfers are preferable to
11591170
* open ended-ones (and necessary for reliable writes).
@@ -1172,13 +1183,13 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
11721183
* We'll avoid using CMD23-bounded multiblock writes for
11731184
* these, while retaining features like reliable writes.
11741185
*/
1175-
1176-
if ((md->flags & MMC_BLK_CMD23) &&
1177-
mmc_op_multi(brq->cmd.opcode) &&
1178-
(do_rel_wr || !(card->quirks & MMC_QUIRK_BLK_NO_CMD23))) {
1186+
if ((md->flags & MMC_BLK_CMD23) && mmc_op_multi(brq->cmd.opcode) &&
1187+
(do_rel_wr || !(card->quirks & MMC_QUIRK_BLK_NO_CMD23) ||
1188+
do_data_tag)) {
11791189
brq->sbc.opcode = MMC_SET_BLOCK_COUNT;
11801190
brq->sbc.arg = brq->data.blocks |
1181-
(do_rel_wr ? (1 << 31) : 0);
1191+
(do_rel_wr ? (1 << 31) : 0) |
1192+
(do_data_tag ? (1 << 29) : 0);
11821193
brq->sbc.flags = MMC_RSP_R1 | MMC_CMD_AC;
11831194
brq->mrq.sbc = &brq->sbc;
11841195
}

drivers/mmc/core/cd-gpio.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,17 @@ static irqreturn_t mmc_cd_gpio_irqt(int irq, void *dev_id)
2828
return IRQ_HANDLED;
2929
}
3030

31-
int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio,
32-
unsigned int irq, unsigned long flags)
31+
int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio)
3332
{
3433
size_t len = strlen(dev_name(host->parent)) + 4;
35-
struct mmc_cd_gpio *cd = kmalloc(sizeof(*cd) + len, GFP_KERNEL);
34+
struct mmc_cd_gpio *cd;
35+
int irq = gpio_to_irq(gpio);
3636
int ret;
3737

38+
if (irq < 0)
39+
return irq;
40+
41+
cd = kmalloc(sizeof(*cd) + len, GFP_KERNEL);
3842
if (!cd)
3943
return -ENOMEM;
4044

@@ -45,7 +49,8 @@ int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio,
4549
goto egpioreq;
4650

4751
ret = request_threaded_irq(irq, NULL, mmc_cd_gpio_irqt,
48-
flags, cd->label, host);
52+
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
53+
cd->label, host);
4954
if (ret < 0)
5055
goto eirqreq;
5156

0 commit comments

Comments
 (0)