summaryrefslogtreecommitdiffstats
path: root/drivers/mci/mxs.c
Commit message (Collapse)AuthorAgeFilesLines
* mci: mxs: add support for dt aliases to name devicesUwe Kleine-König2016-04-121-1/+9
| | | | | | | | While changing there, reformat the comment and use ; instead of , after the previous call. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> 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>
* mci: mxs: Add devicetree supportSascha Hauer2015-01-281-23/+27
| | | | | | | Add device tree compatibles and allow retrieving data from device tree instead of platform_data only. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: remove unnecessary mach/imx-regs.h includeSascha Hauer2015-01-051-1/+0
| | | | | | And replace the ones needed with the SoC specific header. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: mxs-mci: add f_min/f_max fields unconditionallySascha Hauer2014-11-281-2/+0
| | | | | | | Parts of the driver need these regardless of whether CONFIG_MCI_INFO is set, so add these fields unconditionally. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Typoes: "whith" -> "with"Antony Pavlov2014-11-031-1/+1
| | | | | | | | | | | | | | This patch is based on linux kernel commit commit e1b8513d21845fbeb93d6d2c4973db874385059f Author: Robert P. J. Day <rpjday@crashcourse.ca> Date: Sun Feb 3 15:14:02 2008 +0200 Typoes: "whith" -> "with" Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Cc: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 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: mxs: support overwriting the device name via platform dataUwe Kleine-König2013-11-111-0/+1
| | | | | | | | | | | | | The current implementation of the bootloader specification depends on the hardware name and the name of the device in /dev to match. As the default hardware name is mciX and the device name is diskY the bootloader spec cannot be used as is. This patch implements a way to overwrite the device name similar to what is possible for the imx-esdhc driver. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: introduce stmp device supportSascha Hauer2013-07-231-2/+2
| | | | | | | | | | | | MXS specific devices have some common infrastructure in the kernel known as STMP devices. We have the same in barebox, but with a mxs_ prefix instead of a stmp_ prefix. As some STMP devices are also found on i.MX6 move the common infrastructure out of MXS specific files and use the stmp_ prefix. This is done in preparation for i.MX6 NAND support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: mxs: use common clk APISascha Hauer2013-06-201-41/+19
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: mxs: Use dev_*Sascha Hauer2013-06-201-17/+20
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: Attach info callback to device, not to driverSascha Hauer2013-05-301-9/+5
| | | | | | | | 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/MXS: fix signed/unsigned mismatchJuergen Beisert2013-05-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the MXS MCI driver with an eight bit capable eMMC results into the 'devinfo' message the interface uses '0' bits for data transfer: barebox:/ devinfo mxs_mci0 resources: num : 0 start : 0x80034000 size : 0x00002000 driver: mxs_mci bus: platform Interface Min. bus clock: 1476 Hz Max. bus clock: 48000000 Hz Current bus clock: 24000000 Hz Bus width: 0 bit The eight bit interface width is stored internally as value '2'. And a two bit '2' ends up into 0xfffffffe when used as an array index. Using an unsigned field instead fixes this issue: barebox:/ devinfo mxs_mci0 resources: num : 0 start : 0x80034000 size : 0x00002000 driver: mxs_mci bus: platform Interface Min. bus clock: 1476 Hz Max. bus clock: 48000000 Hz Current bus clock: 24000000 Hz Bus width: 8 bit Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mxs'Sascha Hauer2013-05-061-14/+2
|\
| * MXS/MCI: simplify reset of the MCI device blockJuergen Beisert2013-04-271-14/+2
| | | | | | | | | | | | | | | | Since a generic block reset function is a available, also the MCI driver should make use of it. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mci'Sascha Hauer2013-05-061-2/+2
|\ \
| * | MCI/MXS: report a better matching error code when the transfer failsJuergen Beisert2013-04-271-2/+2
| |/ | | | | | | | | | | | | EIO is a better error message to describe the data transfer to or from the SD cards has failed. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / MXS/MCI: don't touch variables in the host structureJuergen Beisert2013-04-261-5/+5
|/ | | | | | | | | | MMC_BUS_WIDTH_* macros do not correspond with the real bus width. After setting a bus width larger than 1 bit the next call to change the frequency ends in the default handler and the host interface stays silently at the previous frequency. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mxs'Sascha Hauer2013-03-041-117/+1
|\
| * ARM mxs: ssp move to common register layoutMichael Grzeschik2013-02-111-117/+1
| | | | | | | | | | | | | | | | | | This patch moves the register defines and bit definitions into one include file. As the defines are common for ssp and mci devices they can be shared. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> 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>
* treewide: fix format specifiersSascha Hauer2013-01-271-1/+1
| | | | 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>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-4/+0
| | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. 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/+8
| | | | | | | 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>
* mci mxs: do not use external define for internal useSascha Hauer2012-02-091-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'next'Sascha Hauer2011-10-091-1/+1
|\
| * 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>
* | mci: mxs: fix 'use resources' conversionWolfram Sang2011-09-141-1/+1
|/ | | | | | | | Commit 4c542622 used the wrong variable name and caused a build failure. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci mxs: fix line endingsSascha Hauer2011-08-151-3/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: switch to "struct resource"Jean-Christophe PLAGNIOL-VILLARD2011-07-231-2/+2
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* mci mxs: no need to call mxs_mci_setup_clock_speed in initSascha Hauer2011-03-081-3/+2
| | | | | | | It will be called by set_ios anyway later. Also, do not alter host->clock field, this is none of our business. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci mxs: make the mci_host a member of mxs_mci_hostSascha Hauer2011-03-081-98/+98
| | | | | | | | | This allows for more type safety. passing a struct device_d internally in the driver is not a good idea. Also, this patch adds a void __iomem *regs to mxs_mci_host. dev->map_base should not be used for register accesses. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci mxs: rename mci_pdata to hostSascha Hauer2011-03-081-8/+6
| | | | | | | struct mci_host is named host in the rest of the driver, so name it like this consistently. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci mxs: give functions a uniq mxs_mci_ namespaceSascha Hauer2011-03-081-61/+61
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci mxs: put only once used function inlineSascha Hauer2011-03-081-19/+8
| | | | | | Also, rename mci_rename after the callback it implements: stm_mci_initialize. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci i.MX23/28: rename driver to mxs.cSascha Hauer2011-03-081-0/+787
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>