summaryrefslogtreecommitdiff
path: root/drivers/mmc
AgeCommit message (Collapse)Author
2011-03-15mmc: atmel-mci: map DMA sglist on the DMA engineLinus 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: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15mmc: sdhci: Add Ricoh e823 PCI IDManoj Iyer
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com> Cc: <stable@kernel.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15mmc: Ensure prototypes for SD API are visible in sd.cMark Brown
So we know the implementation and prototypes agree with each other. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Reviewed-by: Chris Ball <cjb@laptop.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15mmc: Improve MMC_TEST config text.Will Newton
The test file is created under debugfs, not sysfs. Also remove the unnecessary default n. Signed-off-by: Will Newton <will.newton@imgtec.com> Reviewed-by: Chris Ball <cjb@laptop.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15mmc: dw_mmc: Enable low-power mode for the card clock.Will Newton
Setting this bit in the clock enable register will stop the clock when the card is in the IDLE state. Signed-off-by: Will Newton <will.newton@imgtec.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15mmc: dw_mmc: Run card detect tasklet during slot initialisation.Will Newton
We need to run the card detect tasklet at the end of slot initialisation as it is possible that a card has been inserted prior to boot, so we don't see an insertion interrupt and now the card is sitting there inserted but with no power to it. Signed-off-by: Neil Jones <neil.jones@imgtec.com> Signed-off-by: Will Newton <will.newton@imgtec.com> Reviewed-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15mmc: mmc_mxc: Allow selection only for the correct platformsFabio Estevam
Currently MMC_MXC driver can be selected by all i.MX devices. Restrict its use only for the appropriate processors. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15mmc: tmio_mmc: Improve readability of the output of pr_debug_status()Simon Horman
Reviewed-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15mmc: mmc_test: add tests to measure large sequential I/O performanceAdrian Hunter
Add two large sequential I/O performance tests: 35. Large sequential read into scattered pages 36. Large sequential write from scattered pages The tests measure transfer times for 10MiB, 100MiB, 1000MiB. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15mmc: mmc_test: add tests to measure random I/O operations per secondAdrian Hunter
Existing performance tests measure single or sequential I/O speed. Add two random I/O tests: 33. Random read performance by transfer size 34. Random write performance by transfer size Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15mmc: mmc_test: make performance test area size about 4MiBAdrian Hunter
The test area size was set to the preferred erase size but for comparison purposes it is better if it is the same size for different devices. Make it a multiple of preferred erase size that is greater than or equal to 4MiB. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15mmc: remove BROKEN_CLK_GATING quirk for wl1271Pierre Tardy
This sdio card supports having its sdio clock shutdown. It is also not using the SDIO IRQ, but rather uses a side gpio irq. Signed-off-by: Pierre Tardy <tardyp@gmail.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15mmc: add MMC_QUIRK_BROKEN_CLK_GATINGPierre Tardy
Some sdio card are not following sdio standard, and do not work when the sdio bus's clock is gated. To keep functionnality for all legacy driver, we turn this quirk on for every sdio card. Drivers needs to disable the quirk manually when someone verifies that their supported card works with clock gating. Signed-off-by: Pierre Tardy <tardyp@gmail.com> Acked-by: Ohad Ben-Cohen <ohad@wizery.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15mmc: add per device quirk placeholderPierre Tardy
Some cards have quirks valid for every platforms using current platform quirk hooks leads to a lot of code and debug duplication. So we inspire a bit from what exists in PCI subsystem and do our own per vendorid/deviceid quirk. We still drop the complexity of the pci quirk system (with special section tables, and so on). That can be added later if needed. Signed-off-by: Pierre Tardy <pierre.tardy@intel.com> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Acked-by: Ohad Ben-Cohen <ohad@wizery.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15mmc: put the led blinking code after clock ungatingPierre Tardy
Since mmc clock gating can also be used as a power gating tip, it's better to put the led blinking after having ungated the clock. Signed-off-by: Pierre Tardy <pierre.tardy@intel.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15mmc: mmc_test: Only warn about not waiting for busy if it's supportedPawel Moll
If the MMC host controller does not support waiting for card signaling busy state (MMC_CAP_WAIT_WHILE_BUSY cap), there is no point in prining the relevant warning message. Signed-off-by: Pawel Moll <pawel.moll@arm.com> Reviewed-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15mmc: sdhci-s3c: Auto CMD12 supportKyungmin Park
Samsung SDHCI host controller supports the Auto CMD12. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15mmc: Fix the block device read only flagMarc-André Hébert
While the MMC handled the card's read only flag correctly on open, it did not setup the flag in the allocated disk structure. The consequence being that probing the /sys/class/block/mmcblkX/ro attribute always reported 0. Signed-off-by: Marc-Andre Hebert <hebert.marcandre@gmail.com> Reviewed-by: Chris Ball <cjb@laptop.org> Tested-by: Chris Ball <cjb@laptop.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15mmc: export eMMC4.4 enhanced area details to sysfsChuanxiao Dong
Enhanced area feature is a new feature defined in eMMC4.4 standard. This user data area provides higher performance/reliability, at the expense of using twice the effective media space due to the area using SLC. The MMC driver now reads out the enhanced area offset and size and adds them to the device attributes in sysfs. Enabling the enhanced area can only be done once, and should be done in manufacturing. To use this feature, bit ERASE_GRP_DEF should also be set. Documentation/ABI/testing/sysfs-devices-mmc describes the two new attributes. Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com> Reviewed-by: Chris Ball <cjb@laptop.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-12Merge commit 'v2.6.38-rc8' into spi/nextGrant Likely
Conflicts: drivers/spi/pxa2xx_spi_pci.c
2011-03-11Merge branch 'integration-2.6.39-for-tony' of ↵Tony Lindgren
git://git.pwsan.com/linux-integration into omap-for-linus Conflicts: arch/arm/mach-omap2/pm34xx.c
2011-03-11Merge remote branches 'remotes/origin/pwrdm_clkdm_b_2.6.39', ↵Paul Walmsley
'remotes/origin/pwrdm_add_can_lose_context_fns_2.6.39', 'remotes/origin/omap_device_a_2.6.39', 'remotes/origin/mmc_a_2.6.39', 'remotes/origin/hwmod_b_2.6.39', 'remotes/origin/dmtimer_a_2.6.39', 'remotes/origin/pwrdm_clkdm_a_2.6.39', 'remotes/origin/clkdm_statdep_omap4_2.6.39', 'remotes/origin/clk_a_2.6.39', 'remotes/origin/clk_autoidle_a_2.6.39', 'remotes/origin/clk_autoidle_b_2.6.39', 'remotes/origin/clk_b_2.6.39', 'remotes/origin/clk_clkdm_a_2.6.39', 'remotes/origin/misc_a_2.6.39', 'remotes/origin/for_2.6.39/omap3_hwmod_data' and 'remotes/origin/wdtimer_a_2.6.39' into tmp-integration-2.6.39-20110310-024
2011-03-11Merge branch 'for_2.6.39/pm-misc' of ↵Tony Lindgren
ssh://master.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into omap-for-linus
2011-03-10block: remove per-queue pluggingJens Axboe
Code has been converted over to the new explicit on-stack plugging, and delay users have been converted to use the new API for that. So lets kill off the old plugging along with aops->sync_page(). Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2011-03-09Merge 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: mmc: fix CONFIG_MMC_UNSAFE_RESUME regression
2011-03-08mmc: fix CONFIG_MMC_UNSAFE_RESUME regressionOhad Ben-Cohen
30201e7f3 ("mmc: skip detection of nonremovable cards on rescan") allowed skipping detection of nonremovable cards on mmc_rescan(). The intention was to only skip detection of hardwired cards that cannot be removed, so make sure this is indeed the case by directly checking for (lack of) MMC_CAP_NONREMOVABLE, instead of using mmc_card_is_removable(), which is overloaded with CONFIG_MMC_UNSAFE_RESUME semantics. The user-visible symptom of the bug this patch fixes is that no "mmc: card XXXX removed" message appears in dmesg when a card is removed and CONFIG_MMC_UNSAFE_RESUME=y. Reported-and-tested-by: Dmitry Shmidt <dimitrysh@google.com> Reported-and-tested-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-08of_mmc_spi: add card detect irq supportEsben Haabendal
Signed-off-by: Esben Haabendal <eha@doredevelopment.dk> Acked-by: Anton Vorontsov <cbouatmailru@gmail.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-03-07mmc: sdio: Allow sdio operations in other threads during sdio_add_func()Dmitry Shmidt
This fixes a bug introduced by 807e8e40673d ("mmc: Fix sd/sdio/mmc initialization frequency retries") that prevented SDIO drivers from performing SDIO commands in their probe routines -- the above patch called mmc_claim_host() before sdio_add_func(), which causes a deadlock if an external SDIO driver calls sdio_claim_host(). Fix tested on an OLPC XO-1.75 with libertas on SDIO. Signed-off-by: Dmitry Shmidt <dimitrysh@google.com> Reviewed-and-Tested-by: Chris Ball <cjb@laptop.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-01MMC: omap_hsmmc: enable interface clock before calling mmc_host_enable()Paul Walmsley
The code path entered via mmc_host_enable() can include register accesses to the HSMMC IP block. For this to work, both the device interface clock and functional clock need to be enabled before mmc_host_enable() is called. However, omap_hsmmc_probe() calls mmc_host_enable() before enabling the device interface clock. Fix by calling mmc_host_enable() after the device interface clock is enabled. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Madhusudhan Chikkature Rajashekar <madhu.cr@ti.com> Cc: Adrian Hunter <adrian.hunter@nokia.com> Cc: Kishore Kadiyala <kishore.kadiyala@ti.com> Cc: Tero Kristo <Tero.Kristo@nokia.com> Acked-by: Madhusudhan Chikkature Rajashekar <madhu.cr@ti.com>
2011-03-01OMAP: hsmmc: Rename the device and driverKishore Kadiyala
Modifying the device & driver name from "mmci-omap-hs" to "omap_hsmmc". Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> Acked-by: Benoit Cousson<b-cousson@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2011-03-01OMAP: adapt hsmmc to hwmod frameworkKishore Kadiyala
OMAP2420 platform consists of mmc block as in omap1 and not the hsmmc block as present in omap2430, omap3, omap4 platforms. Removing all base address macro defines except keeping one for OMAP2420 and adapting only hsmmc device registration and driver to hwmod framework. Changes involves: 1) Remove controller reset in devices.c which is taken care of by hwmod framework. 2) Using omap-device layer to register device and utilizing data from hwmod data file for base address, dma channel number, Irq_number, device attribute. 3) Update the driver to use dev_attr to find whether controller supports dual volt cards Signed-off-by: Paul Walmsley <paul@pwsan.com> Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> Reviewed-by: Balaji T K <balajitk@ti.com> Cc: Benoit Cousson <b-cousson@ti.com> CC: Kevin Hilman <khilman@deeprootsystems.com> Cc: Tony Lindgren <tony@atomide.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2011-02-28dt: Eliminate of_platform_{,un}register_driverGrant Likely
Final step to eliminate of_platform_bus_type. They're all just platform drivers now. v2: fix type in pasemi_nand.c (thanks to Stephen Rothwell) Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-02-23ARM: amba: make probe() functions take const id tablesRussell King
Make Primecell driver probe functions take a const pointer to their ID tables. Drivers should never modify their ID tables in their probe handler. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-02-22Merge branch 'devicetree/next' into spi/nextGrant Likely
To pick up removal of #ifdef around .of_match_table
2011-02-22OMAP: hsmmc: Enable MMC4 and MMC5 on OMAP4 platformsKishore Kadiyala
OMAP4 supports up to 5 MMC controllers, but only 3 of these were initialized. MMC5 is used by wl12xx chip. So initialize MMC4 and MMC5. Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> Signed-off-by: Panduranga Mallireddy <panduranga_mallireddy@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2011-02-17tiocmset: kill the file pointer argumentAlan Cox
Doing tiocmget was such fun we should do tiocmset as well for the same reasons Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-17tiocmget: kill off the passing of the struct fileAlan Cox
We don't actually need this and it causes problems for internal use of this functionality. Currently there is a single use of the FILE * pointer. That is the serial core which uses it to check tty_hung_up_p. However if that is true then IO_ERROR is also already set so the check may be removed. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-16Merge branches 'devel-cleanup', 'devel-board', 'devel-early-init' and ↵Tony Lindgren
'devel-ti816x' into omap-for-linus
2011-02-04Merge commit 'v2.6.38-rc3' into devicetree/nextGrant Likely
2011-02-04ARM: mmci: add dmaengine-based DMA supportRussell King
Based on a patch from Linus Walleij. Add dmaengine based support for DMA to the MMCI driver, using the Primecell DMA engine interface. The changes over Linus' driver are: - rename txsize_threshold to dmasize_threshold, as this reflects the purpose more. - use 'mmci_dma_' as the function prefix rather than 'dma_mmci_'. - clean up requesting of dma channels. - don't release a single channel twice when it's shared between tx and rx. - get rid of 'dma_enable' bool - instead check whether the channel is NULL. - detect incomplete DMA at the end of a transfer. Some DMA controllers (eg, PL08x) are unable to be configured for scatter DMA and also listen to all four DMA request signals [BREQ,SREQ,LBREQ,LSREQ] from the MMCI. They can do one or other but not both. As MMCI uses LBREQ/LSREQ for the final burst/words, PL08x does not transfer the last few words. - map and unmap DMA buffers using the DMA engine struct device, not the MMCI struct device - the DMA engine is doing the DMA transfer, not us. - avoid double-unmapping of the DMA buffers on MMCI data errors. - don't check for negative values from the dmaengine tx submission function - Dan says this must never fail. - use new dmaengine helper functions rather than using the ugly function pointers directly. - allow DMA code to be fully optimized away using dma_inprogress() which is defined to constant 0 if DMA engine support is disabled. - request maximum segment size from the DMA engine struct device and set this appropriately. - removed checking of buffer alignment - the DMA engine should deal with its own restrictions on buffer alignment, not the individual DMA engine users. - removed setting DMAREQCTL - this confuses some DMA controllers as it causes LBREQ to be asserted for the last seven transfers, rather than six SREQ and one LSREQ. - removed burst setting - the DMA controller should not burst past the transfer size required to complete the DMA operation. Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-02-04ARM: mmci: no need for separate host->data_xferedRussell King
We don't need to store the number of bytes transferred in our host structure - we can store this directly in data->bytes_xfered. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-02-04ARM: mmci: avoid unnecessary switch to data available PIO interruptsRussell King
We don't need to switch to data available interrupts if there's at least half a FIFO depth worth of data remaining, as we'll still get the FIFO half full interrupt. Keep this interrupt masked off until we have less than half the FIFO depth worth of data remaining. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-02-04ARM: mmci: no need to call flush_dcache_page() with sg_miter APIRussell King
The sg_miter API provides the required cache maintainence, so we don't need to do that ourselves. Remove the unnecessary additional cache maintainence. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-02-04ARM: mmci: avoid reporting too many completed bytes on fifo overrunRussell King
The data counter counts the number of bytes transferred on the MMC bus. When a FIFO overrun occurs, we will not have transferred a FIFOs-worth of data to memory, and so the data counter will be a FIFOs-worth ahead. If this occurs on a block boundary, we will report one too many sectors as successful. Fix this. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-01-31ARM: mmci: round down the bytes transferred on errorRussell King
We should not report incomplete blocks on error. Return the number of bytes successfully transferred, rounded down to the nearest block. Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-01-31ARM: mmci: complete the transaction on errorRussell King
When we encounter an error, make sure we complete the transaction otherwise we'll leave the request dangling. Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-01-28omap: Start using CONFIG_SOC_OMAPTony Lindgren
We want to have just CONFIG_ARCH_OMAP2, 3 and 4. The rest are nowadays just subcategories of these. Search and replace the following: ARCH_OMAP2420 SOC_OMAP2420 ARCH_OMAP2430 SOC_OMAP2430 ARCH_OMAP3430 SOC_OMAP3430 No functional changes. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Thomas Weber <weber@corscience.de> Acked-by: Sourav Poddar <sourav.poddar@ti.com>
2011-01-27ARM: 6642/1: mmci: calculate remaining bytes at error correctlyLinus Walleij
The MMCIDATACNT register contain the number of byte left at error not the number of words, so loose the << 2 thing. Further if CRC fails on the first block, we may end up with a negative number of transferred bytes which is not good, and the formula was in wrong order. Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-01-26mmc: bfin_sdh: fix alloc size for private dataSonic Zhang
The bfin_sdh driver allocates the wrong size for the private data in the mmc_host. The first parameter of mmc_alloc_host should be the size of the local driver struct rather than the common mmc_host. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Cc: <stable@kernel.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-01-26mmc: sdhci-s3c: add platform_8bit_width() hookJaehoon Chung
We have 8-bit width support but is not a v3 controller. So we need platform_8bit_width() to support 8-bit buswidth. Also we need MMC_CAP_8_BIT_DATA, so we add it in platdata. This gets 8-bit support working again on s3c, after we previously disabled 8-bit by default on non-v3 controllers. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>