summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
AgeCommit message (Collapse)AuthorFilesLines
2007-05-08mmc: use lock instead of claim in debug checkPierre Ossman1-4/+6
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 Engelhardt4-18/+15
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 Dubov1-12/+1
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 Torvalds1-2/+2
* '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 Lindgren1-21/+26
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 Lindgren1-2/+4
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 Patard1-1/+1
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 Bunk1-1/+1
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 Ossman3-19/+31
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 Ossman6-213/+444
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 Ossman1-40/+35
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 Ossman1-8/+41
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 Langdale3-3/+31
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 Langdale1-10/+7
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 Ossman5-682/+1035
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 Ossman1-21/+20
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 Ossman10-464/+758
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 Ossman5-13/+19
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 Ossman2-536/+398
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 Ossman1-3/+10
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 Ossman1-0/+3
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 Ossman1-1/+14
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 Ossman24-127/+158
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 Ossman4-7/+7
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 Ossman2-2/+2
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 Ossman9-9/+0
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 Ossman1-1/+2
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 Ossman2-8/+36
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 Ossman1-1/+1
Fix copy-n-paste error. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01tifm: layout fixes, small changes to comments and printfsAlex Dubov1-19/+30
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 Dubov1-147/+296
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 Dubov1-16/+19
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 Dubov1-122/+137
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 Dubov1-130/+68
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 Dubov1-36/+36
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 Dubov1-15/+10
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 Dubov1-21/+13
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>
2007-05-01tifm: simplify bus match and uevent handlersAlex Dubov1-3/+3
Remove code duplicating the kernel functionality and clean up data structures involved in driver matching. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01tifm: hide details of interrupt processing from socket driversAlex Dubov1-15/+28
Instead of passing transformed value of adapter interrupt status to socket drivers, implement two separate callbacks - one for card events and another for dma events. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01wbsd: remove block crc testPierre Ossman2-34/+3
Block completion interrupts occur faster than we can process them, so just ignore them competely. Commit also fixes up some incorrect register defines. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: enforce correct sg listPierre Ossman1-0/+11
Now that we've fixed our only offender when it comes to strange sg list, add a check so that future users keep the sg list proper with regard to transfer size. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: cull sg list to match mmc request sizeAlex Dubov5-129/+50
mmc layer may introduce additional (compared to block layer) limits on request size. Culling of the sg list to match adjusted request size simplifies the handling of such cases in the low level driver, allowing it to skip block count checks while processing sg entries. (fixes for wbsd and sdhci by Pierre Ossman) Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-04-27uevent: use add_uevent_var() instead of open coding itEric Rannaud1-16/+11
Make use of add_uevent_var() instead of (often incorrectly) open coding it. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Eric Rannaud <eric.rannaud@gmail.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-04-21[ARM] 4304/1: removes the unnecessary bit number from CKENnn_XXXXEric Miao1-2/+2
This patch removes the unnecessary bit number from CKENnn_XXXX definitions for PXA, so that CKEN0_PWM0 --> CKEN_PWM0 CKEN1_PWM1 --> CKEN_PWM1 ... CKEN24_CAMERA --> CKEN_CAMERA The reasons for the change of these defitions are: 1. they do not scale - they are currently valid for pxa2xx, but definitely not valid for pxa3xx, e.g., pxa3xx has bit 3 for camera instead of bit 24 2. they are unnecessary - the peripheral name within the definition has already announced its usage, we don't need those bit numbers to know which peripheral we are going to enable/disable clock for 3. they are inconvenient - think about this: a driver programmer for pxa has to remember which bit in the CKEN register to turn on/off Another change in the patch is to make the definitions equal to its clock bit index, so that #define CKEN_CAMERA (24) instead of #define CKEN_CAMERA (1 << 24) this change, however, will add a run-time bit shift operation in pxa_set_cken(), but the benefit of this change is that it scales when bit index exceeds 32, e.g., pxa3xx has two registers CKENA and CKENB, totally 64 bit for this, suppose CAMERA clock enabling bit is CKENB:10, one can simply define CKEN_CAMERA to be (32 + 10) and so that pxa_set_cken() need minimum change to adapt to that. Signed-off-by: eric miao <eric.y.miao@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-03-12[ARM] 4256/1: i.MX/MX1 SDHC fix/workaround of SD card recognition problemsPavel Pisa1-1/+12
The SDHC controllers cannot process shorter transfers. They has to be handled as longer ones, but it such case CRC error is evaluated. There was a case in the code still, where this error is not ignored as it should to be process these transfers. Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-03-06sdhci: release irq during suspendPierre Ossman1-0/+12
Release the device's irq during sleep, as all well-behaved drivers should. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-03-06sdhci: make isr tolerant of read errorsMark Lord1-1/+1
The interrupt is shared with another device, which resumes earlier than the sdhci controller, and generates an interrupt. The sdhci interrupt handler runs, sees 0xffffffff in its own device's interrupt status, and tries to handle it.. The reason for the 0xffffffff is that the device is still suspended, and *all* regs are reading back 0xffffffff. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-03-06mmc: require explicit support for high-speedPierre Ossman2-50/+58
The new high-speed timings are similar to each other and the old system, but not identical. And although things "just work" most of the time, sometimes it does not. So we need to start marking which hosts are known to fully comply with the new timings. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-19Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-armLinus Torvalds1-23/+23
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (117 commits) [ARM] 4058/2: iop32x: set ->broken_parity_status on n2100 onboard r8169 ports [ARM] 4140/1: AACI stability add ac97 timeout and retries [ARM] 4139/1: AACI record support [ARM] 4138/1: AACI: multiple channel support for IRQ handling [ARM] 4211/1: Provide a defconfig for ns9xxx [ARM] 4210/1: base for new machine type "NetSilicon NS9360" [ARM] 4222/1: S3C2443: Remove reference to missing S3C2443_PM [ARM] 4221/1: S3C2443: DMA support [ARM] 4220/1: S3C24XX: DMA system initialised from sysdev [ARM] 4219/1: S3C2443: DMA source definitions [ARM] 4218/1: S3C2412: fix CONFIG_CPU_S3C2412_ONLY wrt to S3C2443 [ARM] 4217/1: S3C24XX: remove the dma channel show at startup [ARM] 4090/2: avoid clash between PXA and SA1111 defines [ARM] 4216/1: add .gitignore entries for ARM specific files [ARM] 4214/2: S3C2410: Add Armzone QT2410 [ARM] 4215/1: s3c2410 usb device: per-platform vbus_draw [ARM] 4213/1: S3C2410 - Update definition of ADCTSC_XY_PST [ARM] 4098/1: ARM: rtc_lock only used with rtc_cmos [ARM] 4137/1: Add kexec support [ARM] 4201/1: SMP barriers pair needed for the secondary boot process ... Fix up conflict due to typedef removal in sound/arm/aaci.h
2007-02-14[PATCH] remove many unneeded #includes of sched.hTim Schmielau1-1/+0
After Al Viro (finally) succeeded in removing the sched.h #include in module.h recently, it makes sense again to remove other superfluous sched.h includes. There are quite a lot of files which include it but don't actually need anything defined in there. Presumably these includes were once needed for macros that used to live in sched.h, but moved to other header files in the course of cleaning it up. To ease the pain, this time I did not fiddle with any header files and only removed #includes from .c-files, which tend to cause less trouble. Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha, arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig, allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all configs in arch/arm/configs on arm. I also checked that no new warnings were introduced by the patch (actually, some warnings are removed that were emitted by unnecessarily included header files). Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>