aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc (follow)
AgeCommit message (Collapse)AuthorFilesLines
2007-10-17mmc: at91_mci: cleanup: use MCI_ERRORSAndrew Victor1-3/+1
A small MMC driver cleanup. Use the defined AT91_MCI_ERRORS in at91_mci_completed_command() instead of specifying all the error bits individually. Signed-off-by: Andrew Victor <andrew@sanpeople.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-10-17mmc: possible leak in mmc_read_ext_csdFlorin Malita1-1/+2
The exception path associated with an invalid ext_csd_struct returns without freeing ext_csd. Coverity CID 1909. Signed-off-by: Florin Malita Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-10-16missing include in mmcAl Viro1-0/+1
AFAICS, fallout from repacing include of blkdev.h with include of bio.h. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16Merge branch 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-blockLinus Torvalds1-3/+3
* 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block: (63 commits) Fix memory leak in dm-crypt SPARC64: sg chaining support SPARC: sg chaining support PPC: sg chaining support PS3: sg chaining support IA64: sg chaining support x86-64: enable sg chaining x86-64: update pci-gart iommu to sg helpers x86-64: update nommu to sg helpers x86-64: update calgary iommu to sg helpers swiotlb: sg chaining support i386: enable sg chaining i386 dma_map_sg: convert to using sg helpers mmc: need to zero sglist on init Panic in blk_rq_map_sg() from CCISS driver remove sglist_len remove blk_queue_max_phys_segments in libata revert sg segment size ifdefs Fixup u14-34f ENABLE_SG_CHAINING qla1280: enable use_sg_chaining option ...
2007-10-16spi doesn't need class_deviceTony Jones1-2/+2
Make the SPI framework and drivers stop using class_device. Update docs accordingly ... highlighting just which sysfs paths should be "safe"/stable. Signed-off-by: Tony Jones <tonyj@suse.de> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16mmc: need to zero sglist on initJens Axboe1-3/+3
Otherwise we could have junk in the sg fields, fooling the sg chaining into thinking ->page is valid. Acked-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-10-15Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-armLinus Torvalds2-21/+36
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (95 commits) [ARM] 4578/1: CM-x270: PCMCIA support [ARM] 4577/1: ITE 8152 PCI bridge support [ARM] 4576/1: CM-X270 machine support [ARM] pxa: Avoid pxa_gpio_mode() in gpio_direction_{in,out}put() [ARM] pxa: move pxa_set_mode() from pxa2xx_mainstone.c to mainstone.c [ARM] pxa: move pxa_set_mode() from pxa2xx_lubbock.c to lubbock.c [ARM] pxa: Make cpu_is_pxaXXX dependent on configuration symbols [ARM] pxa: PXA3xx base support [NET] smc91x: fix PXA DMA support code [SERIAL] Fix console initialisation ordering [ARM] pxa: tidy up arch/arm/mach-pxa/Makefile [ARM] Update arch/arm/Kconfig for drivers/Kconfig changes [ARM] 4600/1: fix kernel build failure with build-id-supporting binutils [ARM] 4599/1: Preserve ATAG list for use with kexec (2.6.23) [ARM] Rename consistent_sync() as dma_cache_maint() [ARM] 4572/1: ep93xx: add cirrus logic edb9307 support [ARM] 4596/1: S3C2412: Correct IRQs for SDI+CF and add decoding support [ARM] 4595/1: ns9xxx: define registers as void __iomem * instead of volatile u32 [ARM] 4594/1: ns9xxx: use the new gpio functions [ARM] 4593/1: ns9xxx: implement generic clockevents ...
2007-10-14Fix compile while compiling drivers/mmc/host/mmc_spi.o with !BLOCKDavid Brownell1-1/+1
Make sure the mmc_spi driver can build without CONFIG_BLOCK. Issue noted by "Avuton Olrich" <avuton@gmail.com> and randconfig. While that won't be a common configuration, sometimes embedded boards use SDIO to interface WLAN or Bluetooth chips (vs some parallel interface), and don't provide an MMC/SD socket for use with flash memory cards. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-14uevent environment changes falloutAl Viro1-11/+4
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-12Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6Linus Torvalds1-14/+7
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (75 commits) PM: merge device power-management source files sysfs: add copyrights kobject: update the copyrights kset: add some kerneldoc to help describe what these strange things are Driver core: rename ktype_edd and ktype_efivar Driver core: rename ktype_driver Driver core: rename ktype_device Driver core: rename ktype_class driver core: remove subsystem_init() sysfs: move sysfs file poll implementation to sysfs_open_dirent sysfs: implement sysfs_open_dirent sysfs: move sysfs_dirent->s_children into sysfs_dirent->s_dir sysfs: make sysfs_root a regular directory dirent sysfs: open code sysfs_attach_dentry() sysfs: make s_elem an anonymous union sysfs: make bin attr open get active reference of parent too sysfs: kill unnecessary NULL pointer check in sysfs_release() sysfs: kill unnecessary sysfs_get() in open paths sysfs: reposition sysfs_dirent->s_mode. sysfs: kill sysfs_update_file() ...
2007-10-12Driver core: change add_uevent_var to use a structKay Sievers1-14/+7
This changes the uevent buffer functions to use a struct instead of a long list of parameters. It does no longer require the caller to do the proper buffer termination and size accounting, which is currently wrong in some places. It fixes a known bug where parts of the uevent environment are overwritten because of wrong index calculations. Many thanks to Mathieu Desnoyers for finding bugs and improving the error handling. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-10-12mmc: use correct unregister function for led triggerPierre Ossman1-1/+1
We register a simple trigger so make sure we use the corresponding unregister function. (Also means we get a dummy function when triggers aren't compiled in) Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-10-12[ARM] pxa: update PXA MMC interface driver to use clk supportRussell King2-21/+36
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-10-11mmc: don't use weight32()Nicolas Pitre2-2/+4
Using weight32() to determine if a value is a power of 2 is a rather heavi weight solution. The classic idiom is (x & (x - 1)) == 0, but the kernel already provide a is_power_of_2 function for it. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-10-10pxamci: support arbitrary block sizeNicolas Pitre1-3/+16
The PXA has two transmit FIFOes, each32 byte deep. when one FIFO is full and the other one has been transmitted, they are automatically swapped and DMA is triggered for another 32 byte burst. However, when there is less than 32 bytes left to send, the FIFO swap has to be done manually. This is required for some SDIO transfers which are not required to be multiples of 32 bytes. A DMA completion interrupt is set for each descriptor which length isn't a multiple of 32 in order to force the FIFO swap. While at it, the DMA interrupt handler has been made a bit more resilient against errors. Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-10-06sdio: make the IRQ thread more resilient in the presence of bad statesNicolas Pitre1-2/+8
Currently we print a message about some bad states wrt function IRQ handlers but return 0 from process_sdio_pending_irqs() nevertheless. This can lead to an infinite loop as nothing might have cleared the condition for the pending card interrupt from the host controller by the time host->ops->enable_sdio_irq(host, 1) is called. Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-10-06sdio: fix IRQ diagnostic messageNicolas Pitre1-1/+1
If func is actually null we won't get much from sdio_func_id(func). Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-10-03sdhci: remove old dma module paramsPierre Ossman1-12/+1
The forcedma and nodma module parameters can be replaced with the quirks parameter, so remove the redundancy. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-10-03sdhci: add SDHCI_QUIRK_BROKEN_DMA quirkFeng Tang1-2/+11
Some controllers like ENE712 can't work properly with DMA mode, add this quirk to force these kinds of HW work with PIO mode Signed-off-by: Feng Tang <feng.tang@intel.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-10-03sdhci: remove DMA capability check from controller's PCI Class regFeng Tang1-2/+7
Many host controllers don't fully follow the PCI spec to claim whether they support DMA in PCI class register. Leave the driver to judge it from the Capability register, quirks and module parameter Signed-off-by: Feng Tang <feng.tang@intel.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-10-03sdhci: fix a typoNicolas Pitre2-2/+2
Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-10-03mmc: Disabler for Ricoh MMC controllerPhilip Langdale3-0/+169
Thanks to Matt Domsch and Rezwanul Kabir at Dell, we know how to disable the MMC controller on the multi-function Ricoh R5C832. The MMC controller needs to be disabled or it will steal MMC cards from the SD controller where they would otherwise be supported by the Linux SDHCI driver. Signed-off-by: Philipl Langdale <philipl@overt.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-27sdio: adaptive interrupt pollingPierre Ossman1-5/+23
The interrupt polling frequency is a compromise between power usage and interrupt latency. Unfortunately, it affects throughput rather severely for devices which require an interrupt for every chunk of data. By making the polling frequency adaptive, we get better throughput with those devices without sacficing too much power. Polling will quickly increase when there is an actual interrupt, and slowly fall back to the idle frequency when the interrupts stop coming. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-25mmc: pxamci: add SDIO card interrupt reporting capabilityBridge Wu2-5/+24
Again, only available from PXA27x. Signed-off-by: Bridge Wu <mingqiao.wu@gmail.com> Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-25mmc: pxamci: set proper buswidth capabilities according to PXA flavorBridge Wu2-1/+10
From PXA27x, it is possible to do 4-bit data transfers. Signed-off-by: Bridge Wu <mingqiao.wu@gmail.com> Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-25mmc: pxamci: set proper block capabilities according to PXA flavorNicolas Pitre1-2/+2
From PXA27x, it is possible to do 2048-byte block transfers. Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-25mmc: pxamci: better pending IRQ determinationBridge Wu1-1/+1
Pending interrupts should be determined from both I_REG and I_MASK registers. Signed-off-by: Bridge Wu <mingqiao.wu@gmail.com> Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-24arm: i.MX/MX1 SDHC implements SD cards read-only switch read-backPavel Pisa1-2/+14
The patch enables to define MMC host get_ro() method through platform data. Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-24mmc: add led triggerPierre Ossman2-0/+10
Add a led trigger for each host controller that indicates if there is a request active on the controller. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23mmc_spi host driverDavid Brownell3-0/+1422
This is the latest version of the MMC-over-SPI support. It works on 2.6.23-rc2 plus git-mmc (from rc1-mm2), along with the preceding patches which teach the rest of the MMC stack about SPI. The main issue of note is that sometimes cards need to be power cycled to recover after certain faults. Also, it may sometimes be necessary to disable CRCs. ("modprobe mmc_core use_spi_crc=n") Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: mikael.starvik@axis.com, Cc: Hans-Peter Nilsson <hp@axis.com> Cc: Jan Nikitenko <jan.nikitenko@gmail.com> Cc: Mike Lavender <mike@steroidmicros.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23MMC core learns about SPIDavid Brownell10-103/+372
Teach the MMC/SD/SDIO core about using SPI mode. - Use mmc_host_is_spi() so enumeration works through SPI signaling and protocols, not just the native versions. - Provide the SPI response type flags with each request issued, including requests from the new lock/unlock code. - Understand that cmd->resp[0] and mmc_get_status() results for SPI return different values than for "native" MMC/SD protocol; this affects resetting, checking card lock status, and some others. - Understand that some commands act a bit differently ... notably: * OP_COND command doesn't return the OCR * APP_CMD status doesn't have an R1_APP_CMD analogue Those changes required some new and updated primitives: - Provide utilities to access two SPI-only requests, and one request that wasn't previously needed: * mmc_spi_read_ocr() ... SPI only * mmc_spi_set_crc() ... SPI only (override by module parm) * mmc_send_cid() ... for use without broadcast mode - Updated internal routines: * Previous mmc_send_csd() modified into mmc_send_cxd_native(); it uses native "R2" responses, which include 16 bytes of data. * Previous mmc_send_ext_csd() becomes new mmc_send_cxd_data() helper for command-and-data access * Bugfix to that mmc_send_cxd_data() code: dma-to-stack is unsafe/nonportable, so kmalloc a bounce buffer instead. - Modified mmc_send_ext_csd() now uses mmc_send_cxd_data() helper - Modified mmc_send_csd(), and new mmc_spi_send_cid(), routines use those helper routines based on whether they're native or SPI The newest categories of cards supported by the MMC stack aren't expected to work yet with SPI: MMC or SD cards with over 4GB data, and SDIO. All those cards support SPI mode, so eventually they should work too. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23MMC/SD card driver learns SPIDavid Brownell1-8/+15
Teaching the MMC/SD block card driver about SPI. - Provide the SPI response type flags with each request issued. - Understand that multiblock SPI writes don't use STOP_TRANSMISSION. - Correct check for APP_CMD failure. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23sdio: store vendor stringsPierre Ossman3-1/+55
Store vendor strings found in CISTPL_VERS_1 so that function drivers can access them. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23mmc: increase power up delayPierre Ossman1-1/+9
Increase delay for power up in order to support some slower boards. Also add some comments about why the delays are there. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23sdhci: sdio interrupt supportPierre Ossman1-1/+38
Add support for relaying the sdio interrupt signal from the card. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23sdio: fix recursion issues between sdio-uart driver and tty layerNicolas Pitre1-2/+19
In a few places, sdio_uart_irq() is called directly instead of waiting for the actual interrupt to be raised and the SDIO IRQ thread scheduled in order to reduce latency. However, some interaction with the tty core may end up calling us back (serial echo, flow control, etc.) creating two issues: - the host lock gets claimed twice from the same thread causing a deadlock; - the same direct calls to sdio_uart_irq() may be performed causing unexpected reentrancy into the IRQ handler. This patch handles both of those issues. Signed-off-by: Nicolas Pitre <npitre@mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23sdio: add default c_ispeed/c_ospeed values to sdio_uart driverNicolas Pitre1-0/+2
Note that the default baudrate is 4800 instead of 9600 as a convenience because that's what GPS devices want which is still the main use for this driver. Signed-off-by: Nicolas Pitre <npitre@mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23sdio: add sdio_f0_readb() and sdio_f0_writeb()David Vrabel1-0/+64
Add sdio_f0_readb() and sdio_f0_writeb() functions to reading and writing function 0 registers. Writes outside the vendor specific CCCR registers (0xF0 - 0xFF) are not permitted. Signed-off-by: David Vrabel <david.vrabel@csr.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23mmc: replace BUG_ON with WARN_ONPierre Ossman5-15/+13
Replace all cases of BUG_ON with WARN_ON where there is a chance (with varying degrees of slim) that the kernel can continue without incidence. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23sdio: kmalloc + memset conversion to kzallocMariusz Kozlowski1-3/+1
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23sdio: extend sdio_readsb() and friends to handle any length of bufferDavid Vrabel3-28/+86
Extend sdio_readsb(), sdio_writesb(), sdio_memcpy_fromio(), and sdio_memcpy_toio() to handle any length of buffer by splitting the transfer into several IO_RW_EXTENDED commands. Typically, a transfer would be split into a single block mode transfer followed by a byte mode transfer for the remainder but we also handle lack of block mode support and the block size being greater than 512 (the maximum byte mode transfer size). host->max_seg_size <= host->max_req_size so there's no need to check both when determining the maximum data size for a single command. Signed-off-by: David Vrabel <david.vrabel@csr.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23sdio: set the functions' block sizeDavid Vrabel3-1/+59
Before a driver is probed, set the function's block size to the default so the driver is sure the block size is something sensible and it needn't explicitly set it. The default block size is the largest that's supported by both the card and the host, with a maximum of 512 to ensure aribitrarily sized transfer use the optimal (least) number of commands. See http://lkml.org/lkml/2007/8/7/150 for reasons for the block size choice. Signed-off-by: David Vrabel <david.vrabel@csr.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23sdio: add SDIO_FBR_BASE(f) macroDavid Vrabel2-3/+3
Signed-off-by: David Vrabel <david.vrabel@csr.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23mmc: fix sdio timeout calculationPierre Ossman1-0/+9
SDIO doesn't have a CSD so it uses different timeout values than SD memory. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23mmc: fix incorrect divisor in debug outputPierre Ossman1-1/+1
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23sdio: enable wide bus modePierre Ossman1-0/+33
Enable 4-bit data bus mode, according to host and card capabilities. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23sdio: change clock speedPierre Ossman1-0/+6
Change clock speed to the highest supported by the card. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23make struct sdio_dev_attrs[] staticAdrian Bunk1-1/+1
On Wed, Jul 25, 2007 at 04:03:04AM -0700, Andrew Morton wrote: >... > Changes since 2.6.22-rc6-mm1: >... > git-mmc.patch >... > git trees >... sdio_dev_attrs[] can become static. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23sdio: add interface for host side SDIO interrupt reportingNicolas Pitre2-1/+10
Signed-off-by: Nicolas Pitre <npitre@mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23sdio: support IO_RW_EXTENDEDPierre Ossman3-0/+243
Support the multi-byte transfer operation, including handlers for common operations like writel()/readl(). Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>