summaryrefslogtreecommitdiffstats
path: root/drivers/mci/pxamci.c
Commit message (Collapse)AuthorAgeFilesLines
* driver: replace dev_request_mem_region with dev_request_mem_resourceSascha Hauer2016-03-071-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_request_mem_region doesn't work properly one some SoCs on which PTR_ERR() values clash with valid return values from dev_request_mem_region. Replace them with dev_request_mem_resource where possible. This patch has been generated with the following semantic patch: // <smpl> @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { ... - return PTR_ERR(io); -} + return PTR_ERR(iores); +} +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) - return PTR_ERR(io); -} + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { - ret = PTR_ERR(io); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { + ret = PTR_ERR(iores); ... } +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ identifier func; @@ func(...) { <+... struct resource *iores; -struct resource *iores; ...+> } // </smpl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-161-0/+3
| | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: rename capabilities flagsSascha Hauer2013-06-031-1/+1
| | | | | | | | | | Use MMC_CAP_ names instead of MMC_MODE_. This makes it more clear that these are capabilities of host/card and do not refer to the current mode. These are in line with the Linux Kernel except for MMC_CAP_MMC_HIGHSPEED_52MHZ which could be fixed later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Use new device_platform_driver() macro for driversAlexander Shiyan2013-02-131-8/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* switch all platform_bus device/driver registering to ↵Jean-Christophe PLAGNIOL-VILLARD2012-10-041-1/+1
| | | | | | | | platform_driver/device_register now register_driver and register_device are for bus only usage. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* mci: pxamci poweron ramp delayRobert Jarzmik2012-04-171-0/+1
| | | | | | | | | | | | As per MMC spec, once power has been applied to an SD card, the card can take as much as 250ms to complete its power-up cycle, and become responsive to CMD0. When this delay was not in place, activating the SD card in the env init failed sometimes. With it, no more failure are observed. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: pxamci fix R1b responsesRobert Jarzmik2012-04-171-2/+6
| | | | | | | | | | | | | The pxamci driver was not waiting for the BUSY line to be deasserted. This was specifically breaking the CMD12 at the end of block multiple writes, when the SD card had not time enough to commit the last write. Fix it by waiting for PRG_DONE bit (which is actually the busy signal end condition). Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: pxamci fix CMD12 handlingRobert Jarzmik2012-04-171-0/+3
| | | | | | | | | | The pxamci requires a bit to be set in the command control register when a CMD12 is sent. Set it, as required in the PXA Developer Manuel, chapter "Stop Data Transmission Command (CMD12 or IO/Abort with CMD52)". Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: pxamci fix response typeRobert Jarzmik2012-04-171-4/+5
| | | | | | | | | When preparing a command, apply a mask so that only the command part will be used for the switch case. This will be more robust for future command response types. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: pxamci change clocks handlingRobert Jarzmik2012-04-171-4/+3
| | | | | | | | | | | Fix clock handling accordingly to PXA manual : - enable the MMC controller clock once and for all - only disable the MMC bus clock when changing the MMCLK by adjusting the clock ratio, else let the controller and SD card shut down the clock as the see fit. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: pxamci define timeoutsRobert Jarzmik2012-04-171-8/+13
| | | | | | | | | Instead of using hard encoded values in the code, use defines to setup the timeouts of reads/writes/commands. Fix the read timeout as defined in the PXA Developer Manual. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: remove unused device argument from set_iosSascha Hauer2012-02-091-2/+1
| | | | | | This argmuent is unused in all drivers, so remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci core: replace discrete ios values with struct iosSascha Hauer2012-02-091-6/+13
| | | | | | | As we'll need more arguments to set_ios over time put them in a struct mci_ios like the kernel does. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers/mci: pxa fix clockrateRobert Jarzmik2012-01-021-5/+9
| | | | | | | | | | | | The clock rate was incorrectly calculated, leading to a frequency of 19.5MHz / 64 instead of 19.5Mz for the host controller. with the fix applied, a copy of a file of 230 kB shrinks from 6000ms to 123ms. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers/mci: pxa read data performance boostRobert Jarzmik2011-12-211-2/+8
| | | | | | | | | | | | | | Increase pxa reading performance by reading 4 bytes at a time instead of 4 reads of 1 byte. As the mci controller FIFO accepts reads on bytes, halfwords or words, use words whenether possible. The boost is for a 250KBytes file read and display (bmp): - before: 6900ms - after: 6000ms Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers/mci: pxa writedata timeoutRobert Jarzmik2011-12-211-1/+1
| | | | | | | | | The write data timeout is too small for old cards, especially the Transcend 256MBytes SD card. Increase it from 10ms to 100ms. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers/mci: add PXA host controllerRobert Jarzmik2011-12-081-0/+359
Add a simple PIO based host controller for MMC and SD cards on PXA SoCs. Reads and writes are available, and no usage is made of DMA or IRQs. SPI mode is not supported yet. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>