summaryrefslogtreecommitdiff
path: root/drivers/mmc
AgeCommit message (Collapse)Author
2007-06-13mmc: get back read-only switch functionPierre Ossman
Somehow the code to read the read-only switch of SD cards got lost in the reorganisation. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-06-13mmc-omap: fix sd response type 6 vs. 1Ragner Magalhaes
Ignoring OMAP_MMC_STAT_CARD_ERR, treating it as if the command completed correctly. Signed-off-by: Ragner Magalhaes <ragner.magalhaes@indt.org.br> Signed-off-by: Carlos Eduardo Aguiar <carlos.aguiar@indt.org.br> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-06-07mmc: don't call switch on old cardsPierre Ossman
Make sure we don't call the switch function on cards too old to support it. They should just ignore it, but some have been reported to lock up instead. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-06-07mmc: fix broken if clausePierre Ossman
Fix a broken if clause which was causing SD cards to go into 4-bit mode even if the host did not support it. (Reported by David Brownell and Marc Pignat) Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-06-07au1xmmc: Replace C code with call to ARRAY_SIZE() macro.Robert P. J. Day
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-06-07mmc-atmel: remove linux/mmc/protocol.h dependenciesMarc Pignat
Fix compilation error by removing command decoding from at91_mci.c driver. Decoding commands in the host driver is the wrong way. Signed-off-by: Marc Pignat <marc.pignat@hevs.ch> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-24mmc: clean up unused parts of block driverPierre Ossman
Remove dead code and unused structs from the block driver. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-14pxamci: fix PXA27x MMC workaround for bad CRC with 136 bit responseNicolas Pitre
... and make it depend on the response flag instead of the command type. Signed-off-by: Nicolas Pitre <npitre@mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-14mmc: use assigned major for block devicePierre Ossman
The MMC block devices now have an assigned major. Make sure we actually use it. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-14sdhci: handle dma boundary interruptsPierre Ossman
When the device hits certain memory boundaries, it signals an interrupt and expects to be serviced. We don't need the feature but we need to make sure the device doesn't stall. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-14mmc: au1xmmc command types check from data flagsYoichi Yuasa
This patch has changed command types check from data flags. MMC_STOP_TRANSMISSION is never passed to au1xmmc_send_command(). SEND_STOP() is used for MMC_STOP_TRANSMISSION. Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-10[S390] Kconfig: menus with depends on HAS_IOMEM.Martin Schwidefsky
Add "depends on HAS_IOMEM" to a number of menus to make them disappear for s390 which does not have I/O memory. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2007-05-09mmc build fixAndrew Morton
Cc: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-08mmc: use lock instead of claim in debug checkPierre Ossman
As mmc_detect_change() can be called from irq context, using claim (which can sleep) is inherently unsafe. Use the host spinlock instead, which also is faster. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-08mmc: Use menuconfig objectsJan Engelhardt
Change Kconfig objects from "menu, config" into "menuconfig" so that the user can disable the whole feature without having to enter the menu first. Signed-off-by: Jan Engelhardt <jengelh@gmx.de> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-08disable socket power in adapter driver instead of media oneAlex Dubov
Socket power must be fully controlled by adapter driver. This also prevents unnecessary power-off of the socket when media driver is unloaded, yet media remains in the socket. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-06Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-armLinus Torvalds
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (82 commits) [ARM] Add comments marking in-use ptrace numbers [ARM] Move syscall saving out of the way of utrace [ARM] 4360/1: S3C24XX: regs-udc.h remove unused macro [ARM] 4358/1: S3C24XX: mach-qt2410.c: remove linux/mmc/protocol.h header [ARM] mm 10: allow memory type to be specified with ioremap [ARM] mm 9: add additional device memory types [ARM] mm 8: define mem_types table L1 bit 4 to be for ARMv6 [ARM] iop: add missing parens in macro [ARM] mm 7: remove duplicated __ioremap() prototypes ARM: OMAP: fix OMAP1 mpuio suspend/resume oops ARM: OMAP: MPUIO wake updates ARM: OMAP: speed up gpio irq handling ARM: OMAP: plat-omap changes for 2430 SDP ARM: OMAP: gpio object shrinkage, cleanup ARM: OMAP: /sys/kernel/debug/omap_gpio ARM: OMAP: Implement workaround for GPIO wakeup bug in OMAP2420 silicon ARM: OMAP: Enable 24xx GPIO autoidling [ARM] 4318/2: DSM-G600 Board Support [ARM] 4227/1: minor head.S fixups [ARM] 4328/1: Move i.MX UART regs to driver ...
2007-05-01mmc-omap: Clean up omap set_ios and make MMC_POWER_ON workTony Lindgren
Move divisor calculation into a separate function and re-arrange the init order to make MMC_POWER_ON work. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc-omap: Fix omap to use MMC_POWER_ONTony Lindgren
As discussed earlier on LKML: http://lkml.org/lkml/2006/5/4/44 Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc-omap: add missing '\n'Arnaud Patard
This patch add a missing '\n' at the end of the 'cover is open' string in mmc_omap_switch_handler(). Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: make tifm_sd_set_dma_data() staticAdrian Bunk
This patch makes the needlessly global tifm_sd_set_dma_data() static. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: remove old card statesPierre Ossman
Remove card states that no longer make any sense. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: support unsafe resume of cardsPierre Ossman
Since many have the system root on MMC/SD we must allow some foot shooting when it comes to resume. We cannot detect if a card is removed and reinserted during suspend, so the safe approach would be to assume it was, avoiding potential filesystem corruption. This will of course not work if you cannot release the card before suspend. This commit adds a compile time option that makes the MMC layer assume the card wasn't touched if it is redetected upon resume. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: separate out reading EXT_CSDPierre Ossman
Separate the reading and decoding of the EXT_CSD register with the actions taken on it. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: break apart switch functionPierre Ossman
Break apart the SD switch function into one that reads the capabilities and one that acts on them. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01MMC: Fix handling of low-voltage cardsPhilip Langdale
Fix handling of low voltage MMC cards. The latest MMC and SD specs both agree that support for low-voltage operations is indicated by bit 7 in the OCR. The MMC spec states that the low voltage range is 1.65-1.95V while the SD spec leaves the actual voltage range undefined - meaning that there is still no such thing as a low voltage SD card. However, an old Sandisk spec implied that bits 7.0 represented voltages below 2.0V in 1V or 0.5V increments, and the code was accordingly written with that expectation. This confusion meant that host drivers attempting to support the typical low voltage (1.8V) would set the wrong bits in the host OCR mask (usually bits 5 and/or 6) resulting in the the low voltage mode never being used. This change corrects the low voltage range and adds sanity checks on the reserved bits (0-6) and for SD cards that claim to support low-voltage operations. Signed-off-by: Philip Langdale <philipl@overt.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01MMC: Consolidate voltage definitionsPhilip Langdale
Consolidate the list of available voltages. Up until now, a separate set of defines has been used for host->vdd than that used for the OCR voltage mask values. Having two sets of defines allows them to get out of sync and the current sets are already inconsistent with one claiming to describe ranges and the other specific voltages. Only the SDHCI driver uses the host->vdd defines and it is easily fixed to use the OCR defines. Signed-off-by: Philip Langdale <philipl@overt.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: add bus handlerPierre Ossman
Delegate protocol handling to "bus handlers". This allows the core to just handle the task of arbitrating the bus. Initialisation and pampering of cards is now done by the different bus handlers. This design also allows MMC and SD (and later SDIO) to be more cleanly separated, allowing easier maintenance. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01wbsd: check for data opcode earlierPierre Ossman
Move the check for supported data opcodes to the beginning of the request function to avoid wedging the card. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: Separate out protocol opsPierre Ossman
Move protocol operations and definitions into their own files in an effort to separate protocol handling and bus arbitration more clearly. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: Move core functions to subdirPierre Ossman
Create a "core" subdirectory to house the central bus handling functions. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: deprecate mmc bus topologyPierre Ossman
The classic MMC bus was defined as multi card bus system, which is reflected in the design in the MMC layer. When SD showed up, the bus topology was abandoned and a star topology (one card per host) was mandated. MMC version 4 has followed this, officially deprecating the bus topology. As we do not have any known users of the bus topology we can remove support for it. This will simplify the code and rectify some incorrect assumptions in the newer additions. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: remove card upon suspendPierre Ossman
Suspending MMC/SD cards (versus removing and readding them) is an inherently unsafe operation and has even been broken for some time. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: allow suspended block driver to be removedPierre Ossman
Make sure we don't deadlock when removing a suspended block queue, something that might happen if the card is removed during suspend. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: Flush pending detects on host removalPierre Ossman
Make sure we kill of any pending detection runs when the host is removed instead of when it is freed. Also add some debugging to make sure the driver doesn't queue up more detection after it has removed the host. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: Move host and card drivers to subdirsPierre Ossman
Clean up the drivers/mmc directory by moving card and host drivers into subdirectories. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: Move queue functions to mmc_blockPierre Ossman
The mmc block queue functions are tailored for the mmc_block driver, so move those functions into that module. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: Move "present" markingPierre Ossman
The "present" state indicates that the card is a registered device, so it is more clear to put it together with the actual registration. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: Move OCR bit definesPierre Ossman
All host drivers were #include:ing mmc/protocol.h just to get access to the OCR bit defines. Move these to host.h instead. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: add type field to cardsPierre Ossman
Split out the type of card into its own field as it hardly qualifies as a state. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: MMC sector based cardsPierre Ossman
Support for MMC 4.2 sector based cards. This tweaks the init a bit and reads a new field out of the EXT_CSD. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: use right timing mode constantPierre Ossman
Fix copy-n-paste error. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01tifm: layout fixes, small changes to comments and printfsAlex Dubov
Cosmetic changes to the code. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01tifm_sd: implement software scatter-gatherAlex Dubov
It was found that delays associated with issue and completion of the commands severely limit performance of the new, fast SD cards. To alleviate this issue scatter-gather emulation in software is implemented for both dma and pio transfer modes. Non-block aligned and high memory sg entries are accounted for. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01tifm_sd: fix resume handlerAlex Dubov
Resume should not explicitly check for media type. Instead, it may relay on success of socket initialization. Small changes are introduced to tifm_sd_initialize to make it more robust. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01tifm_sd: replace command completion state machine with full checkingAlex Dubov
State machine used to to track mmc command state was found to be fragile and unreliable, making many cards unusable. The safer solution is to perform all needed checks at every card event. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01tifm_sd: merge dma and pio request processing pathsAlex Dubov
To allow for switching of trasfer mode (dma/pio) on a per-request basis, pio and dma request issue and completion function are now merged. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01tifm_sd: separate command flags, socket flags and register bit masksAlex Dubov
host->flags variable was hosting a collection of bits with different semantics. For clarity, hardware bit masks are now defined as macros, socket flags represented as bit fields and flags (now cmd_flags) only hosts command processing modifiers. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01tifm_sd: remove wait for power off on removeAlex Dubov
This wait was needed because of the mmc layer failure to wait for completion of all outstanding commands before host removal. It should be fixed now in the mmc layer. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01tifm_sd: remove tifm_sd_terminate functionAlex Dubov
tifm_sd_terminate can only lawfully be called on device removal so it can be merged with tifm_sd_remove. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>