aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc/wbsd.c
AgeCommit message (Collapse)Author
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 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-01wbsd: remove block crc testPierre Ossman
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: cull sg list to match mmc request sizeAlex Dubov
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-02-11mmc: wbsd: Remove stray kunmap_atomic()Pierre Ossman
There was one kunmap_atomic() left over from 4a0ddbd25ad4e03a0a1657f5cb2259c9a35fe9e6 that was causing crashes. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-09mmc: wbsd: Remove driver versionPierre Ossman
The driver version was only really meaningful when it was an out-of-tree driver. Now we can use the version of the kernel. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-04mmc: wbsd: replace kmap with page_addressPierre Ossman
Since we actively avoid highmem, calling kmap_atomic() instead of page_address() is effectively only obfuscation. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-04mmc: Handle wbsd's stupid command listPierre Ossman
The wbsd hardware is so incredibly brain damaged that it has an internal list of commands that result in data transfers. The result being that commands that aren't on this list aren't supported. Instead of locking up, waiting for a data interrupt that will never come, we try to fail a bit more gracefully. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-04mmc: Allow host drivers to specify max block countPierre Ossman
Many controllers have an upper limit on the number of blocks that can be transferred in one request. Allow the host drivers to specify this and make sure we avoid hitting this limit. Also change the max_sectors field to avoid confusion. This makes it map less directly to the block layer limits, but as they didn't apply directly on MMC cards anyway, this isn't a great loss. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-04mmc: Allow host drivers to specify a max block sizePierre Ossman
Most controllers have an upper limit on the block size. Allow the host drivers to specify this and make sure we avoid hitting this limit. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2006-12-02Merge branch 'for-linus' of ↵Linus Torvalds
master.kernel.org:/pub/scm/linux/kernel/git/drzeus/mmc * 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/drzeus/mmc: mmc: correct request error handling mmc: Flush block queue when removing card mmc: sdhci high speed support mmc: Support for high speed SD cards mmc: Fix mmc_delay() function mmc: Add support for mmc v4 wide-bus modes [PATCH] mmc: Add support for mmc v4 high speed mode trivial change for mmc/Kconfig: MMC_PXA does not mean only PXA255 Make general code cleanups Add MMC_CAP_{MULTIWRITE,BYTEBLOCK} flags Platform device error handling cleanup Move register definitions away from the header file Change OMAP_MMC_{READ,WRITE} macros to use the host pointer Replace base with virt_base and phys_base mmc: constify mmc_host_ops vectors mmc: remove kernel_thread()
2006-12-01Driver core: convert mmc code to use struct deviceGreg Kroah-Hartman
Converts from using struct "class_device" to "struct device" making everything show up properly in /sys/devices/ with symlinks from the /sys/class directory. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01mmc: constify mmc_host_ops vectorsDavid Brownell
Now that mmc_host_ops can be constified, update the various drivers to constify those method tables and shrink the writable data segment. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2006-10-05IRQ: Maintain regs pointer globally rather than passing to IRQ handlersDavid Howells
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead of passing regs around manually through all ~1800 interrupt handlers in the Linux kernel. The regs pointer is used in few places, but it potentially costs both stack space and code to pass it around. On the FRV arch, removing the regs parameter from all the genirq function results in a 20% speed up of the IRQ exit path (ie: from leaving timer_interrupt() to leaving do_IRQ()). Where appropriate, an arch may override the generic storage facility and do something different with the variable. On FRV, for instance, the address is maintained in GR28 at all times inside the kernel as part of general exception handling. Having looked over the code, it appears that the parameter may be handed down through up to twenty or so layers of functions. Consider a USB character device attached to a USB hub, attached to a USB controller that posts its interrupts through a cascaded auxiliary interrupt controller. A character device driver may want to pass regs to the sysrq handler through the input layer which adds another few layers of parameter passing. I've build this code with allyesconfig for x86_64 and i386. I've runtested the main part of the code on FRV and i386, though I can't test most of the drivers. I've also done partial conversion for powerpc and MIPS - these at least compile with minimal configurations. This will affect all archs. Mostly the changes should be relatively easy. Take do_IRQ(), store the regs pointer at the beginning, saving the old one: struct pt_regs *old_regs = set_irq_regs(regs); And put the old one back at the end: set_irq_regs(old_regs); Don't pass regs through to generic_handle_irq() or __do_IRQ(). In timer_interrupt(), this sort of change will be necessary: - update_process_times(user_mode(regs)); - profile_tick(CPU_PROFILING, regs); + update_process_times(user_mode(get_irq_regs())); + profile_tick(CPU_PROFILING); I'd like to move update_process_times()'s use of get_irq_regs() into itself, except that i386, alone of the archs, uses something other than user_mode(). Some notes on the interrupt handling in the drivers: (*) input_dev() is now gone entirely. The regs pointer is no longer stored in the input_dev struct. (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does something different depending on whether it's been supplied with a regs pointer or not. (*) Various IRQ handler function pointers have been moved to type irq_handler_t. Signed-Off-By: David Howells <dhowells@redhat.com> (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
2006-10-01[PATCH] mmc (mainly): add "or later" clause to licence statement.Pierre Ossman
Clarify my (Pierre's) position on which GPL versions apply. The patch only touches the source files where I am the only major author. The people who have made the minor commits to the files have been contacted and have no issues with this change. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-24[MMC] MMC_CAP_BYTEBLOCK flag for non-log2 block sizes capable hostsRussell King
Some MMC hosts can only handle log2 block sizes. Unfortunately, the MMC password support needs to be able to send non-log2 block sizes. Provide a capability so that the MMC password support can decide whether it should use this support or not. The unfortunate side effect of this host limitation is that any MMC card protected by a password which is not a log2 block size can not be accessed on a host which only allows a log2 block size. This change just adds the flag. The MMC password support code needs updating to use it (if and when it is finally submitted.) Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-09-16[MMC] Add multi block-write capabilityRussell King
Add a capability flag for drivers to set when they can perform multi- block transfers to cards _and_ correctly report the number of bytes transferred should an error occur. The last point is very important - if a driver reports more bytes than were actually accepted by the card and an error occurs, there is the possibility for data loss. Pierre Ossman provided the patch for wbsd and sdhci. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-08-07[MMC] Another stray 'io' referencePierre Ossman
Another misuse of the global 'io' variable instead of the local 'base'. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-08-06[MMC] Fix base address configuration in wbsdPierre Ossman
There were some confusion about base I/O variables in the wbsd driver. Seems like things have been working on shear luck so far. The global 'io' variable (used when manually configuring the resources) was used instead of the local 'base' variable. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-07-02[PATCH] irq-flags: misc drivers: Use the new IRQF_ constantsThomas Gleixner
Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: "David S. Miller" <davem@davemloft.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-30Remove obsolete #include <linux/config.h>Jörn Engel
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-05-19[ARM] 3531/1: i.MX/MX1 SD/MMC ensure, that clock are stopped before new ↵Pavel Pisa
command and cleanups Patch from Pavel Pisa There has been problems that for some paths that clock are not stopped during new command programming and initiation. Result is issuing of incorrect command to the card. Some other problems are cleaned too. Noisy report of known ERRATUM #4 has been suppressed. Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-05-04[MMC] Move set_ios debugging into mmc.cRussell King
Rather than having every driver duplicate the set_ios debugging, provide a single version in mmc.c which can be expanded as we add additional functionality. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-03-29[MMC] Pass -DDEBUG on compiler command line if MMC_DEBUG selectedRussell King
Rather than each driver test MMC_DEBUG itself, and define DEBUG, pass it in via the makefile instead. Fix drivers to use pr_debug() where appropriate, and avoid defining a DEBUG() macro. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-02-02[MMC] Add MMC command type flagsRussell King
Some hosts need to know the command type, so pass it via a set of flags in cmd->flags. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-01-08[MMC] Lindent wbsd driverPierre Ossman
Fix the coding style in the wbsd driver once and for all. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-01-08[MMC] wbsd pnp suspendPierre Ossman
Allow the wbsd driver to use the new suspend/resume functions added to the PnP layer. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-01-03[MMC] wbsd: convert to the new platfrom device interfaceDmitry Torokhov
platform_device_register_simple() is going away, switch to using platfrom_device_alloc() + platform_device_add(). Also make sure that wbsd_driver gets unregistered when wbsd_init fails. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Acked-by: Pierre Ossman <drzeus@drzeus.cx>
2006-01-03[MMC] wbsd: make use of ARRAY_SIZE() macroDmitry Torokhov
Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Acked-by: Pierre Ossman <drzeus@drzeus.cx>
2005-11-11Merge master.kernel.org:/home/rmk/linux-2.6-drvmodelLinus Torvalds
2005-11-09[MMC] wbsd version 1.5Pierre Ossman
New kernel, new patches, new version. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-11-09[MMC] Add MODULE_AUTHOR to wbsdPierre Ossman
'cause I'm in it for the chicks. ;) Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-11-09[MMC] Use __devexit_p in wbsdPierre Ossman
wbsd_*_remove() is declared as __devexit but __devexit_p isn't used when taking their addresses. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-11-09[DRIVER MODEL] Convert platform drivers to use struct platform_driverRussell King
This allows us to eliminate the casts in the drivers, and eventually remove the use of the device_driver function pointer methods for platform device drivers. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-11-07[PATCH] kfree cleanup: misc remaining driversJesper Juhl
This is the remaining misc drivers/ part of the big kfree cleanup patch. Remove pointless checks for NULL prior to calling kfree() in misc files in drivers/. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Acked-by: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org> Acked-by: Roland Dreier <rolandd@cisco.com> Acked-by: Pierre Ossman <drzeus@drzeus.cx> Acked-by: Jean Delvare <khali@linux-fr.org> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Len Brown <len.brown@intel.com> Acked-by: "Antonino A. Daplas" <adaplas@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-05[MMC] Use controller id instead of driver name for printksPierre Ossman
The printks that aren't for debugging should use the name of the controller, not the driver name. Multiple MMC controllers aren't that common today, but this is the right way to do things. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-11-05[MMC] Fix chip config in wbsdPierre Ossman
There is a broken if clause in the wbsd driver that can cause the driver to try and configure the chip even though none is found. This results in i/o on invalid ports. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-10-29Create platform_device.h to contain all the platform device details.Russell King
Convert everyone who uses platform_bus_type to include linux/platform_device.h. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28[MMC] wbsd suspend supportPierre Ossman
Proper handling of suspend/resume in the wbsd driver. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-10-28[PATCH] DRIVER MODEL: Get rid of the obsolete tri-level suspend/resume callbacksRussell King
In PM v1, all devices were called at SUSPEND_DISABLE level. Then all devices were called at SUSPEND_SAVE_STATE level, and finally SUSPEND_POWER_DOWN level. However, with PM v2, to maintain compatibility for platform devices, I arranged for the PM v2 suspend/resume callbacks to call the old PM v1 suspend/resume callbacks three times with each level in order so that existing drivers continued to work. Since this is obsolete infrastructure which is no longer necessary, we can remove it. Here's an (untested) patch to do exactly that. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-12[MMC] Clean up wbsd detection handlingPierre Ossman
The wbsd driver's card detection routing is a bit of a mess. This patch cleans up the routine and makes it a bit more comprihensible. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-09-12[MMC] Remove trailing whitespace in wbsdPierre Ossman
Clean out trailing whitespace caused by not-so-great editor since it generates a lot of problems with editors configured to automatically strip whitespace. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-09-10[MMC] Add mmc_detect_change() delay support for wbsd driverRussell King
Convert wbsd to use the new delay functionality in mmc_detect_change() rather than implementing its own timer. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-09-08[MMC] Allow detection/removal to be delayedRichard Purdie
Change mmc_detect_change() to take a delay argument such that the detection of card insertions and removals can be delayed according to the requirements of the host driver or platform. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-09-07[PATCH] mmc: wbsd Secure Digital supportPierre Ossman
Add support for Secure Digital specific features in the wbsd driver. Adds support for read-only switch and wide bus transfers. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-03[MMC] support for mmc chip select in wbsdPierre Ossman
Use the chip select ios in the wbsd driver. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-08-19[MMC] Add mmc_hostname() macroRussell King
mmc_hostname() returns a pointer to the hostname for the mmc_host. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-08-10[PATCH] wbsd version bumpPierre Ossman
Even though the changes are minor for the next release an increasing version number simplifies my support issues. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-27[PATCH] clean up inline static vs static inlineJesper Juhl
`gcc -W' likes to complain if the static keyword is not at the beginning of the declaration. This patch fixes all remaining occurrences of "inline static" up with "static inline" in the entire kernel tree (140 occurrences in 47 files). While making this change I came across a few lines with trailing whitespace that I also fixed up, I have also added or removed a blank line or two here and there, but there are no functional changes in the patch. Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-01[PATCH] MMC: wbsd cleanupsAdrian Bunk
This patch contains the following possible cleanups: - make some needlessly global code static - remove the unneeded global function DBG_REG Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>