aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc
AgeCommit message (Collapse)Author
2010-10-29mfd: Adding twl6030 mmc card detect support for MMC1kishore kadiyala
Adding card detect callback function and card detect configuration function for MMC1 Controller on OMAP4. Card detect configuration function does initial configuration of the MMC Control & PullUp-PullDown registers of Phoenix. For MMC1 Controller, card detect interrupt source is twl6030 which is non-gpio. The card detect call back function provides card present/absent status by reading MMC Control register present on twl6030. Since OMAP4 doesn't use any GPIO line as used in OMAP3 for card detect, the suspend/resume initialization which was done in omap_hsmmc_gpio_init previously is moved to the probe thus making it generic for both OMAP3 & OMAP4. Cc: Tony Lindgren <tony@atomide.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Madhusudhan Chikkature <madhu.cr@ti.com> Cc: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-10-29mmc: Allow 2 byte requests in 4-bit mode for tmio_mmcYusuke Goda
Adjust the tmio_mmc block size check to accept 2-byte requests in 4-bit mode if the hardware supports it. Tested with the SDHI hardware block included in sh7724. Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com> Signed-off-by: Matt Fleming <matt@console-pimps.org> Acked-by: Magnus Damm <damm@opensource.se> Tested-by: Arnd Hannemann <arnd@arndnet.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
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-29mmc: Allow the tmio_mmc mfd driver to specify get_cd handlerArnd Hannemann
Some controllers, supported by the tmio_mmc driver do not have the card detect pin of a slot connected, so that polling needs to be used and card detection is handled by other means. This patch exposes a get_cd hook for that purpose. Signed-off-by: Arnd Hannemann <arnd@arndnet.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-10-28Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (66 commits) mmc: add new sdhci-pxa driver for Marvell SoCs mmc: make number of mmcblk minors configurable mmc_spi: Recover from CRC errors for r/w operation over SPI. mmc: sdhci-pltfm: add -pltfm driver for imx35/51 mmc: sdhci-of-esdhc: factor out common stuff mmc: sdhci_pltfm: pass more data on custom init call mmc: sdhci: introduce get_ro private write-protect hook mmc: sdhci-pltfm: move .h file into appropriate subdir mmc: sdhci-pltfm: Add structure for host-specific data mmc: fix cb710 kconfig dependency warning mmc: cb710: remove debugging printk (info duplicated from mmc-core) mmc: cb710: clear irq handler on init() error path mmc: cb710: remove unnecessary msleep() mmc: cb710: implement get_cd() callback mmc: cb710: partially demystify clock selection mmc: add a file to debugfs for changing host clock at runtime mmc: sdhci: allow for eMMC 74 clock generation by controller mmc: sdhci: highspeed: check for mmc as well as sd cards mmc: sdhci: Add Moorestown device support mmc: sdhci: Intel Medfield support ...
2010-10-26at91/atmel-mci: inclusion of sd/mmc driver in at91sam9g45 chip and boardNicolas Ferre
This adds the support of atmel-mci sd/mmc driver in at91sam9g45 devices and board files. This also configures the DMA controller slave interface for at_hdmac dmaengine driver. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2010-10-25Merge branch 'omap-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 * 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: (163 commits) omap: complete removal of machine_desc.io_pg_offst and .phys_io omap: UART: fix wakeup registers for OMAP24xx UART2 omap: Fix spotty MMC voltages ASoC: OMAP4: MCPDM: Remove unnecessary include of plat/control.h serial: omap-serial: fix signess error OMAP3: DMA: Errata i541: sDMA FIFO draining does not finish omap: dma: Fix buffering disable bit setting for omap24xx omap: serial: Fix the boot-up crash/reboot without CONFIG_PM OMAP3: PM: fix scratchpad memory accesses for off-mode omap4: pandaboard: enable the ehci port on pandaboard omap4: pandaboard: Fix the init if CONFIG_MMC_OMAP_HS is not set omap4: pandaboard: remove unused hsmmc definition OMAP: McBSP: Remove null omap44xx ops comment OMAP: McBSP: Swap CLKS source definition OMAP: McBSP: Fix CLKR and FSR signal muxing OMAP2+: clock: reduce the amount of standard debugging while disabling unused clocks OMAP: control: move plat-omap/control.h to mach-omap2/control.h OMAP: split plat-omap/common.c OMAP: McBSP: implement functional clock switching via clock framework OMAP: McBSP: implement McBSP CLKR and FSR signal muxing via mach-omap2/mcbsp.c ... Fixed up trivial conflicts in arch/arm/mach-omap2/ {board-zoom-peripherals.c,devices.c} as per Tony
2010-10-25mmc: add new sdhci-pxa driver for Marvell SoCsZhangfei Gao
Support Marvell PXA168/PXA910/MMP2 SD Host Controller. Signed-off-by: Zhangfei Gao <zhangfei.gao@marvell.com> Acked-by: Haojian Zhuang <haojian.zhuang@marvell.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-25mmc: make number of mmcblk minors configurableOlof Johansson
The old limit of number of minor numbers per mmcblk device was hardcoded at 8. This isn't enough for some of the more elaborate partitioning schemes, for example those used by Chrome OS. Since there might be a bunch of systems out there with static /dev contents that relies on the old numbering scheme, let's make it a build-time option with the default set to the previous 8. Also provide a boot/modprobe-time parameter to override the config default: mmcblk.perdev_minors. Signed-off-by: Olof Johansson <olof@lixom.net> Cc: Mandeep Baines <msb@chromium.org> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc_spi: Recover from CRC errors for r/w operation over SPI.Sonic Zhang
The SPI bus is not reliable for large data transfers on all platforms. The current mmc_spi driver fails SD read/write commands immediately if occasional CRC errors are reported by the SD device. This patch makes the operation recover from CRC errors by repeating the last SD command. The retry count is set to 5 to ensure the driver passes stress tests. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdhci-pltfm: add -pltfm driver for imx35/51Wolfram Sang
This driver adds basic support for the esdhc-core found on e.g. imx35/51, as a platform driver. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Anton Vorontsov <cbouatmailru@gmail.com> Tested-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdhci-of-esdhc: factor out common stuffWolfram Sang
Put everything which can be shared between the OF and platform version of this driver into a local .h file. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Tested-by: Eric Bénard <eric@eukrea.com> [cjb: fix compile error: sdhci-esdhc.c->sdhci-esdhc.h] Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdhci_pltfm: pass more data on custom init callWolfram Sang
The custom init call may need more data to perform its job, so we pass it a pointer to pdata, too. Also, always use the platform_id specific data even if platform_data is present. Doing that, platform_data can additionally be parsed by init() for board-specific information (via sdhci->mmc->parent). (Note: the old behaviour was that you could override the platform_id specific data with your own. However, one can still do this by using the "sdhci" id instead of "sdhci-<something>".) Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Tested-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdhci: introduce get_ro private write-protect hookWolfram Sang
Some controllers handle their write-protection differently. Introduce a callback to be able to handle it, ensuring the same locking takes place for it. Rename the status variable to make it more obvious why the read from the registers needs to be inverted. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Tested-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdhci-pltfm: move .h file into appropriate subdirWolfram Sang
Make use of the include/linux/mmc directory. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Anton Vorontsov <cbouatmailru@gmail.com> Tested-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdhci-pltfm: Add structure for host-specific dataWolfram Sang
We need to carry some information per host, e.g. the clock. Add a structure for it and initialize it in the generic part. Also improve the check for a parent. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Cc: Richard Röjfors <richard.rojfors.ext@mocean-labs.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: fix cb710 kconfig dependency warningRandy Dunlap
Fix kconfig dependency warning to satisfy dependencies: warning: (MMC_CB710 && MMC && PCI) selects CB710_CORE which has unmet direct dependencies (MISC_DEVICES && PCI) Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: cb710: remove debugging printk (info duplicated from mmc-core)Michał Mirosław
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: cb710: clear irq handler on init() error pathMichał Mirosław
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: cb710: remove unnecessary msleep()Michał Mirosław
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: cb710: implement get_cd() callbackMichał Mirosław
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: cb710: partially demystify clock selectionMichał Mirosław
Clock divider selection in partially verified, so document known facts in code. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: add a file to debugfs for changing host clock at runtimeAndy Shevchenko
For debugging power management features it is convenient to have the possibility of changing the MMC host controller clock at runtime. This patch adds a 'clock' file for this under the MMC host root of debugfs. Usage is as follows: # cat /sys/kernel/debug/mmc0/clock 52000000 # echo "1000000000" > /sys/kernel/debug/mmc0/clock # cat /sys/kernel/debug/mmc0/clock 52000000 # echo "48000000" > /sys/kernel/debug/mmc0/clock # cat /sys/kernel/debug/mmc0/clock 48000000 The middle example shows limits being applied by the host driver. Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com> Cc: Adrian Hunter <adrian.hunter@nokia.com> [cjb: modify changelog language] Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdhci: allow for eMMC 74 clock generation by controllerPhilip Rakity
Snippet of code for how adaptation layer should handle the call: /* * eMMC spec calls for the host to send 74 clocks to the card * during initialization, right after voltage stabilization. * create the clocks manually right here. */ void generate_init_clocks_A0(struct sdhci_host *host, u8 power_mode) { struct sdhci_mmc_slot *slot = sdhci_priv(host); if (slot->power_mode == MMC_POWER_UP && power_mode == MMC_POWER_ON) { /* controller specific code here */ /* slot->power_mode holds previous power setting */ } slot->power_mode = power_mode; } Signed-off-by: Philip Rakity <prakity@marvell.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdhci: highspeed: check for mmc as well as sd cardsPhilip Rakity
The SD and MMC code set highspeed using different constants. Change the sd driver to recognize this and switch to high speed. Validated code when testing eMMC dual data rate. Signed-off-by: Philip Rakity <prakity@marvell.com> [cjb: changelog + indentation fixes] Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdhci: Add Moorestown device supportAlan Cox
This adds the basic identifiers. Due to the various chip quirks it's not enough to make MRST support very useful for earlier steppings but that can follow. (I'm currently trying to verify which steps actually matter outside Intel so I can avoid unneeded stuff going upstream) [Extracted from original development] Signed-off-by: JiebingLi <jiebing.li@intel.com> [Folds in fixes] Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdhci: Intel Medfield supportXiaochen Shen
Basic support for the Intel Medfield devices Give them their own quirks as we will need to update this later. Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdhci: Allow the probe handler to override slotsAlan Cox
Currently we write it to the chip data, but if the probe handler overrides it we ignore the new value and keep using our cached one. Fix this so that a probe handler can adjust the slot count. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdio: support suspend/resume while runtime suspendedOhad Ben-Cohen
Bring SDIO devices back to full power before their suspend handler is invoked. Doing so ensures that SDIO suspend/resume semantics are maintained (drivers still get to decide whether their card should be removed or kept during system suspend, and at what power state), and that SDIO suspend/resume execution paths are unchanged. This is achieved by resuming a runtime-suspended SDIO device in its ->prepare() PM callback (similary to the PCI subsystem). Since the PM core always increments the run-time usage counter before calling the ->prepare() callback and decrements it after calling the ->complete() callback, it is guaranteed that when the system will come out of suspend, our device's power state will reflect its runtime PM usage counter. Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Tested-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdio: ensure mmc_sdio_detect is poweredOhad Ben-Cohen
To prevent an erroneous removal of the card, make sure the device is powered when it is mmc_sdio_detect()ed. This is required since mmc_sdio_detect may be invoked while the device is runtime suspended (e.g., MMC core is rescanning when system comes out of suspend). Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Tested-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdio: enable runtime PM for SDIO functionsOhad Ben-Cohen
Enable runtime PM for SDIO functions. SDIO functions are initialized with a disabled runtime PM state, and are set active (and their usage count is incremented) only before potential drivers are probed. SDIO function drivers that support runtime PM should call pm_runtime_put_noidle() in their probe routine, and pm_runtime_get_noresume() in their remove routine (very similarly to PCI drivers). In case a matching driver does not support runtime PM, power will always be kept high (since the usage count is positive). Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Tested-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdio: enable runtime PM for SDIO cardsOhad Ben-Cohen
Enable runtime PM for new SDIO cards. As soon as the card will be added to the device tree, runtime PM core will release its power, since it doesn't have any users yet. Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Tested-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdio: use the generic runtime PM handlersOhad Ben-Cohen
Assign the generic runtime PM handlers for SDIO. These handlers invoke the relevant SDIO function drivers' handlers, if exist, otherwise they just return success (so SDIO drivers don't have to define any runtime PM handlers unless they need to). Runtime PM is still disabled by default, so this patch alone has no immediate effect. Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Tested-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: add runtime PM handlersOhad Ben-Cohen
Add MMC runtime PM handlers, which call mmc_power_save_host and mmc_power_restore_host in response to runtime_suspend and runtime_resume events. Runtime PM is still disabled by default, so this patch alone has no immediate effect. Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Tested-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdio: add power_restore supportOhad Ben-Cohen
Add a power_restore handler to the SDIO bus ops, in order to support waking up SDIO cards that were powered off by runtime pm. Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Tested-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: propagate power save/restore ops return valueOhad Ben-Cohen
Allow power save/restore and their relevant mmc_bus_ops handlers exit with a return value. Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Tested-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdio: fully reconfigure oldcard on resumeOhad Ben-Cohen
On resume, let mmc_sdio_init_card go all the way, instead of skipping the reconfiguration of the card's speed and width. This is needed to ensure cards wake up with their clock reconfigured (otherwise it's kept low). This patch also removes the explicit bus width reconfiguration on resume, since now this is part of mmc_sdio_init_card. Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Tested-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdhci: split up sdhci.h for sdhci-pltfm usersGiuseppe Cavallaro
Some platforms based on sdhci-pltfm need to set their own quirks. Previously to this patch, the quirks were in drivers/mmc/host/sdhci.h. This patch splits drivers/mmc/host/sdhci.h into two parts: * drivers/mmc/host/sdhci.h includes the HC registers and I/O accessors. * include/linux/mmc/sdhci.h includes the sdhci structure and quirks. Instead of including drivers/mmc/host/sdhci.h, -pltfm drivers should now include include/linux/mmc/sdhci.h and include/linux/sdhci-pltfm.h. This patch avoids adding/changing the calls/flags in the sdhci_pltfm_data structure. It has been tested on STM platforms (e.g. STx7106, STx7108, STx5206) where the driver is configured and used as shown in the example below: [snip] static int mmc_pad_resources(struct sdhci_host *sdhci) { if (!devm_stm_pad_claim(sdhci->mmc->parent, &stx7108_mmc_pad_config, dev_name(sdhci->mmc->parent))) return -ENODEV; return 0; } static struct sdhci_pltfm_data stx7108_mmc_platform_data = { .init = mmc_pad_resources, .quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC, }; static struct platform_device stx7108_mmc_device = { .name = "sdhci", [snip] Note: drivers/mmc/host/sdhci.h now also includes linux/mmc/sdhci.h, and no modifications should be needed on other sdhci-<XXX> drivers. Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Reviewed-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdhci: fix "pwr may be used uninitialized" warningGiuseppe Cavallaro
This patch fixes a warning when compiling the sdhci driver: pwr may be used uninitialized in sdhci_set_power Tested with the following compiler versions: 4.2.4 and 4.4.4 Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Reviewed-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdhci-pltfm: add suspend/resume functionsGiuseppe Cavallaro
This patch adds the suspend and resume functions in the sdhci-pltfm device driver. Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Reviewed-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: name mmc queue thread by host indexEthan Du
Usually there are multiple mmc host controllers; rename mmc queue thread by host index so we can easily identify which controller it belongs to. Signed-off-by: Ethan Du <ethan.too@gmail.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: refine DDR supportAdrian Hunter
One flaw with DDR support is that MMC core does not inform the driver which DDR mode it has selected. This patch expands the ios->ddr flag to do that. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: Fixes for Dual Data Rate (DDR) supportAdrian Hunter
The DDR support patch needs the following fixes: - The block driver does not need to know about DDR, any more than it needs to know about bus width. - Not only the card must be switched to DDR mode. The host controller must also be configured, which is done through the 'set_ios()' function. - Do not set the DDR mode state until after the switch command is successful. - Setting block length is not supported in DDR mode. Make that a core function and change the other place it is used (mmc_test) also. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: MMC 4.4 DDR supportHanumath Prasad
Add support for Dual Data Rate MMC cards as defined in the 4.4 specification. Signed-off-by: Hanumath Prasad <hanumath.prasad@stericsson.com> Cc: linux-mmc@vger.kernel.org Acked-by: Linus Walleij <linus.walleij@stericsson.com> Tested-by Zhangfei Gao <zhangfei.gao@marvell.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: Move regulator handling closer to coreLinus Walleij
After discovering a problem in regulator reference counting I took Mark Brown's advice to move the reference count into the MMC core by making the regulator status a member of struct mmc_host. I took this opportunity to also implement NULL versions of the regulator functions so as to rid the driver code from some ugly #ifdef CONFIG_REGULATOR clauses. Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Cc: Tony Lindgren <tony@atomide.com> Cc: Adrian Hunter <adrian.hunter@nokia.com> Cc: Robert Jarzmik <robert.jarzmik@free.fr> Cc: Sundar Iyer <sundar.iyer@stericsson.com> Cc: Daniel Mack <daniel@caiaq.de> Cc: Pierre Ossman <pierre@ossman.eu> Cc: Matt Fleming <matt@console-pimps.org> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Eric Miao <eric.y.miao@gmail.com> Cc: Cliff Brake <cbrake@bec-systems.com> Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdhci: mmc_rescan: reduce verbosityEric Bénard
mmc_rescan() includes a pr_info which prints 4 lines each second for hosts configured with MMC_CAP_NEEDS_POLL. This patch enables the message only if CONFIG_MMC_DEBUG is selected. Tested on i.MX51's sdhci-esdhc. Signed-off-by: Eric Bénard <eric@eukrea.com> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Hein Tibosch <hein_tibosch@yahoo.es> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: Make ID freq configurableHein Tibosch
In the latest releases of the mmc driver, the freq during initialization is set to a fixed 400 Khz. This was reportedly too fast for several users. As there doesn't seem to be an ideal frequency which-works-for-all, Pierre suggested to let the driver try several frequencies. This patch implements that idea. It will try mmc-initialization using several frequencies from an array 400, 300, 200 and 100. In case SDIO is broken, it'll still try to detect SDMEM, also at different freqs. Signed-off-by: Hein Tibosch <hein_tibosch@yahoo.es> Cc: Pierre Ossman <pierre@ossman.eu> Reviewed-by: Chris Ball <cjb@laptop.org> Tested-by: Chris Ball <cjb@laptop.org> Cc: Ben Nizette <bn@niasdigital.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Adrian Hunter <adrian.hunter@nokia.com> Cc: Matt Fleming <matt@console-pimps.org> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: sdhci: disable MMC_CAP_NEEDS_POLL in nonremovable caseJaehoon Chung
When a controller requires SDHCI_QUIRK_BROKEN_CARD_DETECTION, we poll for card insertion/removal, and that creates interrupts. There's no need to be doing this if we have a non-removable card. This patch requires cards to be removable before we're willing to set MMC_CAP_NEEDS_POLL. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Matt Fleming <matt@console-pimps.org> Acked-by: Wolfram Sang <w.sang@pengutronix.de> [cjb: modified changelog and code indentation] Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: Add helper function to check if a card is removableMatt Fleming
There are two checks that need to be made when determining whether a card is removable. A host controller may set MMC_CAP_NONREMOVABLE if the controller does not support removing cards (e.g. eMMC), in which case the card is physically non-removable. Also the 'mmc_assume_removable' module parameter can be configured at module load time, in which case the card may be logically non-removable. A helper function keeps the logic in one place so that code always checks both conditions. Because this new function is likely to be called from modules we now need to export the mmc_assume_removable symbol. Signed-off-by: Matt Fleming <matt@console-pimps.org> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Tested-by: Jaehoon Chung <jh80.chung@samsung.com> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2010-10-23mmc: Makefile: Fix EXTRA_CFLAGS assignmentmatt mooney
The EXTRA_CFLAGS assignment in mmc/Makefile was not accomplishing anything because this flag only has effect on sources at the same level as the makefile (i.e., per directory). Since card/, core/, and host/ rely on MMC_DEBUG, the subdir-ccflags-y variant seems to be the appropriate choice. Signed-off-by: matt mooney <mfm@muteddisk.com> Signed-off-by: Chris Ball <cjb@laptop.org>