summaryrefslogtreecommitdiff
path: root/drivers/ata/pata_imx.c
AgeCommit message (Collapse)Author
2018-08-24Merge branch 'for-4.19' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata Pull libata updates from Tejun Heo: "Nothing too interesting. Mostly ahci and ahci_platform changes, many around power management" * 'for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: (22 commits) ata: ahci_platform: enable to get and control reset ata: libahci_platform: add reset control support ata: add an extra argument to ahci_platform_get_resources() ata: sata_rcar: Add r8a77965 support ata: sata_rcar: exclude setting of PHY registers in Gen3 ata: sata_rcar: really mask all interrupts on Gen2 and later Revert "ata: ahci_platform: allow disabling of hotplug to save power" ata: libahci: Allow reconfigure of DEVSLP register ata: libahci: Correct setting of DEVSLP register ata: ahci: Enable DEVSLP by default on x86 with SLP_S0 ata: ahci: Support state with min power but Partial low power state Revert "ata: ahci_platform: convert kcalloc to devm_kcalloc" ata: sata_rcar: Add rudimentary Runtime PM support ata: sata_rcar: Provide a short-hand for &pdev->dev ata: Only output sg element mapped number in verbose debug ata: Guard ata_scsi_dump_cdb() by ATA_VERBOSE_DEBUG ata: ahci_platform: convert kcalloc to devm_kcalloc ata: ahci_platform: convert kzallloc to kcalloc ata: ahci_platform: correct parameter documentation for ahci_platform_shutdown libata: remove ata_sff_data_xfer_noirq() ...
2018-07-11libata: remove ata_sff_data_xfer_noirq()Sebastian Andrzej Siewior
ata_sff_data_xfer_noirq() is invoked via the ->sff_data_xfer hook. The latter is invoked by ata_pio_sector(), atapi_send_cdb() and __atapi_pio_bytes() which in turn is invoked by ata_sff_hsm_move(). The latter function requires that the "ap->lock" lock is held which needs to be taken with disabled interrupts. There is no need have to have ata_sff_data_xfer_noirq() which invokes ata_sff_data_xfer32() with disabled interrupts because at this point the interrupts are already disabled. Remove the function and its references to it and replace all callers with ata_sff_data_xfer32(). Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Tejun Heo <tj@kernel.org>
2018-07-07headers: separate linux/mod_devicetable.h from linux/platform_device.hRandy Dunlap
At over 4000 #includes, <linux/platform_device.h> is the 9th most #included header file in the Linux kernel. It does not need <linux/mod_devicetable.h>, so drop that header and explicitly add <linux/mod_devicetable.h> to source files that need it. 4146 #include <linux/platform_device.h> After this patch, there are 225 files that use <linux/mod_devicetable.h>, for a reduction of around 3900 times that <linux/mod_devicetable.h> does not have to be read & parsed. 225 #include <linux/mod_devicetable.h> This patch was build-tested on 20 different arch-es. It also makes these drivers SubmitChecklist#1 compliant. Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Reported-by: kbuild test robot <lkp@intel.com> # drivers/media/platform/vimc/ Reported-by: kbuild test robot <lkp@intel.com> # drivers/pinctrl/pinctrl-u300.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-09pata: imx: support controller modes up to PIO4Vladimir Zapolskiy
Having timing settings for all supported by the controller PIO modes now it is possible to expand its PIO mask. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2016-11-09pata: imx: add support of setting timings for PIO modesVladimir Zapolskiy
The controller is capable to operate in up to PIO4 mode, however before the change the driver relies on timing settings done by a bootloader for PIO0 mode only. The change adds more flexibility in PIO mode selection at runtime and makes the driver to work even if bootloader does not preset ATA timings. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2016-11-09pata: imx: set controller PIO mode with .set_piomode callbackVladimir Zapolskiy
Convert .set_mode callback function to more specific .set_piomode, the driver does not have support of DMA modes, thus a simpler version of the callback is preferred. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2016-11-09pata: imx: sort headers outVladimir Zapolskiy
Put headers in alphabetic order and remove redundant ones. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2014-10-20ata: drop owner assignment from platform_driversWolfram Sang
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-10-04ata: pata_imx: Use the SIMPLE_DEV_PM_OPS() macroFabio Estevam
Using the SIMPLE_DEV_PM_OPS() macro can make the code shorter and cleaner. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2014-05-09ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host driversBartlomiej Zolnierkiewicz
This patch fixes host drivers to use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable. Benefits of this change: * unused code is not being compiled in for CONFIG_PM=y, CONFIG_PM_SLEEP=n and CONFIG_PM_RUNTIME=y configurations * easier transition to use struct dev_pm_ops and SIMPLE_DEV_PM_OPS() in the future * more consistent code (there are host drivers which are using the correct CONFIG_PM_SLEEP checks already) The patch leaves the core libata code and ->port_[suspend,resume] support in sata_[inic162x,nv,sil24].c alone for now. Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2014-03-31Merge branch 'for-3.15' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata Pull libata updates from Tejun Heo: "A lot of activities on libata side this time. - A lot of changes around ahci. Various embedded platforms are implementing ahci controllers. Some were built atop ahci_platform, others were doing their own things. Hans made some structural changes to libahci and librarized ahci_platform so that ahci platform drivers can share more common code. A couple platform drivers are added on top of that and several are added to replace older drivers which were doing their own things (older ones are scheduled to be removed). - Dan finishes the patchset to make libata PM operations asynchronous. Combined with one patch being routed through scsi, this should speed resume measurably. - Various fixes and cleanups from Bartlomiej and others" * 'for-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: (61 commits) ata: fix Marvell SATA driver dependencies ata: fix ARASAN CompactFlash PATA driver dependencies ata: remove superfluous casts ata: sata_highbank: remove superfluous cast ata: fix Calxeda Highbank SATA driver dependencies ata: fix R-Car SATA driver dependencies ARM: davinci: da850: update SATA AHCI support ata: add new-style AHCI platform driver for DaVinci DA850 AHCI controller ata: move library code from ahci_platform.c to libahci_platform.c ata: ahci_platform: fix ahci_platform_data->suspend method handling libata: remove unused ata_sas_port_async_resume() stub libata.h: add stub for ata_sas_port_resume libata: async resume libata, libsas: kill pm_result and related cleanup ata: Fix compiler warning with APM X-Gene host controller driver arm64: Add APM X-Gene SoC AHCI SATA host controller DTS entries ata: Add APM X-Gene SoC AHCI SATA host controller driver Documentation: Add documentation for the APM X-Gene SoC SATA host controller DTS binding arm64: Add APM X-Gene SoC 15Gbps Multi-purpose PHY DTS entries ata: ahci_sunxi: fix code formatting ...
2014-03-14ata: pata_imx: fix devm_ioremap_resource() return value checkingBartlomiej Zolnierkiewicz
devm_ioremap_resource() returns a pointer to the remapped memory or an ERR_PTR() encoded error code on failure. Fix the check inside pata_imx_probe() accordingly. Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2014-02-18pata_imx: Propagate the real error code on platform_get_irq() failureFabio Estevam
No need to return a 'fake' return value on platform_get_irq() failure. Just return the error code itself instead. Also, change the error condition to irq < 0, so that only negative values are treated as errors. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2014-02-18pata_imx: Use devm_ioremap_resource() to simplify codeFabio Estevam
Using devm_ioremap_resource() can lead to code simplication, as we don't need to explicitily check for error returned by platform_get_resource(). Also, no need to print an error message when devm_ioremap_resource() fails, as the OOM code code will shout loudly on such condition. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2014-02-13ata: delete non-required instances of include <linux/init.h>Paul Gortmaker
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Cc: linux-ide@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2014-01-29ata: pata_imx: Check the return value from clk_prepare_enable()Fabio Estevam
clk_prepare_enable() may fail, so let's check its return value and propagate it in the case of error. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2013-07-29pata_imx: expose module alias for loading from device-treeNiels de Vos
Enable auto loading by udev when pata_imx is compiled as a module. Signed-off-by: Niels de Vos <ndevos@redhat.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Tejun Heo <tj@kernel.org>
2013-05-24ata: use platform_{get,set}_drvdata()Jingoo Han
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev, so we can directly pass a struct platform_device. Also, unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2013-04-11pata_imx: add devicetree supportSascha Hauer
Not much to do here, only the compatible entries have to be added. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2013-04-11pata_imx: use void __iomem * for regsSascha Hauer
regs is returned from ioremap, so add a __iomem. Also, make it void * instead of u8 *. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2013-04-11pata_imx: cleanup error pathSascha Hauer
- rename free_priv label to 'err' since priv is allocated with devm_* and not freed here. - add missing 'goto err' in case ata_host_activate fails - add 'ret' variable to return correct error value instead of hardcoded -ENOMEM in error case. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2013-04-11pata_imx: Use devm_clk_getSascha Hauer
To make the error path a bit simpler. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2013-01-03Drivers: ata: remove __dev* attributes.Greg Kroah-Hartman
CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, __devinitdata, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: Jeff Garzik <jgarzik@pobox.com> Cc: Viresh Kumar <viresh.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-12-14pata_imx: convert ata_dev_printk() to ata_dev_info()Wei Yongjun
Using ata_dev_info() instead of ata_dev_printk(). Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-07-25pata_imx: Convert to clk_prepare_enable/clk_disable_unprepareFabio Estevam
With the new i.mx clock framework, we need to use clk_prepare_enable/clk_disable_unprepare. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-01-08SATA/PATA: convert drivers/ata/* to use module_platform_driver()Axel Lin
This patch converts the drivers in drivers/ata/* to use the module_platform_driver() macro which makes the code smaller and a bit simpler. Cc: Viresh Kumar <viresh.kumar@st.com> Cc: Jeff Garzik <jgarzik@pobox.com> Cc: Arnaud Patard <arnaud.patard@rtp-net.org> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Sylvain Munaut <tnt@246tNt.com> Cc: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Florian Fainelli <florian@openwrt.org> Cc: Mark Miesfeld <mmiesfeld@amcc.com> Cc: Ashish Kalra <ashish.kalra@freescale.com> Cc: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2011-08-18ata: Add iMX pata supportArnaud Patard (Rtp)
Add basic support for pata on iMX. It has been tested only on imx51. SDMA support will probably be added later so this version supports only PIO. v2: - enable only when needed IORDY - use dev_get_drvdata v3: - add missing clk_put() calls - use platform_get_irq() - fix resume code to avoid disabling IORDY on resume v4: - Remove EXPERIMENTAL and switch to depends on ARCH_MXC - Use devm_kzalloc() - make clock a must-have - Use only 1 ioremap Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>