summaryrefslogtreecommitdiff
path: root/drivers/ata/ahci_st.c
AgeCommit message (Collapse)AuthorFilesLines
2023-05-15ata: libata: Make ata_platform_remove_one return voidUwe Kleine-König1-1/+1
The function returned zero unconditionally, so the function returning an int is something between useless and irritating. With the goal to make platform drivers' remove function return void, it's helpful to convert the function accordingly. This converts several drivers to the new .remove_new callback that was introduced to smoothen the platform driver conversion. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Acked-by: Serge Semin <fancer.lancer@gmail.com> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
2023-03-25scsi: ata: Declare SCSI host templates constBart Van Assche1-1/+1
Make it explicit that ATA host templates are not modified. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Reviewed-by: Serge Semin <fancer.lancer@gmail.com> (for DWC AHCI SATA) Reviewed-by: John Garry <john.g.garry@oracle.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> (for Tegra) Cc: Christoph Hellwig <hch@lst.de> Cc: Ming Lei <ming.lei@redhat.com> Cc: Hannes Reinecke <hare@suse.de> Cc: John Garry <john.g.garry@oracle.com> Cc: Mike Christie <michael.christie@oracle.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230322195515.1267197-5-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2022-10-17ata: ahci_st: Fix compilation warningDamien Le Moal1-1/+1
If CONFIG_OF is disabled and the ahci_st driver is builtin (or CONFIG_MODULES is disabled), then using the macro of_match_ptr() results in the st_ahci_match variable being unused, which generates a compilation warning and a compilation error if CONFIG_WERROR is enabled. Fix this by directly assigning st_ahci_match to .of_match_table in the st_ahci_driver platform driver definition. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
2022-09-20ata: ahci_st: Fix compilation warningDamien Le Moal1-1/+0
Remove the unused variable dev in st_ahci_probe() to avoid compilation warning and build failures where CONFIG_WERROR is enabled. Fixes: 3f74cd046fbe ("ata: libahci_platform: Parse ports-implemented property in resources getter") Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2022-09-16ata: libahci_platform: Parse ports-implemented property in resources getterSerge Semin1-3/+0
The ports-implemented property is mainly used on the OF-based platforms with no ports mapping initialized by a bootloader/BIOS firmware. Seeing the same of_property_read_u32()-based pattern has already been implemented in the generic AHCI LLDD (glue) driver and in the Mediatek, St AHCI drivers let's move the property read procedure to the generic ahci_platform_get_resources() method. Thus we'll have the forced ports mapping feature supported for each OF-based platform which requires that, and stop re-implementing the same pattern in there a bit simplifying the code. Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2022-03-07ata: Drop commas after OF match table sentinelsGeert Uytterhoeven1-1/+1
It does not make sense to have a comma after a sentinel, as any new elements must be added before the sentinel. Add comments to clarify the purpose of the empty elements. Rewrap entries to a single line to have a consistent style. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru> Acked-by: Florian Fainelli <f.fainelli@gmail.com> [ahci_brcm] Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner1-4/+1
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-22ata: add an extra argument to ahci_platform_get_resources()Kunihiko Hayashi1-1/+1
Add an extra argument to ahci_platform_get_resources(), that is for the bitmap representing the resource to get in this function. Currently there is no resources to be defined, so all the callers set '0' to the argument. Suggested-by: Hans de Goede <hdegoede@redhat.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Matthias Brugger <matthias.bgg@gmail.com> Cc: Patrice Chotard <patrice.chotard@st.com> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2016-08-10ahci: st: Add ports-implemented property in supportPatrice Chotard1-0/+4
Despite ST AHCI version = 1.3, reading HOST_PORTS_IMPL returns 0. So force_port_map to 1 by using ports-implemented DT property. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2015-04-20ata: ahci_st: fixup layering violations / drvdata errorsPeter Griffin1-25/+24
Brian noticed while working on another SATA driver that uses libahci_platform, an error in this driver; it tries to the the driver data for its device, while libata also thinks it can set the driver data. See: ahci_platform_init_host() -> ata_host_alloc_pinfo() -> ata_host_alloc() -> dev_set_drvdata() So instead of sticking the IP-specific platform data into drvdata, let's use the plat_data variable that is reserved for this use. Addtionally plat_data isn't set until ahci_platform_init_host() has been called further down in probe(). So re-work the st_ahci_probe_resets and st_ahci_deassert_resets functions to take ahci_host_priv *hpriv as a parameter. Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Suggested-by: Brian Norris <computersforpeace@gmail.com> Cc: Srinivas Kandagatla <srinivas.kandagatla@gmail.com> Cc: Maxime Coquelin <maxime.coquelin@st.com> Cc: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2015-04-01ahci: st: st_configure_oob must be called after IP is clocked.Peter Griffin1-2/+4
Currently the ahci_st driver will hang the system on probe, as the st_configure_oob function does some register writes before the IP is clocked. This patch moves the function call to after ahci_platform_enable_resources (which enables the IP clock), and resolves the hang. Addtionally st_ahci_configure_oob should be called in the st_ahci_resume function, so we also rectify that ensuring it is also called after the IP clock has been enabled. Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Maxime Coquelin <maxime.coquelin@st.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2015-01-29ata: ahci_platform: fix owner module reference mismatch for scsi hostAkinobu Mita1-2/+9
The owner module reference of the ahci platform's scsi_host is initialized to libahci_platform's one, because these drivers use a scsi_host_template defined in libahci_platform. So these drivers can be unloaded even if the scsi device is being accessed. This fixes it by pushing the scsi_host_template from libahci_platform to all leaf drivers. The scsi_host_template is passed through a new argument of ahci_platform_init_host(). Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Christoph Hellwig <hch@lst.de> Cc: "James E.J. Bottomley" <JBottomley@parallels.com> Cc: linux-ide@vger.kernel.org Cc: linux-scsi@vger.kernel.org
2014-10-20ata: drop owner assignment from platform_driversWolfram Sang1-1/+0
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-07-30ata: libahci_platform: move port_map parameters into the AHCI structureAntoine Ténart1-1/+1
This patch moves force_port_map and mask_port_map into the ahci_host_priv structure. This allows to modify them into the AHCI framework. This is needed by the new dt bindings representing ports as the port_map mask is computed automatically. Parameters modifying force_port_map, mask_port_map and flags have been removed from the ahci_platform_init_host() function, and inputs in the ahci_host_priv structure are now directly filed. Signed-off-by: Antoine Ténart <antoine.tenart@free-electrons.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2014-07-22ahci: st: Make of_device_id array constKiran Padwal1-1/+1
Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Kiran Padwal <kiran.padwal21@gmail.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Tejun Heo <tj@kernel.org>
2014-05-14libahci_platform: add host_flags parameter in ahci_platform_init_host()Kefeng Wang1-1/+1
Add a dynamic host_flags argument to make ahci_platform_init_host more flexible, then remove the AHCI_HFLAGS(...) argument from some driver's ata_port_info, and pass that in as the new argument. Cc: Hans de Geode <hdegoede@redhat.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Kefeng Wang <kefeng.wang@linaro.org> Signed-off-by: Tejun Heo <tj@kernel.org>
2014-03-14ata: ahci_st: remove deprecated struct ahci_platform_data usageBartlomiej Zolnierkiewicz1-11/+9
struct ahci_platform_data is deprecated (please see comments in <linux/ahci_platform.h> for details). Convert ahci_st driver to use custom ->host_stop method instead. Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2014-03-14ata: ahci_st: build fixesBartlomiej Zolnierkiewicz1-7/+5
* The config option for ahci_st driver was renamed from CONFIG_SATA_AHCI_ST to CONFIG_AHCI_ST but Makefile was not updated. Fix it (also while at it move the ahci_st driver entry below ahci_imx and ahci_sunxi ones). * Fix a few build issues in the ahci_st driver itself. Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2014-03-14ahci: st: Invoke AHCI Platform Suspend/ResumeLee Jones1-1/+5
This is where we disable IRQs on suspend and update the internal power state during suspend/resume. Suggested-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Tejun Heo <tj@kernel.org>
2014-03-14ahci: st: Utilise ata_platform_remove_one() callLee Jones1-18/+26
ata_platform_remove_one() allows us to specify our own exit function via platform data then goes off and removes ATA Host and Port in preparation for device removal. Suggested-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Tejun Heo <tj@kernel.org>
2014-03-14ahci: st: Remove legacy dependencies on PHYLee Jones1-2/+0
Suggested-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Tejun Heo <tj@kernel.org>
2014-03-14ahci: st: Standardise naming conventionsLee Jones1-1/+1
Other devices have adopted similar naming conventions which have been accepted as the standard. This patch brings any mention of the the ST AHCI driver into line with them. Suggested-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Tejun Heo <tj@kernel.org>
2014-03-14ahci: st: Add support for ST's SATA IPLee Jones1-0/+239
Acked-by: Alexandre Torgue <alexandre.torgue@st.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Tejun Heo <tj@kernel.org>