aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc
AgeCommit message (Collapse)Author
2010-01-19s3c-mci: Disable write-protect and detect gpios in default platfrom dataLars-Peter Clausen
Due to the change that gpio0 is now seen as a valid gpio by the driver it tries to request gpio0 as card detect and write-protect pin if no platform_data was given. This patch initalises no_wprotect and no_detect of the default platform data to 1 and restores pre 2.6.32 behaviour.
2009-12-02[ARM] pxamci: call mmc_remove_host() before freeing resourcesDaniel Mack
mmc_remove_host() will cause the mmc core to switch off the bus power by eventually calling pxamci_set_ios(). This function uses the regulator or the GPIO which have been freed already. This causes the following Oops on module unload. [ 49.519649] Unable to handle kernel paging request at virtual address 30303a70 [ 49.526878] pgd = c7084000 [ 49.529563] [30303a70] *pgd=00000000 [ 49.533136] Internal error: Oops: 5 [#1] [ 49.537025] last sysfs file: /sys/devices/platform/pxa27x-ohci/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0/scsi_level [ 49.547471] Modules linked in: pxamci(-) eeti_ts [ 49.552061] CPU: 0 Not tainted (2.6.32-rc8 #322) [ 49.557001] PC is at regulator_is_enabled+0x3c/0xbc [ 49.561846] LR is at regulator_is_enabled+0x30/0xbc [ 49.566691] pc : [<c01a2448>] lr : [<c01a243c>] psr: 60000013 [ 49.566702] sp : c7083e70 ip : 30303a30 fp : 00000000 [ 49.578093] r10: c705e200 r9 : c7082000 r8 : c705e2e0 [ 49.583280] r7 : c7061340 r6 : c7061340 r5 : c7083e70 r4 : 00000000 [ 49.589759] r3 : c04dc434 r2 : c04dc434 r1 : c03eecea r0 : 00000047 [ 49.596241] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user [ 49.603329] Control: 0000397f Table: a7084018 DAC: 00000015 [ 49.609031] Process rmmod (pid: 1101, stack limit = 0xc7082278) [ 49.614908] Stack: (0xc7083e70 to 0xc7084000) [ 49.619238] 3e60: c7082000 c703c4f8 c705ea00 c04f4074 [ 49.627366] 3e80: 00000000 c705e3a0 ffffffff c0247ddc c70361a0 00000000 c705e3a0 ffffffff [ 49.635499] 3ea0: c705e200 bf006400 c78c4f00 c705e200 c705e3a0 ffffffff c705e200 ffffffff [ 49.643633] 3ec0: c04d8ac8 c02476d0 ffffffff c0247c60 c705e200 c0248678 c705e200 c0249064 [ 49.651765] 3ee0: ffffffff bf006204 c04d8ad0 c04d8ad0 c04d8ac8 bf007490 00000880 c00440c4 [ 49.659898] 3f00: 0000b748 c01c5708 bf007490 c01c44c8 c04d8ac8 c04d8afc bf007490 c01c4570 [ 49.668031] 3f20: bf007490 bf00750c c04f4258 c01c37a4 00000000 bf00750c c7083f44 c007b014 [ 49.676162] 3f40: 4000d000 6d617870 08006963 00000001 00000000 c7085000 00000001 00000000 [ 49.684287] 3f60: 4000d000 c7083f8c 00000001 bea01a54 00005401 c7ab1400 c00440c4 00082000 [ 49.692420] 3f80: bf00750c 00000880 c7083f8c 00000000 4000cfa8 00000000 00000880 bea01cc8 [ 49.700552] 3fa0: 00000081 c0043f40 00000000 00000880 bea01cc8 00000880 00000006 00000000 [ 49.708677] 3fc0: 00000000 00000880 bea01cc8 00000081 00000097 0000cca4 0000b748 00000000 [ 49.716802] 3fe0: 4001a4f0 bea01cc0 00018bf4 4001a4fc 20000010 bea01cc8 a063e021 a063e421 [ 49.724958] [<c01a2448>] (regulator_is_enabled+0x3c/0xbc) from [<c0247ddc>] (mmc_regulator_set_ocr+0x14/0xd8) [ 49.734836] [<c0247ddc>] (mmc_regulator_set_ocr+0x14/0xd8) from [<bf006400>] (pxamci_set_ios+0xd8/0x17c [pxamci]) [ 49.745044] [<bf006400>] (pxamci_set_ios+0xd8/0x17c [pxamci]) from [<c02476d0>] (mmc_power_off+0x50/0x58) [ 49.754555] [<c02476d0>] (mmc_power_off+0x50/0x58) from [<c0247c60>] (mmc_detach_bus+0x68/0xc4) [ 49.763207] [<c0247c60>] (mmc_detach_bus+0x68/0xc4) from [<c0248678>] (mmc_stop_host+0xd4/0x1bc) [ 49.771944] [<c0248678>] (mmc_stop_host+0xd4/0x1bc) from [<c0249064>] (mmc_remove_host+0xc/0x20) [ 49.780681] [<c0249064>] (mmc_remove_host+0xc/0x20) from [<bf006204>] (pxamci_remove+0xc8/0x174 [pxamci]) [ 49.790211] [<bf006204>] (pxamci_remove+0xc8/0x174 [pxamci]) from [<c01c5708>] (platform_drv_remove+0x1c/0x24) [ 49.800164] [<c01c5708>] (platform_drv_remove+0x1c/0x24) from [<c01c44c8>] (__device_release_driver+0x7c/0xc4) [ 49.810110] [<c01c44c8>] (__device_release_driver+0x7c/0xc4) from [<c01c4570>] (driver_detach+0x60/0x8c) [ 49.819535] [<c01c4570>] (driver_detach+0x60/0x8c) from [<c01c37a4>] (bus_remove_driver+0x90/0xcc) [ 49.828452] [<c01c37a4>] (bus_remove_driver+0x90/0xcc) from [<c007b014>] (sys_delete_module+0x1d8/0x254) [ 49.837891] [<c007b014>] (sys_delete_module+0x1d8/0x254) from [<c0043f40>] (ret_fast_syscall+0x0/0x28) [ 49.847145] Code: eb06c53a e596c030 e1a0500d e59f106c (e59c0040) [ 49.853566] ---[ end trace b5fa66a00cea142f ]--- Signed-off-by: Daniel Mack <daniel@caiaq.de> Reported-by: Sven Neumann <s.neumann@raumfeld.com> Cc: Pierre Ossman <pierre@ossman.eu> Cc: linux-mmc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: stable@kernel.org Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
2009-11-12mmci-omap: free irq resourceLadislav Michl
Free IRQ on remove. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Acked-by: Tony Lindgren <tony@atomide.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-29omap_hsmmc: add missing probe handler hookRoger Quadros
The missing probe handler hook will never probe the driver. Add it back. Fixes broken MMC on OMAP. We use platform_driver_probe() API since omap_hsmmc is not a hot-pluggable device. Signed-off-by: Roger Quadros <ext-roger.quadros@nokia.com> Tested-by: Felipe Contreras <felipe.contreras@gmail.com> Tested-by: Tony Lindgren <tony@atomide.com> Cc: Jiri Kosina <jkosina@suse.cz> Cc: Felipe Contreras <felipe.contreras@gmail.com> Cc: Denis Karpov <ext-denis.2.karpov@nokia.com> Cc: Madhusudhan Chikkature <madhu.cr@ti.com> Cc: Greg KH <gregkh@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-22mmc: at91_mci: Don't include asm/mach/mmc.hUwe Kleine-König
This fixes a compile bug introduced in 6ef297f (ARM: 5720/1: Move MMCI header to amba include dir) That commit moved arch/arm/include/asm/mach/mmc.h to include/linux/amba/mmci.h. Just removing the include was enough. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Bill Gatliff <bgat@billgatliff.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Pierre Ossman <drzeus@drzeus.cx> Cc: linux-arm-kernel@lists.infradead.org Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-12[ARM] pxamci: fix printing gpio numbers in pxamci_probeAntonio Ospite
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it> Reviewed-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
2009-10-08mmc: sdio: don't require CISTPL_VERS_1 to contain 4 stringsDavid Vrabel
The PC Card 8.0 specification (vol. 4, section 3.2.10) says the TPLLV1_INFO field of the CISTPL_VERS_1 tuple must contain 4 strings. Some cards don't have all 4 so just parse as many as we can. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: David Vrabel <david.vrabel@csr.com> Tested-by: Jonathan Cameron <jic23@cam.ac.uk> Tested-by: Bing Zhao <bzhao@marvell.com> Cc: Roel Kluin <roel.kluin@gmail.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-02Merge master.kernel.org:/home/rmk/linux-2.6-armLinus Torvalds
* master.kernel.org:/home/rmk/linux-2.6-arm: (25 commits) ARM: 5728/1: Proper prefetch abort handling on ARMv6 and ARMv7 ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() ARM: 5740/1: fix valid_phys_addr_range() range check ARM: 5739/1: ARM: allow empty ATAG_CORE ARM: 5735/1: sa1111: CodingStyle cleanups ARM: 5738/1: Correct TCM documentation ARM: 5734/1: arm: fix compilation of entry-common.S for older CPUs ARM: 5733/1: fix bcmring compile error ARM: 5732/1: remove redundant include file ARM: 5731/2: Fix U300 generic GPIO, remove ifdefs from MMCI v3 ARM: Ensure do_cache_op takes mmap_sem ARM: Fix __cpuexit section mismatch warnings ARM: Don't allow highmem on SMP platforms without h/w TLB ops broadcast ARM: includecheck fix: mach-davinci, board-dm365-evm.c ARM: Remove unused CONFIG SA1100_H3XXX ARM: Fix warning: unused variable 'highmem' ARM: Fix warning: #warning syscall migrate_pages not implemented ARM: Fix SA11x0 clocksource warning ARM: Fix SA1100 Neponset serial section mismatch ARM: Fix SA1100 Assabet/Neponset PCMCIA section mismatch warnings ...
2009-10-01s3cmci: add better support for no card detect or write protect availableBen Dooks
Add better support for omitting either the card detect or the write protect GPIOs if the board does not support it. Add the fields no_wprotect and no_detect to the platform data which when set indicate the absence of the respective GPIOs. Note, this also fixes a minor bug where it tries to free IRQ0 if there is no detect gpio available. Signed-off-by: Ben Dooks <ben@simtec.co.uk> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-01s3cmci: make SDIO IRQ hardware IRQ support build-time configurableBen Dooks
We have found a couple of boards where the SDIO IRQ hardware support has failed to work properly, and thus we should make it configurable whether or not to be included in the driver. Signed-off-by: Ben Dooks <ben@simtec.co.uk> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-01s3cmci: DMA fixesBen Dooks
Fixes for the DMA transfer mode of the driver to try and improve the state of the code: - Ensure that dma_complete is set during the end of the command phase so that transfers do not stall awaiting the completion - Update the DMA debugging to provide a bit more useful information such as how many DMA descriptors where not processed and print the DMA addresses in hexadecimal. - Fix the DMA channel request code to actually request DMA for the S3CMCI block instead of whatever '0' signified. - Add fallback to PIO if we cannot get the DMA channel, as many of the devices with this block only have a limited number of DMA channels. - Only try and claim and free the DMA channel if we are trying to use it. This improves the driver DMA code to the point where it can now identify a card and read the partition table. However the DMA can still stall when trying to move data between the host and memory. Signed-off-by: Ben Dooks <ben@simtec.co.uk> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-01s3cmci: Kconfig selection for PIO/DMA/BothBen Dooks
Add a selection for the data transfer mode of the s3cmci driver, allowing for either a configuration or rumtime selection of the use of the DMA or PIO transfer code. The PIO only mode is 476 bytes smaller than the driver with both methods compiled in. Signed-off-by: Ben Dooks <ben@simtec.co.uk> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-01s3cmci: add SDIO IRQ supportBen Dooks
The controller supports SDIO IRQ detection so add support for hardware assisted SDIO interrupt detection for the SDIO core. This improves the response time for SDIO interrupts and thus the transfer rate from devices such as the Marvel 8686. As a note, it does seem that the controller will miss an IRQ than is held asserted, so there are some manual checks to see if the SDIO interrupt is active after a transfer. Major testing on the S3C2440. Signed-off-by: Ben Dooks <ben@simtec.co.uk> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-01s3cmci: add debugfs support for examining driver and hardware stateBen Dooks
Export driver state and hardware register state via debugfs entries created under a directory formed from dev_name() on the probed device when CONFIG_DEBUG_FS is set. Signed-off-by: Ben Dooks <ben@simtec.co.uk> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-01s3cmci: fix direct write to interrupt maskBen Dooks
The clear_imask() call should be used to clear the interrupt mask register, as it may end up clearing the SDIO interrupt bit if this is enabled. Change all writes of zero to SDIIMSK register to use clear_imask() ready for the SDIO updates. Signed-off-by: Ben Dooks <ben@simtec.co.uk> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-01s3cmci: change to use dev_pm_opsBen Dooks
Move to using dev_pm_ops for suspend and resume. Signed-off-by: Ben Dooks <ben@simtec.co.uk> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-01s3cmci: change GPIO to gpiolib from S3C24XX specific callsBen Dooks
Move to using gpiolib to access the card detect and write protect GPIO lines instead of using the platform speicifc s3c2410_gpio calls. Also ensure that the card lines are claimed the same way to avoid overlap with any other drivers. Signed-off-by: Ben Dooks <ben@simtec.co.uk> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-01s3cmci: update probe to use new platform id listBen Dooks
Use the platform id list to match the three different versions of the hardware block that this driver supports. This will change the prefix of the console messages produced by this driver to be prefixed by s3c-mci instead of the hardware block name, such as s3c2440-mci. Signed-off-by: Ben Dooks <ben@simtec.co.uk> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-01s3cmci: use resource_size() instead of local macroBen Dooks
Replace the local definition RESSIZE() with the standard resource_size() call for getting the size of a struct resource. Signed-off-by: Ben Dooks <ben@simtec.co.uk> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-01sdio: pass whitelisted cis funce tuples to sdio driversAlbert Herranz
Some manufacturers provide vendor information in non-vendor specific CIS tuples. For example, Broadcom uses an Extended Function tuple to provide the MAC address on some of their network cards, as in the case of the Nintendo Wii WLAN daughter card. This patch allows passing whitelisted FUNCE tuples unknown to the SDIO core to a matching SDIO driver instead of rejecting them and failing. Signed-off-by: Albert Herranz <albert_herranz@yahoo.es> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-01const: constify remaining file_operationsAlexey Dobriyan
[akpm@linux-foundation.org: fix KVM] Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-01ARM: 5731/2: Fix U300 generic GPIO, remove ifdefs from MMCI v3Linus Walleij
The #ifdefs in the MMCI driver were erroneous and just masking a bug in the U300 generic GPIO implementation. This removes the ifdefs and fixes the U300 generic GPIO instead. Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-09-24Merge branch 'origin' into for-linusRussell King
Conflicts: MAINTAINERS
2009-09-24Merge branch 'for-linus' of git://neil.brown.name/mdLinus Torvalds
* 'for-linus' of git://neil.brown.name/md: (97 commits) md: raid-1/10: fix RW bits manipulation md: remove unnecessary memset from multipath. md: report device as congested when suspended md: Improve name of threads created by md_register_thread md: remove sparse warnings about lock context. md: remove sparse waring "symbol xxx shadows an earlier one" async_tx/raid6: add missing dma_unmap calls to the async fail case ioat3: fix uninitialized var warnings drivers/dma/ioat/dma_v2.c: fix warnings raid6test: fix stack overflow ioat2: clarify ring size limits md/raid6: cleanup ops_run_compute6_2 md/raid6: eliminate BUG_ON with side effect dca: module load should not be an error message ioat: driver version 4.0 dca: registering requesters in multiple dca domains async_tx: remove HIGHMEM64G restriction dmaengine: sh: Add Support SuperH DMA Engine driver dmaengine: Move all map_sg/unmap_sg for slave channel to its client fsldma: Add DMA_SLAVE support ...
2009-09-23spi: prefix modalias with "spi:"Anton Vorontsov
This makes it consistent with other buses (platform, i2c, vio, ...). I'm not sure why we use the prefixes, but there must be a reason. This was easy enough to do it, and I did it. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Jean Delvare <khali@linux-fr.org> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Dmitry Torokhov <dtor@mail.ru> Cc: Samuel Ortiz <sameo@openedhand.com> Cc: "John W. Linville" <linville@tuxdriver.com> Acked-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23sdhci: increase timeout for internal clock stabilization.Chris Ball
On an OLPC XO-1.5 development board with Via VX855 chipset, the sdhci controller can take up to 12ms to stabilize its clock, but the current timeout at which we give up on the controller is 10ms. The patch increases the timeout delay rather than using a device-specific quirk -- since we exit the loop when the clock comes up, increasing the timeout value will only make us mdelay() longer in the errant case of a device with a clock that is not stabilizing, which it seems worth waiting a little longer for in general. Signed-off-by: Chris Ball <cjb@laptop.org> Cc: Harald Welte <HaraldWelte@viatech.com> Acked-by: Pierre Ossman <pierre@ossman.eu> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23sdhci: support for ADMA only hostsRichard Röjfors
Add support for ADMA on SDHCI hosts, not supporting SDMA. According to the SDHCI specifications a host can support ADMA but not SDMA Signed-off-by: Richard Röjfors <richard.rojfors@mocean-labs.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23mmc: make SDIO device/driver struct accessors publicNicolas Pitre
Especially with the PM framework, those are quite handy to have in driver code too. Signed-off-by: Nicolas Pitre <nico@marvell.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23mmc: propagate error codes back from bus drivers' suspend/resume methodsNicolas Pitre
Especially for SDIO drivers which may have special conditions/errors to report, it is a good thing to relay the returned error code back to upper layers. This also allows for the rationalization of the resume path where code to "remove" a no-longer-existing or replaced card was duplicated into the MMC, SD and SDIO bus drivers. In the SDIO case, if a function suspend method returns an error, then all previously suspended functions are resumed and the error returned. An exception is made for -ENOSYS which the core interprets as "we don't support suspend so just kick the card out for suspend and return success". When resuming SDIO cards, the core code only validates the manufacturer and product IDs to make sure the same kind of card is still present before invoking functions resume methods. It's the function driver's responsibility to perform further tests to confirm that the actual same card is present (same MAC address, etc.) and return an error otherwise. Signed-off-by: Nicolas Pitre <nico@marvell.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23mmc: core SDIO suspend/resume supportNicolas Pitre
Currently, all SDIO cards are virtually removed upon a suspend, and completely reprobed upon a resume. This adds the suspend and resume methods to the SDIO bus driver so to be able to dispatch those events to the actual SDIO function drivers for real suspend/resume instead. All active functions on a card must have a driver with both a suspend and a resume method though. Failing that, we fall back to the current behavior of simply "removing" the card when suspending. When resuming, we make sure the same card is still inserted by comparing the vendor and product IDs. If there is a mismatch, or if there is simply no card anymore in the slot, then the previous card is "removed" and the new card is detected. This is further enhanced with the next patch. [akpm@linux-foundation.org: fix warnings] Signed-off-by: Nicolas Pitre <nico@marvell.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23mmc_spi: fail gracefully if host or card do not support the switch commandWolfgang Muees
Some time ago, I have send a patch to the mmc_spi subsystem changing the error codes. This was after a discussion with Pierre about using EINVAL only for non-recoverable errors. This patch was accepted as http://git.kernel.org/linus/fdd858db7113ca64132de390188d7ca00701013d Unfortunately, several weeks later, I realized that this patch has opened a little can of worms because there are SD cards on the market which a) claim that they support the switch command AND b) refuse to execute this command if operating in SPI mode. So, such a card would get unusuable in an embedded linux system in SPI mode, because the init sequence terminates with an error. This patch adds the missing error codes to the caller of the switch command and restores the old behaviour to fail gracefully if these commands can not execute. Signed-off-by: Wolfgang Muees <wolfgang.mues@auerswald.de> Cc: <linux-mmc@vger.kernel.org> Cc: <stable@kernel.org> [2.6.31.x] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23omap4: mmc driver support on OMAP4kishore kadiyala
Add basic support for all 5 MMC controllers on OMAP4. This patch doesn't include mmc-regulator support Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com> Acked-by: Madhusudhan Chikkature <madhu.cr@ti.com> Cc: Russell King <linux@arm.linux.org.uk> Acked-by: Tony Lindgren <tony@atomide.com> Cc: Hiroshi DOYU <Hiroshi.DOYU@nokia.com> Cc: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23sdhci: add no-card-no-reset quirk for Ricoh R5C822/Sony Z11Chris Ball
Card insertion detection is broken without this quirk on a Sony Vaio Z11, as discussed on linux-mmc here: http://marc.info/?t=125017355000008 Signed-off-by: Chris Ball <cjb@laptop.org> Tested-by: Norbert Preining <preining@logic.at> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23atmel-mci: unified Atmel MCI drivers (AVR32 & AT91)Rob Emanuele
Unification of the atmel-mci driver to support the AT91 processors MCI interface. The atmel-mci driver currently supports the AVR32 and this patch adds AT91 support. Add read/write proof selection switch dependent on chip availability of this feature. To use this new driver on a at91 the platform driver for your board needs to be updated. [nicolas.ferre@atmel.com indent, Kconfig comment and one printk modification] Signed-off-by: Rob Emanuele <rob@emanuele.us> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Haavard Skinnemoen <hskinnemoen@atmel.com> Cc: Andrew Victor <linux@maxim.org.za> Cc: Russell King <rmk@arm.linux.org.uk> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23sdio: add MMC_QUIRK_LENIENT_FN0Ohad Ben-Cohen
Normally writes to SDIO function 0 outside the vendor specific CCCR registers are prohibited. To support embedded devices that require writes to SDIO function 0 outside this range (e.g. TI WL127x embedded sdio wifi device), MMC_QUIRK_LENIENT_FN0 is introduced. A card quirks field is added to `struct mmc_card' to support non-standard devices (e.g. embedded sdio devices). [akpm@linux-foundation.org: code in C, not cpp!] Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23sdhci-of: cleanup eSDHC's set_clock() a little bitAnton Vorontsov
- Get rid of incomprehensible "if { for { if } }" construction for the exponential divisor calculation. The first if statement isn't correct at all, since it should check for "host->max_clk / pre_div / 16 > clock". The error doesn't cause any bugs because the check in the for loop does the right thing, and so the outer check becomes useless; - For the linear divisor do the same: a single while statement is more readable than for + if construction; - Add dev_dbg() that prints desired and actual clock frequency. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Pierre Ossman <pierre@ossman.eu> Cc: Kumar Gala <galak@kernel.crashing.org> Cc: David Vrabel <david.vrabel@csr.com> Cc: Ben Dooks <ben@fluff.org> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23sdhci-of: don't hard-code inverted write-protect quirkAnton Vorontsov
MPC85xx SOCs have normal write-protect state reporting, so we shouldn't hard-code the quirk. Instead, look for "sdhci,wp-inverted" property, plus check for mpc837x_{rdb,mds} machines since older device trees don't specify the new property. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Pierre Ossman <pierre@ossman.eu> Cc: Kumar Gala <galak@kernel.crashing.org> Cc: David Vrabel <david.vrabel@csr.com> Cc: Ben Dooks <ben@fluff.org> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23sdhci-of: fix high-speed cards recognitionAnton Vorontsov
eSDHC fails to recognize some SDHS cards, throwing timeout errors: mmc0: error -110 whilst initialising SD card That's because we calculate timeout value in a wrong way: on eSDHC hosts the timeout clock is derivied from the SD clock, which is set dynamically. As David Vrabel suggested, deriving timeout clock from SD clock is a common scheme, so let's implement DATA_TIMEOUT_USES_SDCLK quirk and use it for eSDHC hosts. Also, from now on we don't need esdhc_get_timeout_clock() callback, so remove it. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Pierre Ossman <pierre@ossman.eu> Cc: Kumar Gala <galak@kernel.crashing.org> Cc: David Vrabel <david.vrabel@csr.com> Cc: Ben Dooks <ben@fluff.org> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23sdhci-of: avoid writing reserved bits into host control registerAnton Vorontsov
SDHCI core tries to write HISPD bit into the host control register, but the eSDHC controllers don't have that bit, and that causes all sorts of misbehaviour when using 4-bit mode capable SD cards. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Pierre Ossman <pierre@ossman.eu> Cc: Kumar Gala <galak@kernel.crashing.org> Cc: David Vrabel <david.vrabel@csr.com> Cc: Ben Dooks <ben@fluff.org> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23sdhci-of: fix SD clock calculationAnton Vorontsov
Linear divisor's values in a register start at 0 (zero means "divide by 1"). Before this patch the code didn't account that fact, so SD cards were running underclocked. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Pierre Ossman <pierre@ossman.eu> Cc: Kumar Gala <galak@kernel.crashing.org> Cc: David Vrabel <david.vrabel@csr.com> Cc: Ben Dooks <ben@fluff.org> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23sdio: fix read buffer overflowRoel Kluin
Avoid buffer underrun when parsing an invalid CISTPL_VERS_1. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: David Vrabel <david.vrabel@csr.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23sdhci: be more strict with get_min_clock() usageAnton Vorontsov
get_min_clock() makes sense only with NONSTANDARD_CLOCK quirk and when set_clock() callback is specified. The patch should cause no functional changes, it just makes the code self-documented and avoids any possible misuse of get_min_clock(). Suggested-by: Pierre Ossman <pierre@ossman.eu> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Ian Molton <ian@mnementh.co.uk> Cc: Matt Fleming <matt@console-pimps.org> Cc: Philip Langdale <philipl@overt.org> Cc: Pierre Ossman <pierre@ossman.eu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23sdio: add CD disable supportOhad Ben-Cohen
Add support to disconnect the pull-up resistor on CD/DAT[3] (pin 1) of the card. This may be desired on certain setups of boards, controllers and embedded sdio devices which do not need the card's pull-up. As a result, card detection is disabled and power is saved. [akpm@linux-foundation.org: simplify sdio_disable_cd() a bit] Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Acked-by: Matt Fleming <matt@console-pimps.org> Cc: Ian Molton <ian@mnementh.co.uk> Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com> Cc: Philip Langdale <philipl@overt.org> Cc: Pierre Ossman <pierre@ossman.eu> Cc: David Vrabel <david.vrabel@csr.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23omap_hsmmc: set a large data timeout for commands with busy signalAdrian Hunter
Commands like SWITCH (CMD6) send a response and then signal busy while the operation is completed. These commands are expected to always succeed (otherwise the response would have indicated an error). Set an arbitrarily large data timeout value (100ms) for these commands to ensure that premature timeouts do not occur. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Acked-by: Matt Fleming <matt@console-pimps.org> Cc: Ian Molton <ian@mnementh.co.uk> Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com> Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com> Cc: Denis Karpov <ext-denis.2.karpov@nokia.com> Cc: Pierre Ossman <pierre@ossman.eu> Cc: Philip Langdale <philipl@overt.org> Cc: "Madhusudhan" <madhu.cr@ti.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23omap_hsmmc: ensure all clock enables and disables are pairedAdrian Hunter
[madhu.cr@ti.com: fix for the db clock failure message] Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Acked-by: Matt Fleming <matt@console-pimps.org> Cc: Ian Molton <ian@mnementh.co.uk> Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com> Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com> Cc: Denis Karpov <ext-denis.2.karpov@nokia.com> Cc: Pierre Ossman <pierre@ossman.eu> Cc: Philip Langdale <philipl@overt.org> Cc: "Madhusudhan" <madhu.cr@ti.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Madhusudhan Chikkature <madhu.cr@ti.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23omap_hsmmc: protect the card when the cover is openAdrian Hunter
Depending on the manufacturer, there is a small possibility that removing a card while it is being written to, can render the card permanently unusable. To prevent that, the card is made inaccessible when the cover is open. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Acked-by: Matt Fleming <matt@console-pimps.org> Cc: Ian Molton <ian@mnementh.co.uk> Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com> Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com> Cc: Denis Karpov <ext-denis.2.karpov@nokia.com> Cc: Pierre Ossman <pierre@ossman.eu> Cc: Philip Langdale <philipl@overt.org> Cc: "Madhusudhan" <madhu.cr@ti.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23omap_hsmmc: code refactoringDenis Karpov
Functions', structures', variables' names are changed to start with omap_hsmmc_ prefix. Signed-off-by: Denis Karpov <ext-denis.2.karpov@nokia.com> Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Acked-by: Matt Fleming <matt@console-pimps.org> Cc: Ian Molton <ian@mnementh.co.uk> Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com> Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com> Cc: Denis Karpov <ext-denis.2.karpov@nokia.com> Cc: Pierre Ossman <pierre@ossman.eu> Cc: Philip Langdale <philipl@overt.org> Cc: "Madhusudhan" <madhu.cr@ti.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23omap_hsmmc: prevent races with irq handlerAdrian Hunter
If an unexpected interrupt occurs while preparing the next request, an oops can occur. For example, a new request is setting up DMA for data transfer so host->data is not NULL. An unexpected transfer complete (TC) interrupt comes along and the interrupt handler sets host->data to NULL. Oops! Prevent that by adding a spinlock. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Acked-by: Matt Fleming <matt@console-pimps.org> Cc: Ian Molton <ian@mnementh.co.uk> Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com> Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com> Cc: Denis Karpov <ext-denis.2.karpov@nokia.com> Cc: Pierre Ossman <pierre@ossman.eu> Cc: Philip Langdale <philipl@overt.org> Cc: "Madhusudhan" <madhu.cr@ti.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23omap_hsmmc: cater for weird CMD6 behaviourAdrian Hunter
Sometimes the controller unexpectedly produces a TC (transfer complete) interrupt before the CC (command complete) interrupt for command 6 (SWITCH). This is a problem because the CC interrupt can get mixed up with the next request. Add a hack for CMD6. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Acked-by: Matt Fleming <matt@console-pimps.org> Cc: Ian Molton <ian@mnementh.co.uk> Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com> Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com> Cc: Denis Karpov <ext-denis.2.karpov@nokia.com> Cc: Pierre Ossman <pierre@ossman.eu> Cc: Philip Langdale <philipl@overt.org> Cc: "Madhusudhan" <madhu.cr@ti.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23omap_hsmmc: clear interrupt status after init sequenceAdrian Hunter
Clear the interrupt status after sending the initialization sequence, as specified in the TRM. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Acked-by: Matt Fleming <matt@console-pimps.org> Cc: Ian Molton <ian@mnementh.co.uk> Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com> Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com> Cc: Denis Karpov <ext-denis.2.karpov@nokia.com> Cc: Pierre Ossman <pierre@ossman.eu> Cc: Philip Langdale <philipl@overt.org> Cc: "Madhusudhan" <madhu.cr@ti.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>