summaryrefslogtreecommitdiffstats
path: root/drivers/mci/atmel_mci.c
Commit message (Collapse)AuthorAgeFilesLines
* mci: atmel_mci: fix devinfo DEV with OF enabledSam Ravnborg2017-07-201-2/+1
| | | | | | | | | | devinfo DEV resulted in a NULL pointer expection. As platform_data is only valid in non-DT setup, fix this so we no longer reference platform_data outside the probe function Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* mci: atmel_mci: Add DT supportAndrey Smirnov2017-03-301-31/+70
| | | | | | Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 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>
* Merge branch 'for-next/resource-err-ptr'Sascha Hauer2014-10-021-0/+2
|\
| * resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-161-0/+2
| | | | | | | | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: atmel: add new ip version 0x600 supportBo Shen2014-09-221-0/+1
|/ | | | | Signed-off-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* atmel_mci: add devname pdata supportJean-Christophe PLAGNIOL-VILLARD2013-09-181-0/+1
| | | | | | | so we can specify the devname in the board Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: rename capabilities flagsSascha Hauer2013-06-031-3/+3
| | | | | | | | | | 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>
* driver: Attach info callback to device, not to driverSascha Hauer2013-05-301-5/+3
| | | | | | | | Since the info is device specific and not driver specific, attach the callback to the device. This makes it possible to have a info callback for a device which does not have a driver attached. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MCI: atmel: Fix possible null pointer dereferenceAlexander Shiyan2013-04-301-1/+3
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Use new device_platform_driver() macro for driversAlexander Shiyan2013-02-131-7/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mci'Sascha Hauer2013-02-041-6/+14
|\ | | | | | | | | Conflicts: drivers/mci/atmel_mci.c
| * mci atmel: implement card_present callbackSascha Hauer2013-01-201-6/+15
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | atmel_mci: gpio: request and configure card detectJean-Christophe PLAGNIOL-VILLARD2013-01-251-2/+25
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | atmel_mci: drop board host capsJean-Christophe PLAGNIOL-VILLARD2013-01-251-1/+0
| | | | | | | | | | | | | | as it's handle by detecting the IP version and bus with Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | atmel_mci: update the SD/SDIO Card Register at request timeJean-Christophe PLAGNIOL-VILLARD2013-01-251-5/+11
| | | | | | | | | | | | | | as we need to reset the IP Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | atmel_mci: support the SD highspeed since IP version 0x300Jean-Christophe PLAGNIOL-VILLARD2013-01-251-0/+24
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | atmel_mci: after a software timeout the IP need to be resetJean-Christophe PLAGNIOL-VILLARD2013-01-251-1/+4
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | atmel_mci: on version 0x0 we need to reset the IP at each requestJean-Christophe PLAGNIOL-VILLARD2013-01-251-0/+10
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | atmel_mci: rwproof is only needed up to IP version 0x200Jean-Christophe PLAGNIOL-VILLARD2013-01-251-1/+9
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | atmel_mci: fix host initJean-Christophe PLAGNIOL-VILLARD2013-01-251-8/+6
| | | | | | | | | | | | | | | | disable interrupt and reset the IP at the probe set timout at the host init Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | atmel_mci: version 0x5xx of the IP have a different clk divJean-Christophe PLAGNIOL-VILLARD2013-01-251-18/+47
| | | | | | | | | | | | | | so detect and support it Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | atmel_mci: detect IP versionJean-Christophe PLAGNIOL-VILLARD2013-01-251-0/+32
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | atmel_mci: use linux regs defineJean-Christophe PLAGNIOL-VILLARD2013-01-251-66/+55
| | | | | | | | | | | | | | to simplify sync and share code Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | atmel_mci: rename all function to start with atmciJean-Christophe PLAGNIOL-VILLARD2013-01-251-47/+46
| | | | | | | | | | | | | | | | to be consistent and have a unique naming convention be in sync with the kernel too Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | atmel_mci: rename atmel_mci_readl/writel to atmci_readl/writelJean-Christophe PLAGNIOL-VILLARD2013-01-251-22/+21
| | | | | | | | | | | | | | | | to be consistent with the kernel This also reduce the ligne length Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | atmel_mci: rename atmel_mci_host tp atmel_mciJean-Christophe PLAGNIOL-VILLARD2013-01-251-21/+21
|/ | | | | | | to be consistent with the kernel Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> 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: 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-8/+10
| | | | | | | 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>
* atmel/mci: fix slot_b supportJean-Christophe PLAGNIOL-VILLARD2012-01-161-1/+3
| | | | | | | | | | | | | | in commit commit f60f6c58e atmel_mci: check for device id we use to address the right slot the driver use the dev_id to detect the slot which is wrong on 9263 as we have 2 devices with 2 slots use slot_b paramter to specify the slot as done in linux Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Cc: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* atmel_mci: check for device id we use to address the right slotMichael Grzeschik2011-12-071-0/+2
| | | | | | | | We have to check which sd card slot we use. The registered mmc_id is the the correct parameter for this. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce io.hSascha Hauer2011-09-221-1/+1
| | | | | | | To allow for some generic io accessors introduce io.h and use this instead of asm/io.h throughout the tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* atmel_mci: handle clk_get error correctlyHubert Feurstein2011-09-121-2/+3
| | | | | | Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: parent fixupsSascha Hauer2011-08-171-0/+1
| | | | | | | Make the mci host a child of the hardware device and the disk a child of the mci host. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* atmel/drivers: switch to dev_request_mem_regionJean-Christophe PLAGNIOL-VILLARD2011-07-201-1/+1
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* atmel_mci: switch to "struct resource"Jean-Christophe PLAGNIOL-VILLARD2011-07-181-1/+1
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* atmel-mci: fix initialization of 8bit-bus-width-mode for at91sam9g45Hubert Feurstein2011-06-221-2/+2
| | | | | | | | | When the bus_width was set to 8, then only one data-line has been initialized. Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* atmel-mci: fix wrong pointer castHubert Feurstein2011-06-221-1/+1
| | | | | Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: add Atmel AT91 MCI driverHubert Feurstein2011-06-161-0/+494
The driver supports push and pull transfers. Tested on at91sam9m10 SoC. Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>