aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
Commit message (Collapse)AuthorAgeFilesLines
* mfd: Adding twl6030 mmc card detect support for MMC1kishore kadiyala2010-10-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* mmc: Allow 2 byte requests in 4-bit mode for tmio_mmcYusuke Goda2010-10-291-5/+12
| | | | | | | | | | | | | 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>
* 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: Allow the tmio_mmc mfd driver to specify get_cd handlerArnd Hannemann2010-10-291-0/+13
| | | | | | | | | | 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>
* Merge branch 'for-linus' of ↵Linus Torvalds2010-10-2851-558/+2285
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ...
| * mmc: add new sdhci-pxa driver for Marvell SoCsZhangfei Gao2010-10-253-0/+266
| | | | | | | | | | | | | | | | 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>
| * mmc: make number of mmcblk minors configurableOlof Johansson2010-10-252-12/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc_spi: Recover from CRC errors for r/w operation over SPI.Sonic Zhang2010-10-231-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdhci-pltfm: add -pltfm driver for imx35/51Wolfram Sang2010-10-235-0/+158
| | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdhci-of-esdhc: factor out common stuffWolfram Sang2010-10-232-62/+91
| | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdhci_pltfm: pass more data on custom init callWolfram Sang2010-10-231-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdhci: introduce get_ro private write-protect hookWolfram Sang2010-10-232-6/+10
| | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdhci-pltfm: move .h file into appropriate subdirWolfram Sang2010-10-233-3/+3
| | | | | | | | | | | | | | | | | | 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>
| * mmc: sdhci-pltfm: Add structure for host-specific dataWolfram Sang2010-10-232-3/+14
| | | | | | | | | | | | | | | | | | | | 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>
| * mmc: fix cb710 kconfig dependency warningRandy Dunlap2010-10-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: cb710: remove debugging printk (info duplicated from mmc-core)Michał Mirosław2010-10-231-2/+0
| | | | | | | | | | Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Chris Ball <cjb@laptop.org>
| * mmc: cb710: clear irq handler on init() error pathMichał Mirosław2010-10-231-0/+1
| | | | | | | | | | Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Chris Ball <cjb@laptop.org>
| * mmc: cb710: remove unnecessary msleep()Michał Mirosław2010-10-231-1/+0
| | | | | | | | | | Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Chris Ball <cjb@laptop.org>
| * mmc: cb710: implement get_cd() callbackMichał Mirosław2010-10-231-20/+13
| | | | | | | | | | Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Chris Ball <cjb@laptop.org>
| * mmc: cb710: partially demystify clock selectionMichał Mirosław2010-10-231-7/+12
| | | | | | | | | | | | | | | | 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>
| * mmc: add a file to debugfs for changing host clock at runtimeAndy Shevchenko2010-10-231-2/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdhci: allow for eMMC 74 clock generation by controllerPhilip Rakity2010-10-232-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdhci: highspeed: check for mmc as well as sd cardsPhilip Rakity2010-10-231-2/+3
| | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdhci: Add Moorestown device supportAlan Cox2010-10-231-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdhci: Intel Medfield supportXiaochen Shen2010-10-231-0/+48
| | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdhci: Allow the probe handler to override slotsAlan Cox2010-10-231-0/+2
| | | | | | | | | | | | | | | | | | 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>
| * mmc: sdio: support suspend/resume while runtime suspendedOhad Ben-Cohen2010-10-231-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdio: ensure mmc_sdio_detect is poweredOhad Ben-Cohen2010-10-231-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdio: enable runtime PM for SDIO functionsOhad Ben-Cohen2010-10-232-3/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdio: enable runtime PM for SDIO cardsOhad Ben-Cohen2010-10-231-0/+13
| | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdio: use the generic runtime PM handlersOhad Ben-Cohen2010-10-231-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: add runtime PM handlersOhad Ben-Cohen2010-10-231-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdio: add power_restore supportOhad Ben-Cohen2010-10-231-0/+18
| | | | | | | | | | | | | | | | | | | | 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>
| * mmc: propagate power save/restore ops return valueOhad Ben-Cohen2010-10-234-12/+28
| | | | | | | | | | | | | | | | | | 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>
| * mmc: sdio: fully reconfigure oldcard on resumeOhad Ben-Cohen2010-10-231-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdhci: split up sdhci.h for sdhci-pltfm usersGiuseppe Cavallaro2010-10-231-131/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdhci: fix "pwr may be used uninitialized" warningGiuseppe Cavallaro2010-10-231-4/+2
| | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdhci-pltfm: add suspend/resume functionsGiuseppe Cavallaro2010-10-231-0/+21
| | | | | | | | | | | | | | | | | | 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>
| * mmc: name mmc queue thread by host indexEthan Du2010-10-231-1/+3
| | | | | | | | | | | | | | | | 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>
| * mmc: refine DDR supportAdrian Hunter2010-10-233-7/+9
| | | | | | | | | | | | | | | | | | 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>
| * mmc: Fixes for Dual Data Rate (DDR) supportAdrian Hunter2010-10-236-41/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: MMC 4.4 DDR supportHanumath Prasad2010-10-232-5/+42
| | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: Move regulator handling closer to coreLinus Walleij2010-10-234-36/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdhci: mmc_rescan: reduce verbosityEric Bénard2010-10-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: Make ID freq configurableHein Tibosch2010-10-231-45/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdhci: disable MMC_CAP_NEEDS_POLL in nonremovable caseJaehoon Chung2010-10-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: Add helper function to check if a card is removableMatt Fleming2010-10-234-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: Makefile: Fix EXTRA_CFLAGS assignmentmatt mooney2010-10-234-15/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
| * mmc: sdhci: print out controller name for register debugPhilip Rakity2010-10-231-1/+2
| | | | | | | | | | | | | | | | In a multi-controller environment it is helpful to know which controller has problems. Signed-off-by: Philip Rakity <prakity@marvell.com> Signed-off-by: Chris Ball <cjb@laptop.org>
| * mmc: sdhci: add MMC_CAP_8_BIT_DATA in the host capabilitiesGiuseppe Cavallaro2010-10-231-1/+1
| | | | | | | | | | | | | | | | This patch is necessary to gain the performance boost from 8-bit data with the sdhci-stm driver. Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: Chris Ball <cjb@laptop.org>