summaryrefslogtreecommitdiff
path: root/drivers/mmc
AgeCommit message (Collapse)Author
2013-06-27mmc: dw_mmc: eliminate useless usage of retAndy Shevchenko
In few places usage of ret variable is not needed. This patch simplifies those pieces of code. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Seungwon Jeon <tgih.jun@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27mmc: dw_mmc-pltfm: don't check resource with devm_ioremap_resourceAndy Shevchenko
devm_ioremap_resource does sanity checks on the given resource. No need to duplicate this in the driver. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Seungwon Jeon <tgih.jun@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27mmc: reordered shutdown sequence in mmc_bld_remove_reqPaul Taysom
We had a multi-partition SD-Card with two ext2 file systems. The partition table was getting overwritten by a race between the card removal and the unmount of the 2nd ext2 partition. What was observed: 1. Suspend/resume would call to remove the device. The clearing of the device information is done asynchronously. 2. A request is made to unmount the file system (this is called after the removal has started). 3. The remapping table was cleared by the asynchronous part of the device removal. 4. A write request to the super block (block 0 of the partition) was sent down and instead of being remapped to the partition offset, it was remapped to block 0 of the device which is where the partition table is located. 5. Write was queued and written resulting in the overwriting of the partition table with the ext2 super block. 6. The mmc_queue is cleaned up. The mmc card device driver used to access SD cards, was calling del_gendisk before calling mmc_cleanup-queue. The comment in the mmc_blk_remove_req code indicated that it expected del_gendisk to block all further requests from being queued but it doesn't. The mmc driver uses the presences of the mmc_queue to determine if the request should be queued. The fix was to clean up the mmc_queue before the rest of the the delete partition code is called. This prevents the overwriting of the partition table. However, the umount gets an error trying to write the super block. The umount should be issued before the device is removed but that is not always possible. The umount is still needed to cleanup other data structures. Addresses the problem described in http://crbug.com/240815 Signed-off-by: Paul Taysom <taysom@chromium.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27mmc: sirf: fix sdhci_pltfm_init sequenceArnd Bergmann
Patch "mmc: sdhci: Add size for caller in init+register" changed the interface for sdhci_pltfm_init, while patch "mmc: sdhci-sirf: add mmc host sdhci-pltfm based driver for SiRF SoCs" added a new driver with the old interface. This changes the sirf driver to use the new interface, avoiding one warning, and simplifying the init sequence. Since we're here already, this also adds an error path for failed clk_prepare_enable. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Christian Daudt <csd@broadcom.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27mmc: host: use platform_{get,set}_drvdata()Jingoo Han
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev, so we can directly pass a struct platform_device. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27mmc: sh_mobile_sdhi: fix error return code in sh_mobile_sdhi_probe()Wei Yongjun
Fix to return a negative error code instead of 0 when we cannot get IRQ source by platform_get_irq(), as done elsewhere in this function. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27mmc: sdhci-acpi: fix error return code in sdhci_acpi_add_own_cd()Wei Yongjun
Fix to return a negative error code in the gpio_to_irq() error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Reviewed-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27mmc: dw_mmc: change the macro name from DTO to DRTOJaehoon Chung
At Interrupt status register, Bit9 is Data Read Timeout. But we used macro name as the DTO. It could be confused with the Data Transfer Over(DTO)-Bit[3]. It's clearly that is changed the DRTO instead of DTO. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: James Hogan <james.hogan@imgtec.com> Acked-by: Seungwon Jeon <tgih.jun@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27mmc: mxs-mmc: Let device core handle pinctrlFabio Estevam
Since commit ab78029 (drivers/pinctrl: grab default handles from device core), we can rely on device core for handling pinctrl. So remove devm_pinctrl_get_select_default() from the driver. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27mmc: core: Update the ext-csd.rev check for eMMC5.1Yuvaraj Kumar C D
With the new eMMC5.1 spec, there is a new EXT_CSD register with the revision number(EXT_CSD_REV) 7. This patch updates the check for ext-csd.rev number as 7. Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Yuvaraj Kumar C D <yuvaraj.cd@samsung.com> Reviewed-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27mmc: sdhci-sirf: let device core setup the default pin configurationBarry Song
With device core now able to setup the default pin configuration, the call to devm_pinctrl_get_select_default can be removed. And the pin configuration code based on the deprecated Samsung specific gpio bindings is also removed. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27mmc: mvsdio: use standard MMC device-tree binding parser mmc_of_parse()Simon Baatz
Instead of parsing the DT binding on our own, use the standard parser mmc_of_parse(), introduced by commit 6c56e7a. Signed-off-by: Simon Baatz <gmbnomis@gmail.com> Tested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27mmc: tegra: handle mmc_of_parse() errors during probeSimon Baatz
Signed-off-by: Simon Baatz <gmbnomis@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27mmc: sdhci-pxav3: handle mmc_of_parse() errors during probeSimon Baatz
Signed-off-by: Simon Baatz <gmbnomis@gmail.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27mmc: mxcmmc: handle mmc_of_parse() errors during probeSimon Baatz
Signed-off-by: Simon Baatz <gmbnomis@gmail.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27mmc: tmio-mmc: handle mmc_of_parse() errors during probeSimon Baatz
Signed-off-by: Simon Baatz <gmbnomis@gmail.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27mmc: sh_mmcif: handle mmc_of_parse() errors during probeSimon Baatz
Signed-off-by: Simon Baatz <gmbnomis@gmail.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27mmc: return mmc_of_parse() errors to callerSimon Baatz
In addition to just logging errors encountered during DT parsing or allocating GPIO slots for CD/WP, mmc_of_parse() now returns with an error. In particular, this is needed if the GPIO allocation may return EPROBE_DEFER. Signed-off-by: Simon Baatz <gmbnomis@gmail.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27mmc: jz4740: Use clk_prepare_enable/clk_disable_unprepareLars-Peter Clausen
In preparation to switching the jz4740 clk driver to the common clk framework, update the clk enable/disable calls to clk_prepare_enable/clk_disable_unprepare. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-24msm_sdcc: Convert to clk_prepare/unprepareStephen Boyd
Add calls to clk_prepare and unprepare so that MSM can migrate to the common clock framework. Cc: Chris Ball <cjb@laptop.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: David Brown <davidb@codeaurora.org>
2013-06-20Merge tag 'davinci-for-v3.11/soc-v2' of ↵Arnd Bergmann
git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into next/soc From Sekhar Nori: DaVinci SoC changes for v3.11 This pull request moves DaVinci EDMA library to arch/arm/common so it can be used by OMAP based AM335x. This is a temporary step until all drivers are converted to use the dmaengine driver in drivers/dma/edma.c. Several drivers like SPI, MMC/SD have already been converted. Some like audio are pending. The other two patches in the pull request are cleanup in nature. * tag 'davinci-for-v3.11/soc-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci: ARM: edma: remove unused transfer controller handlers ARM: davinci: move private EDMA API to arm/common ARM: davinci: remove __init atrribute from function declaration Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2013-06-18ARM: davinci: move private EDMA API to arm/commonMatt Porter
Move mach-davinci/dma.c to common/edma.c so it can be used by OMAP (specifically AM33xx) as well. Signed-off-by: Matt Porter <mporter@ti.com> Acked-by: Chris Ball <cjb@laptop.org> # davinci_mmc.c Acked-by: Mark Brown <broonie@linaro.org> Acked-by: Olof Johansson <olof@lixom.net> [nsekhar@ti.com: dropped davinci sffsdr changes] Signed-off-by: Sekhar Nori <nsekhar@ti.com>
2013-06-06mmc: tmio: reset the controller after power-upGuennadi Liakhovetski
This fixes two reported problems: 1. after a system resume the controller isn't functioning until a command runs on a timeout and a controller reset is performed. 2. if a card is ejected during a running write operation, its re-insertion isn't detected. Reported-by: Nguyen Viet Dung <nv-dung@jinso.co.jp> Reported-by: Nguyen Hong Ky <nh-ky@jinso.co.jp> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Tested-by: Nguyen Viet Dung <nv-dung@jinso.co.jp> Tested-by: Nguyen Hong Ky <nh-ky@jinso.co.jp> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-06mmc: tmio: fix unbalanced power-on calls with clock-gating enabledGuennadi Liakhovetski
With MMC clock gating enabled the MMC core currently calls MMC host driver's .set_ios() method with .power_mode == MMC_POWER_ON and the clock value set either to 0 or to the target rate. The tmio MMC driver then wrongly translates the latter calls to card slot power-on requests, even when the slot already was on. This patch fixes the driver to avoid needlessly incrementing power-supplying regulator's use count. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-06mmc: sh_mmcif: don't clear masked interruptsGuennadi Liakhovetski
Masking events on MMCIF means that an occurrence of the masked event won't raise an interrupt, but the event bit will still be set in the interrupt status register. If simultaneously a different event occurs which was enabled, both flags will be set. However, only the unmasked event bit should be cleared in the status register in such a case. Clearing also the masked bit can lead to lost interrupts, which indeed can be observed on the armadillo800eva r8a7740 board with an eMMC chip. The problem has been introduced by the recent "mmc: sh_mmcif: simplify IRQ processing" patch. Fix the problem by only clearing enabled interrupts. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Tested-by: Nguyen Viet Dung <nv-dung@jinso.co.jp> Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-06mmc: tmio: postpone controller reset during resumeGuennadi Liakhovetski
When resuming, the tmio_mmc_host_resume() function is run when the controller might still be powered down. Issuing a reset command to it at that time has no effect. This patch postpones resetting the controller until the first powering-up .set_ios() call. Reported-by: Nguyen Viet Dung <nv-dung@jinso.co.jp> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-03PM / Runtime: Rework the "runtime idle" helper routineRafael J. Wysocki
The "runtime idle" helper routine, rpm_idle(), currently ignores return values from .runtime_idle() callbacks executed by it. However, it turns out that many subsystems use pm_generic_runtime_idle() which checks the return value of the driver's callback and executes pm_runtime_suspend() for the device unless that value is not 0. If that logic is moved to rpm_idle() instead, pm_generic_runtime_idle() can be dropped and its users will not need any .runtime_idle() callbacks any more. Moreover, the PCI, SCSI, and SATA subsystems' .runtime_idle() routines, pci_pm_runtime_idle(), scsi_runtime_idle(), and ata_port_runtime_idle(), respectively, as well as a few drivers' ones may be simplified if rpm_idle() calls rpm_suspend() after 0 has been returned by the .runtime_idle() callback executed by it. To reduce overall code bloat, make the changes described above. Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> Tested-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Kevin Hilman <khilman@linaro.org> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Alan Stern <stern@rowland.harvard.edu>
2013-05-31mmc: sdhci: Add size for caller in init+registerChristian Daudt
Add a param to allow users of sdhci_pltfm to allocate private space in calls to sdhci_pltfm_init+sdhci_pltfm_register. This is implemented in the same way as sdhci does for its users. None of the users have been migrated yet and are passing in zero to retain their private allocation. - todo: migrate clients to using allocation this way - todo: remove priv variable once migration is complete Also removed unused variable in sdhci_pltfm_init fn Signed-off-by: Christian Daudt <csd@broadcom.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: sdhci-pci: support runtime PM for BYT SD cardsAdrian Hunter
Add support for runtime PM for BYT SD cards. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: sdhci-acpi: support runtime PM for ACPI HID 80860F14 SD cardsAdrian Hunter
Enable runtime PM for ACPI HID 80860F14 SD cards, adding support for card detect GPIO. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: sdhci: add ability to stay runtime-resumed if the card is powered upAdrian Hunter
If card power is dependent on SD bus power then the host controller must not be runtime suspended while the card is powered up. Add the ability to stay runtime-resumed in that case and enable it with a new quirk SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: remove unnecessary platform_set_drvdata()Jingoo Han
The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Sonic Zhang <sonic.zhang@analog.com> Acked-by: Seungwon Jeon <tgih.jun@samsung.com> Acked-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com> Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Tony Prisk <linux@prisktech.co.nz> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: sdhci-pltfm: Allow drivers to set quirks2 from platform dataAl Cooper
Signed-off-by: Al Cooper <alcooperx@gmail.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: atmel-mci: add CONFIG_PM_SLEEP to suspend/resume functionsJingoo Han
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled. drivers/mmc/host/atmel-mci.c:2509:12: warning: 'atmci_suspend' defined but not used [-Wunused-function] drivers/mmc/host/atmel-mci.c:2539:12: warning: 'atmci_resume' defined but not used [-Wunused-function] Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: sdhi/tmio: add DT DMA supportGuennadi Liakhovetski
Add support for initialising DMA from the Device Tree. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: sdhi/tmio: switch to using dmaengine_slave_config()Guennadi Liakhovetski
This removes the deprecated use of the .private member of struct dma_chan and switches the sdhi / tmio mmc driver to using the dmaengine_slave_config() channel configuration method. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: sdhi/tmio: make DMA filter implementation specificGuennadi Liakhovetski
So far only the SDHI implementation uses TMIO MMC with DMA. That way a DMA channel filter function, defined in the TMIO driver wasn't a problem. However, such a filter function is DMA controller specific. Since the SDHI glue is only running on systems with the SHDMA DMA controller, the filter function can safely be provided by it. Move it into SDHI. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: dw_mmc: clear IDSTS register when initialize IDMACJoonyoung Shim
If pending interrupt for IDMAC exists when initialize IDMAC, it will call interrupt handler unnecessarily. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Acked-by: Seungwon Jeon <tgih.jun@samsung.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: core: Fix select power class after resumeFredrik Soderstedt
Use the saved values in card->ext_csd when selecting power class. By doing this the power class will be selected even if mmc_init_card is called with oldcard != NULL, which is the case after a suspend/resume. Today ext_csd is NULL if mmc_init_card is called with oldcard != NULL and power class will not be selected. According to the eMMC specification the POWER_CLASS value is reset after power failure, H/W reset assertion and any CMD0 reset. Signed-off-by: Fredrik Soderstedt <fredrik.soderstedt@stericsson.com> Reviewed-by: Johan Rudholm <jrudholm@gmail.com> Acked By: Girish K S <girish.shivananjappa@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: core: Restructure and simplify code for mmc sleep|awakeUlf Hansson
The mmc_card_sleep|awake APIs are not being used since the support is already properly encapsulated within the suspend sequence. Sleep|awake command is also specific for eMMC. We remove the sleep|awake bus_ops, the mmc_card_sleep|awake APIs and move the code into the mmc specific core instead. This also includes the mmc ops function, mmc_sleepawake. All releated functions have then become static and we have got far less code to maintain. Additionally this patch also simplifies the code from mmc_sleepawake, since it is only used to put the card to sleep and not awake. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: core: Support aggressive power management for (e)MMC/SDUlf Hansson
Aggressive power management is suitable when saving power is essential. At request inactivity timeout, aka pm runtime autosuspend timeout, the card will be suspended. Once a new request arrives, the card will be re-initalized and thus the first request will suffer from a latency. This latency is card-specific, experiments has shown in general that SD-cards has quite poor initialization time, around 300ms-1100ms. eMMC is not surprisingly far better but still a couple of hundreds of ms has been observed. Except for the request latency, it is important to know that suspending the card will also prevent the card from executing internal house-keeping operations in idle mode. This could mean degradation in performance. To use this feature make sure the request inactivity timeout is chosen carefully. This has not been done as a part of this patch. Enable this feature by using host cap MMC_CAP_AGGRESSIVE_PM and by setting CONFIG_MMC_UNSAFE_RESUME. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: block: Enable runtime pm for mmc blkdeviceUlf Hansson
Once the mmc blkdevice is being probed, runtime pm will be enabled. By using runtime autosuspend, the power save operations can be done when request inactivity occurs for a certain time. Right now the selected timeout value is set to 3 s. Obviously this value will likely need to be configurable somehow since it needs to be trimmed depending on the power save algorithm. For SD-combo cards, we are still leaving the enablement of runtime PM to the SDIO init sequence since it depends on the capabilities of the SDIO func driver. Moreover, when the blk device is being suspended, we make sure the device will be runtime resumed. The reason for doing this is that we want the host suspend sequence to be unaware of any runtime power save operations done for the card in this phase. Thus it can just handle the suspend as the card is fully powered from a runtime perspective. Finally, this patch prepares to make it possible to move BKOPS handling into the runtime callbacks for the mmc bus_ops. Thus IDLE BKOPS can be accomplished. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: core: Add bus_ops for runtime pm callbacksUlf Hansson
SDIO is the only protocol that uses runtime pm for the card device right now. To provide the option for sd and mmc to use runtime pm as well the bus_ops callback are extended with two new functions. One for runtime_suspend and one for runtime_resume. This patch will also implement the callbacks for SDIO to make sure existing functionality is maintained. It also prepares to move away from using the mmc_power_restore_host API, since it is not needed when using runtime PM. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: core: Stop bkops for eMMC only from mmc suspendUlf Hansson
Move mmc suspend specific operations to be executed from the .suspend callback in the mmc bus_ops. This simplifies the mmc_suspend_host function which is supposed to handle nothing but common suspend tasks. Since eMMC can be considered non-removable there are no need to check for ongoing bkops at PM_SUSPEND_PREPARE notification so remove it. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: mxs-mmc: fix error return code in mxs_mmc_probe()Wei Yongjun
Fix to return -ENODEV in the request dma error case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: dw_mmc: fix error return code in dw_mci_probe()Wei Yongjun
Fix to return -ENOMEM in alloc workqueue error case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Seungwon Jeon <tgih.jun@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: card: Adding support for sanitize in eMMC 4.5Maya Erez
The sanitize support is added as a user-app ioctl call, and was removed from the block-device request, since its purpose is to be invoked not via File-System but by a user. This feature deletes the unmap memory region of the eMMC card, by writing to a specific register in the EXT_CSD. unmap region is the memory region that was previously deleted (by erase, trim or discard operation). In order to avoid timeout when sanitizing large-scale cards, the timeout for sanitize operation is 240 seconds. Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: core: Re-use code for MMC_CAP2_DETECT_ON_ERR in polling modeUlf Hansson
Previously the MMC_CAP2_DETECT_ON_ERR was invented for detecting slow card removal. In was never a realy good solution and a proper fix has been merged using gpio debouncing instead. We remove this cap in this patch. Although when using polling card detect mode, the code invented for MMC_CAP2_DETECT_ON_ERR is re-used to complete card removal in an earlier phase. There are no need waiting for the polling timeout to elapse in this case. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Kevin Liu <kliu5@marvell.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt caseSantosh Shilimkar
MMC driver probe will abort for DT case because of failed platform_get_resource_byname() lookup. Fix it by skipping resource lookup byname for device tree build. Issue is hidden because hwmod populates the IO resources which helps to succeed platform_get_resource_byname() and probe. Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by: Balaji T K <balajitk@ti.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: core: Only execute tuning for SDR50 and SDR104Fredrik Soderstedt
Only execute tuning for sd and sdio devices that are using SDR50 or SDR104. Make sure clock is hold during tuning for sdio devices. Signed-off-by: Fredrik Soderstedt <fredrik.soderstedt@stericsson.com> Acked-by: Johan Rudholm <jrudholm@gmail.com> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>