aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sh_mmcif.c
Commit message (Collapse)AuthorAgeFilesLines
* mmc: add runtime and system power-management support to the MMCIF driverGuennadi Liakhovetski2011-05-241-9/+69
| | | | | | | | | | | | | Adding support for runtime power-management to the MMCIF driver allows it to save power as long as no card is present. To also allow to turn off the power domain at that time, we release DMA channels during that time, since on some sh-mobile systems the DMA controller(s) and the MMCIF block belong to the same power domain. System-wide power management has been tested with experimental PM patches on AP4-based systems. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
* mmc: sh_mmcif: protect against a theoretical raceGuennadi Liakhovetski2011-05-241-8/+42
| | | | | | | | | | | | The MMC subsystem does not guarantee that host driver .request() and .set_ios() callbacks are serialised. Such concurrent calls, however, do not have to be meaningfully supported, drivers just have to make sure to avoid any severe problems. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Cc: Simon Horman <horms@verge.net.au> Cc: Magnus Damm <damm@opensource.se> Signed-off-by: Chris Ball <cjb@laptop.org>
* mmc: sh_mmcif: support aggressive clock gatingGuennadi Liakhovetski2011-03-161-5/+5
| | | | | | | | To support MMC aggressive clock gating the driver has to stop the interface clock when the .set_ios() method is called with .clock == 0. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
* mmc: sh_mmcif: use dmaengine helpers, drop submit checkLinus Walleij2011-03-151-16/+6
| | | | | | | | | Use the new dmaengine helper functions, and drop the error check on the returned cookier from the dmaengine - we recently established that this is really not allowed to fail. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
* mmc: sh_mmcif: rename and retype activity variableLinus Walleij2011-03-151-9/+9
| | | | | | | | The host_sglen is now actually used to keep track of whether DMA is active or not, so rename and retype it to bool. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
* mmc: sh_mmcif: unmap with the proper sglenLinus Walleij2011-03-151-2/+2
| | | | | | | | | According to the DMA-API you shall unmap the sglists with the same sglist length as passed into the mapping function, not the returned value from the mapping function. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
* mmc: sh_mmcif: map DMA buffers on the DMA engine deviceLinus Walleij2011-03-151-4/+8
| | | | | | | | As established for the MMCI, it is proper to map the DMA buffers on the DMA engine which is the one actually performing the DMA. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
* mmc: sh_mmcif: make DMA support by the driver unconditionalGuennadi Liakhovetski2011-01-051-20/+0
| | | | | | | | | Simplify the driver by removing the possibility to build it without the DMA support and remove the respective Kconfig parameter. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* mmc: sh_mmcif: add DMA supportGuennadi Liakhovetski2010-11-251-5/+241
| | | | | | | | | | | The MMCIF controller on sh-mobile platforms can use the DMA controller for data transfers. Interface to the SH dmaengine driver to enable DMA. We also have to lower the maximum number of segments to match with the number od DMA descriptors on SuperH, this doesn't significantly affect driver's PIO performance. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* mmc: sh_mmcif: cosmetic clean upGuennadi Liakhovetski2010-11-251-33/+30
| | | | | | | | Replace pr_* with respective dev_*, sort headers alphabetically, remove an unused struct member, superfluous variable initialisations and type-casts. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* mmc: sh_mmcif: switch to completion, fix flagsGuennadi Liakhovetski2010-11-251-71/+46
| | | | | | | | | | | | | In sh_mmcif.c an event is used as a completion, switch over. When a wait_for_completion*_timeout() returns, it suffices to check the remaining time, setting an additional flag before waking up the waiting task only reduces the race window, but does not eliminate it. This patch switches the driver to use a completion to signal an interrupt, the only case, when an interrupt should not wake up the waiter, is when an automatic CMD12 completes. Also fix MODULE_ALIAS. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* mmc, sh: Move constants to sh_mmcif.hSimon Horman2010-11-101-23/+0
| | | | | | | | | | | | | | This moves some constants from sh_mmcif.c to sh_mmcif.h so that they can be used in sh_mmcif_boot_init(). It also alters the definition of SOFT_RST_OFF from (0 << 31) to ~SOFT_RST_ON (= ~(1 << 31)). The former seems bogus. The latter is consistent with the code in sh_mmcif_boot_init(). Cc: Yusuke Goda <yusuke.goda.sx@renesas.com> Cc: Magnus Damm <magnus.damm@gmail.com> Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* mmc: Allow the platform to specify the sh_mmcif get_cd handlerArnd Hannemann2010-10-291-0/+12
| | | | | | | | | | | | | In some platforms (e.g. AP4EVB) the card detect pin of a slot is not directly connected to the sh_mmcif controller, so that polling needs to be used. To overcome the overhead induced by querying the controller on each poll cycle, card detection can be handled in the platform code more efficiently. This patch exposes a get_cd hook for that purpose. Signed-off-by: Arnd Hannemann <arnd@arndnet.de> Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mmc: Remove distinction between hw and phys segmentsMartin K. Petersen2010-10-231-2/+1
| | | | | | | | | We have deprecated the distinction between hardware and physical segments in the block layer. Consolidate the two limits into one in drivers/mmc/. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Chris Ball <cjb@laptop.org>
* sh: prepare MMCIF driver header fileMagnus Damm2010-05-311-75/+50
| | | | | | | | | Update the MMCIF driver to include register information and register access functions in the header file. The MMCIF boot code builds on top of this. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* mmc: add support MMCIF for SuperHYusuke Goda2010-05-271-0/+965
MMCIF is the MMC Host Interface in SuperH. Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com> Cc: Ben Hutchings <ben@decadent.org.uk> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Magnus Damm <magnus.damm@gmail.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>