summaryrefslogtreecommitdiff
path: root/drivers/mmc/host/sh_mmcif.c
AgeCommit message (Collapse)Author
2012-05-17dmaengine/dma_slave: fix merge issueLaxman Dewangan
Merges of dma changes from mainline reported conflict and it was not got resolved properly. Fix the resolution issue. Change-Id: I7edc5effc0b9a61363e77e6cc39eb62e315396d0 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/102590 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit
2012-04-05dmaengine/dma_slave: introduce inline wrappersAlexandre Bounine
Add inline wrappers for device_prep_slave_sg() and device_prep_dma_cyclic() interfaces to hide new parameter from current users of affected interfaces. Convert current users to use new wrappers instead of direct calls. Suggested by Russell King [https://lkml.org/lkml/2012/2/3/269]. Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com> cherry-picked from mainline commit 16052827d98fbc13c31ebad560af4bd53e2b4dd5 Change-Id: I929a49556539621a0546829e88b3caa498c94be2 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/94463
2011-07-21mmc: sh_mmcif: maximize power savingGuennadi Liakhovetski
This patch uses runtime PM to allow the system to power down the MMC controller, when the MMC closk is switched off. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-05-24mmc: add runtime and system power-management support to the MMCIF driverGuennadi Liakhovetski
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>
2011-05-24mmc: sh_mmcif: protect against a theoretical raceGuennadi Liakhovetski
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>
2011-03-16mmc: sh_mmcif: support aggressive clock gatingGuennadi Liakhovetski
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>
2011-03-15mmc: sh_mmcif: use dmaengine helpers, drop submit checkLinus Walleij
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>
2011-03-15mmc: sh_mmcif: rename and retype activity variableLinus Walleij
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>
2011-03-15mmc: sh_mmcif: unmap with the proper sglenLinus Walleij
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>
2011-03-15mmc: sh_mmcif: map DMA buffers on the DMA engine deviceLinus Walleij
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>
2011-01-05mmc: sh_mmcif: make DMA support by the driver unconditionalGuennadi Liakhovetski
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>
2010-11-25mmc: sh_mmcif: add DMA supportGuennadi Liakhovetski
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>
2010-11-25mmc: sh_mmcif: cosmetic clean upGuennadi Liakhovetski
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>
2010-11-25mmc: sh_mmcif: switch to completion, fix flagsGuennadi Liakhovetski
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>
2010-11-10mmc, sh: Move constants to sh_mmcif.hSimon Horman
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>
2010-10-29mmc: Allow the platform to specify the sh_mmcif get_cd handlerArnd Hannemann
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>
2010-10-23mmc: Remove distinction between hw and phys segmentsMartin K. Petersen
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>
2010-05-31sh: prepare MMCIF driver header fileMagnus Damm
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>
2010-05-27mmc: add support MMCIF for SuperHYusuke Goda
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>