summaryrefslogtreecommitdiffstats
path: root/drivers/mci/omap_hsmmc.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/mmc'Sascha Hauer2019-01-151-6/+0
|\
| * mci: omap_hsmmc: Drop explicit devname setup codeAndrey Smirnov2018-12-101-6/+0
| | | | | | | | | | | | | | | | Drop explicit devname setup code. Same setup will be done by mci_of_parse(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: omap: use IS_ENABLED() rather than #ifdefSascha Hauer2018-12-141-9/+12
| | | | | | | | | | | | | | While touching it propagate the errors from read/write functions instead of silently ignoring them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: omap: Improve error handlingSascha Hauer2018-12-141-5/+11
|/ | | | | | | | Return proper error code from read/write functions rather than '1'. Also add messages printing the status register to give a glue what went wrong. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: omap: Add devicetree options parsing by MCI core.Alexander Shiyan2017-01-101-0/+2
| | | | | | | | This patch adds a callback to parsing devicetree options for MMC: bus-width, etc.. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> 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>
* of: use 'const void *' for struct of_device_id.dataAntony Pavlov2015-04-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 2011 barebox' of_device_id struct uses unsigned long type for data field: struct of_device_id { char *compatible; unsigned long data; }; Almost always struct of_device_id.data field are used as pointer and need 'unsigned long' casting. E.g. see 'git grep -A 4 of_device_id drivers/' output: drivers/ata/sata-imx.c:static __maybe_unused struct of_device_id imx_sata_dt_ids[] = { drivers/ata/sata-imx.c- { drivers/ata/sata-imx.c- .compatible = "fsl,imx6q-ahci", drivers/ata/sata-imx.c- .data = (unsigned long)&data_imx6, drivers/ata/sata-imx.c- }, { Here is of_device_id struct in linux kernel v4.0: struct of_device_id { char name[32]; char type[32]; char compatible[128]; const void *data; }; Changing of_device_id.data type to 'const void *data' will increase barebox' linux kernel compatibility and decrease number of 'unsigned long' casts. Part of the patch was done using the 'coccinelle' tool with the following semantic patch: @rule1@ identifier dev; identifier type; identifier func; @@ func(...) { <... - dev_get_drvdata(dev, (unsigned long *)&type) + dev_get_drvdata(dev, (const void **)&type) ...> } @rule2@ identifier dev; identifier type; identifier func; identifier data; @@ func(...) { <... - dev_get_drvdata(dev, (unsigned long *)&type->data) + dev_get_drvdata(dev, (const void **)&type->data) ...> } Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> 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>
* Merge branch 'for-next/omap-drivers'Sascha Hauer2013-12-061-0/+13
|\
| * mmc: omap: Add devicetree supportSascha Hauer2013-11-271-0/+13
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mmc: omap: name mmc device after devicetree aliasSascha Hauer2013-11-251-0/+6
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: omap: Fix default value of mci.f_maxTeresa Gámez2013-10-021-3/+1
| | | | | | | | | | | With commit c2ef47887 mci.f_max default value is only set when pdata is available. Fix this with always setting the mci.f_max default value and overrite it when pdata available. Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: omap: Allow to set mmc devname via platformdataSascha Hauer2013-08-271-4/+10
| | | | | | To be able to get persistent names for the sd/mmc devices. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: omap: implement device detect callbackSascha Hauer2013-08-271-0/+10
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: omap: advertise 8 bit supportSascha Hauer2013-08-271-1/+1
| | | | | | | The driver is already capable of 8 bit buswidth support, so advertise it to actually make use of it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: rename capabilities flagsSascha Hauer2013-06-031-1/+2
| | | | | | | | | | 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>
* mfd: Using MFD_xx prefix for symbolsAlexander Shiyan2013-02-181-2/+2
| | | | | | | | This patch provides rename MFD-related symbols for using MFD-prefix. Additionally, sorting mfd/Kconfig and mfd/Makefile records. 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-8/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM omap / mci: Fix register offsetsSascha Hauer2013-01-081-1/+33
| | | | | | | | Only the OMAP4 has a register offset of 0x100 in the register space. Fix this by using the device id mechanism. This became broken when the device register convenience functions were introduced. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci omap_hsmmc: Fix whitespacesSascha Hauer2013-01-071-5/+4
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM omap hsmmc: Fix register offsetSascha Hauer2012-12-191-1/+3
| | | | | | | | | The hsmmc module has a 0x100 offset in its register space. The real register space size for the module is 4K, so when we register the device with the size 4k, we have to account for the offset in the driver, not in the resource allocation. 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>
* Merge branch 'for-next/remove-fsf-address'Sascha Hauer2012-10-031-4/+0
|\ | | | | | | | | | | Conflicts: drivers/net/miidev.c include/miidev.h
| * 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>
* | mmc_omap: improve error messagevicencb@gmail.com2012-10-021-1/+1
|/ | | | 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-9/+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>
* omap_hsmmc: setup mmc voltage on twl6030Alexander Aring2011-12-211-0/+17
| | | | | | | | Support the setup of the mmc voltage, when booting OMAP4 with twl6030 from nand. Signed-off-by: Alexander Aring <a.aring@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci omap: do not fail on nonexistent pdataSascha Hauer2011-10-131-1/+1
| | | | 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>
* Add omap_hsmmc platform data.Juergen Kilb2011-09-121-1/+9
| | | | | | | | Add platform data to specify maximum frequency of hsmmc interface which can be restricted due to external level shifters. Signed-off-by: Juergen Kilb <J.Kilb@phytec.de> 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>
* mci: switch to "struct resource"Jean-Christophe PLAGNIOL-VILLARD2011-07-231-1/+1
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* mci omap: make write support optionalSascha Hauer2011-04-121-1/+4
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci omap: rename functions from mxc to omapSascha Hauer2011-04-121-6/+6
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: Add omap hsmmc driverSascha Hauer2011-04-041-0/+582
This driver is based on the U-Boot omap hsmmc driver by Sukumar Ghorai <s-ghorai@ti.com>. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>