Skip to content

Commit

Permalink
Merge tag 'mmc-merge-for-3.6-rc1' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/cjb/mmc

Pull MMC updates from Chris Ball:
 "MMC highlights for 3.6:

  Core:
   - Rename cd-gpio to slot-gpio and extend it to support more slot GPIO
     functions, such as write-protect.
   - Add a function to get regulators (Vdd and Vccq) for a host.

  Drivers:
   - sdhci-pxav2, sdhci-pxav3: Add device tree support.
   - sdhi: Add device tree support.
   - sh_mmcif: Add support for regulators, device tree, slot-gpio.
   - tmio: Add regulator support, use slot-gpio."

* tag 'mmc-merge-for-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (62 commits)
  mmc: sdhci-dove: Prepare for common clock framework
  mmc: sdhci-dove: Add SDHCI_QUIRK_NO_HISPD_BIT
  mmc: omap_hsmmc: ensure probe returns error upon resource failure
  mmc: mxs-mmc: Add wp-inverted property
  mmc: esdhc: Fix DMA_MASK to not break mx25 DMA access
  mmc: core: reset signal voltage on power up
  mmc: sd: Fix sd current limit setting
  mmc: omap_hsmmc: add clk_prepare and clk_unprepare
  mmc: sdhci: When a UHS switch fails, cycle power if regulator is used
  mmc: atmel-mci: modify CLKDIV displaying in debugfs
  mmc: atmel-mci: fix incorrect setting of host->data to NULL
  mmc: sdhci: poll for card even when card is logically unremovable
  mmc: sdhci: Introduce new flag SDHCI_USING_RETUNING_TIMER
  mmc: sdio: Change pr_warning to pr_warn_ratelimited
  mmc: core: Simplify and fix for SD switch processing
  mmc: sdhci: restore host settings when card is removed
  mmc: sdhci: fix incorrect command used in tuning
  mmc: sdhci-pci: CaFe has broken card detection
  mmc: sdhci: Report failure reasons for all cases in sdhci_add_host()
  mmc: s3cmci: Convert s3cmci driver to gpiolib API
  ...
  • Loading branch information
torvalds committed Jul 22, 2012
2 parents 5b160bd + 30b87c6 commit a6be1fc
Show file tree
Hide file tree
Showing 43 changed files with 1,057 additions and 519 deletions.
25 changes: 13 additions & 12 deletions Documentation/devicetree/bindings/mmc/fsl-esdhc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@
The Enhanced Secure Digital Host Controller provides an interface
for MMC, SD, and SDIO types of memory cards.

This file documents differences between the core properties described
by mmc.txt and the properties used by the sdhci-esdhc driver.

Required properties:
- compatible : should be
"fsl,<chip>-esdhc", "fsl,esdhc"
- reg : should contain eSDHC registers location and length.
- interrupts : should contain eSDHC interrupt.
- interrupt-parent : interrupt source phandle.
- clock-frequency : specifies eSDHC base clock frequency.
- sdhci,wp-inverted : (optional) specifies that eSDHC controller
reports inverted write-protect state; New devices should use
the generic "wp-inverted" property.
- sdhci,1-bit-only : (optional) specifies that a controller can
only handle 1-bit data transfers. New devices should use the
generic "bus-width = <1>" property.
- sdhci,auto-cmd12: (optional) specifies that a controller can
only handle auto CMD12.

Optional properties:
- sdhci,wp-inverted : specifies that eSDHC controller reports
inverted write-protect state; New devices should use the generic
"wp-inverted" property.
- sdhci,1-bit-only : specifies that a controller can only handle
1-bit data transfers. New devices should use the generic
"bus-width = <1>" property.
- sdhci,auto-cmd12: specifies that a controller can only handle auto
CMD12.

Example:

Expand Down
8 changes: 3 additions & 5 deletions Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
The Enhanced Secure Digital Host Controller on Freescale i.MX family
provides an interface for MMC, SD, and SDIO types of memory cards.

This file documents differences between the core properties described
by mmc.txt and the properties used by the sdhci-esdhc-imx driver.

Required properties:
- compatible : Should be "fsl,<chip>-esdhc"
- reg : Should contain eSDHC registers location and length
- interrupts : Should contain eSDHC interrupt

Optional properties:
- non-removable : Indicate the card is wired to host permanently
- fsl,cd-internal : Indicate to use controller internal card detection
- fsl,wp-internal : Indicate to use controller internal write protection
- cd-gpios : Specify GPIOs for card detection
- wp-gpios : Specify GPIOs for write protection

Examples:

Expand Down
8 changes: 4 additions & 4 deletions Documentation/devicetree/bindings/mmc/mmc-spi-slot.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
MMC/SD/SDIO slot directly connected to a SPI bus

This file documents differences between the core properties described
by mmc.txt and the properties used by the mmc_spi driver.

Required properties:
- compatible : should be "mmc-spi-slot".
- reg : should specify SPI address (chip-select number).
- spi-max-frequency : maximum frequency for this device (Hz).
- voltage-ranges : two cells are required, first cell specifies minimum
slot voltage (mV), second cell specifies maximum slot voltage (mV).
Expand All @@ -11,8 +12,7 @@ Required properties:
Optional properties:
- gpios : may specify GPIOs in this order: Card-Detect GPIO,
Write-Protect GPIO. Note that this does not follow the
binding from mmc.txt, for historic reasons.
- interrupts : the interrupt of a card detect interrupt.
binding from mmc.txt, for historical reasons.
- interrupt-parent : the phandle for the interrupt controller that
services interrupts for this device.

Expand Down
10 changes: 7 additions & 3 deletions Documentation/devicetree/bindings/mmc/mmc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ These properties are common to multiple MMC host controllers. Any host
that requires the respective functionality should implement them using
these definitions.

Interpreted by the OF core:
- reg: Registers location and length.
- interrupts: Interrupts used by the MMC controller.

Required properties:
- bus-width: Number of data lines, can be <1>, <4>, or <8>

Optional properties:
- cd-gpios : Specify GPIOs for card detection, see gpio binding
- wp-gpios : Specify GPIOs for write protection, see gpio binding
- cd-inverted: when present, polarity on the wp gpio line is inverted
- cd-gpios: Specify GPIOs for card detection, see gpio binding
- wp-gpios: Specify GPIOs for write protection, see gpio binding
- cd-inverted: when present, polarity on the cd gpio line is inverted
- wp-inverted: when present, polarity on the wp gpio line is inverted
- non-removable: non-removable slot (like eMMC)
- max-frequency: maximum operating clock frequency
Expand Down
12 changes: 4 additions & 8 deletions Documentation/devicetree/bindings/mmc/mmci.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
* ARM PrimeCell MultiMedia Card Interface (MMCI) PL180/1

The ARM PrimeCell MMCI PL180 and PL181 provides and interface for
The ARM PrimeCell MMCI PL180 and PL181 provides an interface for
reading and writing to MultiMedia and SD cards alike.

This file documents differences between the core properties described
by mmc.txt and the properties used by the mmci driver.

Required properties:
- compatible : contains "arm,pl18x", "arm,primecell".
- reg : contains pl18x registers and length.
- interrupts : contains the device IRQ(s).
- arm,primecell-periphid : contains the PrimeCell Peripheral ID.

Optional properties:
- wp-gpios : contains any write protect (ro) gpios
- cd-gpios : contains any card detection gpios
- cd-inverted : indicates whether the cd gpio is inverted
- max-frequency : contains the maximum operating frequency
- bus-width : number of data lines, can be <1>, <4>, or <8>
- mmc-cap-mmc-highspeed : indicates whether MMC is high speed capable
- mmc-cap-sd-highspeed : indicates whether SD is high speed capable
8 changes: 3 additions & 5 deletions Documentation/devicetree/bindings/mmc/mxs-mmc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
The Freescale MXS Synchronous Serial Ports (SSP) can act as a MMC controller
to support MMC, SD, and SDIO types of memory cards.

This file documents differences between the core properties in mmc.txt
and the properties used by the mxsmmc driver.

Required properties:
- compatible: Should be "fsl,<chip>-mmc". The supported chips include
imx23 and imx28.
- reg: Should contain registers location and length
- interrupts: Should contain ERROR and DMA interrupts
- fsl,ssp-dma-channel: APBH DMA channel for the SSP
- bus-width: Number of data lines, can be <1>, <4>, or <8>

Optional properties:
- wp-gpios: Specify GPIOs for write protection

Examples:

Expand Down
8 changes: 3 additions & 5 deletions Documentation/devicetree/bindings/mmc/nvidia-sdhci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
This controller on Tegra family SoCs provides an interface for MMC, SD,
and SDIO types of memory cards.

This file documents differences between the core properties described
by mmc.txt and the properties used by the sdhci-tegra driver.

Required properties:
- compatible : Should be "nvidia,<chip>-sdhci"
- reg : Should contain SD/MMC registers location and length
- interrupts : Should contain SD/MMC interrupt
- bus-width : Number of data lines, can be <1>, <4>, or <8>

Optional properties:
- cd-gpios : Specify GPIOs for card detection
- wp-gpios : Specify GPIOs for write protection
- power-gpios : Specify GPIOs for power control

Example:
Expand Down
21 changes: 21 additions & 0 deletions Documentation/devicetree/bindings/mmc/sdhci-pxa.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
* Marvell sdhci-pxa v2/v3 controller

This file documents differences between the core properties in mmc.txt
and the properties used by the sdhci-pxav2 and sdhci-pxav3 drivers.

Required properties:
- compatible: Should be "mrvl,pxav2-mmc" or "mrvl,pxav3-mmc".

Optional properties:
- mrvl,clk-delay-cycles: Specify a number of cycles to delay for tuning.

Example:

sdhci@d4280800 {
compatible = "mrvl,pxav3-mmc";
reg = <0xd4280800 0x800>;
bus-width = <8>;
interrupts = <27>;
non-removable;
mrvl,clk-delay-cycles = <31>;
};
7 changes: 3 additions & 4 deletions Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@
The Highspeed MMC Host Controller on TI OMAP family
provides an interface for MMC, SD, and SDIO types of memory cards.

This file documents differences between the core properties described
by mmc.txt and the properties used by the omap_hsmmc driver.

Required properties:
- compatible:
Should be "ti,omap2-hsmmc", for OMAP2 controllers
Should be "ti,omap3-hsmmc", for OMAP3 controllers
Should be "ti,omap4-hsmmc", for OMAP4 controllers
- ti,hwmods: Must be "mmc<n>", n is controller instance starting 1
- reg : should contain hsmmc registers location and length

Optional properties:
ti,dual-volt: boolean, supports dual voltage cards
<supply-name>-supply: phandle to the regulator device tree node
"supply-name" examples are "vmmc", "vmmc_aux" etc
bus-width: Number of data lines, default assumed is 1 if the property is missing.
cd-gpios: GPIOs for card detection
wp-gpios: GPIOs for write protection
ti,non-removable: non-removable slot (like eMMC)
ti,needs-special-reset: Requires a special softreset sequence

Expand Down
36 changes: 9 additions & 27 deletions drivers/mmc/card/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,9 +850,7 @@ static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
goto retry;
if (!err)
mmc_blk_reset_success(md, type);
spin_lock_irq(&md->lock);
__blk_end_request(req, err, blk_rq_bytes(req));
spin_unlock_irq(&md->lock);
blk_end_request(req, err, blk_rq_bytes(req));

return err ? 0 : 1;
}
Expand Down Expand Up @@ -934,9 +932,7 @@ static int mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq,
if (!err)
mmc_blk_reset_success(md, type);
out:
spin_lock_irq(&md->lock);
__blk_end_request(req, err, blk_rq_bytes(req));
spin_unlock_irq(&md->lock);
blk_end_request(req, err, blk_rq_bytes(req));

return err ? 0 : 1;
}
Expand All @@ -951,9 +947,7 @@ static int mmc_blk_issue_flush(struct mmc_queue *mq, struct request *req)
if (ret)
ret = -EIO;

spin_lock_irq(&md->lock);
__blk_end_request_all(req, ret);
spin_unlock_irq(&md->lock);
blk_end_request_all(req, ret);

return ret ? 0 : 1;
}
Expand Down Expand Up @@ -1252,14 +1246,10 @@ static int mmc_blk_cmd_err(struct mmc_blk_data *md, struct mmc_card *card,

blocks = mmc_sd_num_wr_blocks(card);
if (blocks != (u32)-1) {
spin_lock_irq(&md->lock);
ret = __blk_end_request(req, 0, blocks << 9);
spin_unlock_irq(&md->lock);
ret = blk_end_request(req, 0, blocks << 9);
}
} else {
spin_lock_irq(&md->lock);
ret = __blk_end_request(req, 0, brq->data.bytes_xfered);
spin_unlock_irq(&md->lock);
ret = blk_end_request(req, 0, brq->data.bytes_xfered);
}
return ret;
}
Expand Down Expand Up @@ -1311,10 +1301,8 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc)
* A block was successfully transferred.
*/
mmc_blk_reset_success(md, type);
spin_lock_irq(&md->lock);
ret = __blk_end_request(req, 0,
ret = blk_end_request(req, 0,
brq->data.bytes_xfered);
spin_unlock_irq(&md->lock);
/*
* If the blk_end_request function returns non-zero even
* though all data has been transferred and no errors
Expand Down Expand Up @@ -1364,10 +1352,8 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc)
* time, so we only reach here after trying to
* read a single sector.
*/
spin_lock_irq(&md->lock);
ret = __blk_end_request(req, -EIO,
ret = blk_end_request(req, -EIO,
brq->data.blksz);
spin_unlock_irq(&md->lock);
if (!ret)
goto start_new_req;
break;
Expand All @@ -1388,12 +1374,10 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc)
return 1;

cmd_abort:
spin_lock_irq(&md->lock);
if (mmc_card_removed(card))
req->cmd_flags |= REQ_QUIET;
while (ret)
ret = __blk_end_request(req, -EIO, blk_rq_cur_bytes(req));
spin_unlock_irq(&md->lock);
ret = blk_end_request(req, -EIO, blk_rq_cur_bytes(req));

start_new_req:
if (rqc) {
Expand All @@ -1417,9 +1401,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
ret = mmc_blk_part_switch(card, md);
if (ret) {
if (req) {
spin_lock_irq(&md->lock);
__blk_end_request_all(req, -EIO);
spin_unlock_irq(&md->lock);
blk_end_request_all(req, -EIO);
}
ret = 0;
goto out;
Expand Down
2 changes: 1 addition & 1 deletion drivers/mmc/core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ mmc_core-y := core.o bus.o host.o \
mmc.o mmc_ops.o sd.o sd_ops.o \
sdio.o sdio_ops.o sdio_bus.o \
sdio_cis.o sdio_io.o sdio_irq.o \
quirks.o cd-gpio.o
quirks.o slot-gpio.o

mmc_core-$(CONFIG_DEBUG_FS) += debugfs.o
83 changes: 0 additions & 83 deletions drivers/mmc/core/cd-gpio.c

This file was deleted.

Loading

0 comments on commit a6be1fc

Please sign in to comment.