summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/mmc.c
Commit message (Collapse)AuthorAgeFilesLines
* mmc: Add 8-bit bus width supportJarkko Lavinen2008-12-311-4/+14
| | | | | Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
* MMC: Trivial comment cleanupDeepak Saxena2008-07-151-1/+1
| | | | | | | | Make the variable name in the comments match the actual name of the variable. Signed-off-by: Deepak Saxena <dsaxena@laptop.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
* mmc: use sysfs groups to handle conditional attributesPierre Ossman2008-03-221-51/+39
| | | | | | | | | | | | | | Suppressing uevents turned out to be a bad idea as it screws up the order of events, making user space very confused. Change the system to use sysfs groups instead. This is a regression that, for some odd reason, has gone unnoticed for some time. It confuses hal so that the block devices (which have the mmc device as a parent) are not registered. End result being that desktop magic when cards are inserted won't work. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* mmc: possible leak in mmc_read_ext_csdFlorin Malita2007-10-171-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>
* MMC core learns about SPIDavid Brownell2007-09-231-13/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* mmc: replace BUG_ON with WARN_ONPierre Ossman2007-09-231-2/+2
| | | | | | | | 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>
* mmc: add missing printk levelsPierre Ossman2007-09-231-2/+3
| | | | | | Some printk:s were missing an explicit level. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
* mmc: read ext_csd version numberPierre Ossman2007-09-231-7/+17
| | | | | | | Make sure we do not try to parse a structure we do not understand. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
* mmc: improve error code feedbackPierre Ossman2007-09-231-8/+19
| | | | | | | Now that we use "normal" error codes, improve the reporting and response to error codes in the core. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
* mmc: remove custom error codesPierre Ossman2007-09-231-18/+18
| | | | | | | Convert the MMC layer to use standard error codes and not its own, incompatible values. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
* mmc: add missing printk levelsPierre Ossman2007-07-261-2/+2
| | | | | | Some printk:s were missing an explicit level. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
* mmc: be more verbose about card insertions/removalPierre Ossman2007-07-261-1/+6
| | | | | | | Let the user know that the kernel actually detected the card by printing some basic information in dmesg. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
* mmc: Don't hold lock when releasing an added cardPierre Ossman2007-07-261-5/+8
| | | | | | | | When the card has been added to the device model, it might be bound to a card driver. Therefore, we have to release the host lock when trying to remove it as we otherwise might deadlock with the driver. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
* mmc: update header file pathsPierre Ossman2007-07-261-1/+1
| | | | | | | Make sure all headers in the files reflect their true position in the tree. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
* mmc: fix silly copy-and-paste errorPierre Ossman2007-07-091-3/+3
| | | | Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
* mmc: refactor bus operationsPierre Ossman2007-07-091-6/+53
| | | | | | | | Move bus operations to its own file for the sake of clarity. Also delegate sysfs attributes to bus handlers in preparation for other more exotic types. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
* mmc: remove old card statesPierre Ossman2007-05-011-8/+14
| | | | | | Remove card states that no longer make any sense. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
* mmc: support unsafe resume of cardsPierre Ossman2007-05-011-97/+192
| | | | | | | | | | | | | | | 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>
* mmc: separate out reading EXT_CSDPierre Ossman2007-05-011-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>
* MMC: Fix handling of low-voltage cardsPhilip Langdale2007-05-011-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* mmc: add bus handlerPierre Ossman2007-05-011-0/+430
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>
OpenPOWER on IntegriCloud