aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ahci_platform.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-06-17ahci: sata: add support for exynos5440 sataGirish K S1-0/+1
This patch adds the compatible string of the exynos5440 sata controller compliant with the ahci 1.3 and sata 3.0 specification. changes in v2: changed the compatible string by adding the actual IP owners name instead of the SoC vendor name. Signed-off-by: Girish K S <ks.giri@samsung.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2013-01-03Drivers: ata: remove __dev* attributes.Greg Kroah-Hartman1-1/+1
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-14ahci_platform: make structs staticBrian Norris1-3/+3
These structs are used only for ahci_platform.c, so they should be static. Thanks to Fengguang for the (automated) suggestion. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Cc: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-12-03ahci_platform: utilize common ata_platform_remove_one()Brian Norris1-11/+1
Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-12-03ahci_platform: perform platform exit in host_stop() hookBrian Norris1-7/+23
AHCI platform devices may provide an exit() routine, via ahci_platform_data, that powers off the SATA core. Such a routine should be executed from the ata_port_operations host_stop() hook. That way, the ATA subsystem can perform any last-minute hardware cleanup (via devres, for example), then trigger the power-off at the appropriate time. This patch fixes bus errors triggered during module removal or device unbinding, seen on an SoC SATA core. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-12-03ahci_platform: convert to module_platform_driverBrian Norris1-12/+1
The ahci_platform driver can now use the module_platform_driver() macro. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-12-03ahci_platform: enable hotplug unbindingBrian Norris1-2/+3
platform_driver_probe() should be used for registering this driver only if we want to "...remove its run-once probe() infrastructure from memory after the driver has bound to the device." However, we may want to leave the probe infrastructure in place in order to support binding/unbinding a device dynamically. This is useful, for instance, as a power management mechanism, where a device can be totally powered down when unbound (whereas with runtime power management, powering down the SATA core would incur unacceptable loss of functionality). Thus, convert this driver to use platform_driver_register(). Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-11-16[libata] PM callbacks should be conditionally compiled on CONFIG_PM_SLEEPYuanhan Liu1-1/+1
This will fix warnings like following when CONFIG_PM_SLEEP is not set: warning: 'xxx_suspend' defined but not used [-Wunused-function] warning: 'xxx_resume' defined but not used [-Wunused-function] Because SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) Only references the callbacks on CONFIG_PM_SLEEP (instead of CONFIG_PM). Cc: Viresh Kumar <viresh.linux@gmail.com> Cc: linux-ide@vger.kernel.org Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-09-13ata/ahci_platform: Add clock framework supportViresh Kumar1-7/+50
On many architectures, drivers are supposed to prepare/unprepare & enable/disable functional clock of device. This patch adds clock support for ahci_platform. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-09-13ata: add platform driver for Calxeda AHCI controllerMark Langsdorf1-1/+0
Calxeda highbank SATA phy has intermittent problems bringing up a link with Gen3 drives. Retrying the phy hard reset can work-around this issue, but each reset also disables spread spectrum support. The reset function also needs to reprogram the phy to enable spread spectrum support. Create a new driver based on ahci_platform to support the Calxeda Highbank SATA controller. Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com> Signed-off-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-07-25ahci_platform: add hibernation callbacksShiraz Hashim1-7/+3
Use existing suspend, resume implementation for hibernation callbacks. Signed-off-by: Shiraz Hashim <shiraz.hashim@st.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-05-03ata: ahci_platform: Add synopsys ahci controller in DT's compatible listViresh Kumar1-0/+1
SPEAr13xx series of SoCs contain Synopsys AHCI SATA Controller which shares ahci_platform driver with other controller versions. This patch updates DT compatible list for ahci_platform. It also updates and renames binding documentation to more generic name. Signed-off-by: Viresh Kumar <viresh.kumar@st.com> Cc: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-03-13ahci_platform: add STRICT_AHCI platform typeBrian Norris1-0/+11
Some platforms need to make use of the AHCI_HFLAG_DELAY_ENGINE flag. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com> Cc: stable@kernel.org
2012-01-08ahci: platform support for suspend/resumeBrian Norris1-0/+68
Add platform hooks for custom suspend() and resume() functions. The generic suspend/resume code in drivers/ata/ahci_platform.c is adapted from the PCI version in drivers/ata/ahci.c. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2011-11-17[libata] ahci_platform: fix DT probingRob Herring1-1/+1
The change in commit 904c04feaf13ed "ahci_platform: Add the board_ids..." doesn't work for the DT probing case as platform_get_device_id returns NULL. Pick the default ahci_port_info in this case. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Anton Vorontsov <cbouatmailru@gmail.com> Cc: Richard Zhu <richard.zhu@linaro.org> Cc: linux-ide@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2011-11-09ahci_platform: use dev_get_platdata()JiSheng Zhang1-2/+2
Use dev_get_platdata() to retrieve the struct ahci_platform_data data from the platform. Signed-off-by: JiSheng Zhang <jszhang3@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2011-11-03ahci: add DT binding for Calxeda AHCI controllerRob Herring1-0/+7
Add devicetree match table to ahci platform driver for Calxeda Highbank AHCI controller. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Cc: Jeff Garzik <jgarzik@pobox.com> Cc: linux-ide@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: devicetree-discuss@lists.ozlabs.org
2011-10-08[libata] ahci_platform: Add the board_ids and pi refer to different featuresRichard Zhu1-6/+38
On imx53 AHCI, soft reset fails with IPMS set when PMP is enabled but SATA HDD/ODD is connected to SATA port, do soft reset again to port 0. So the 'ahci_pmp_retry_srst_ops' is required when imx53 ahci is present. Signed-off-by: Richard Zhu <richard.zhu@linaro.org> Acked-by: Eric Miao <eric.miao@linaro.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2010-10-21libata: reimplement link power managementTejun Heo1-3/+0
The current LPM implementation has the following issues. * Operation order isn't well thought-out. e.g. HIPM should be configured after IPM in SControl is properly configured. Not the other way around. * Suspend/resume paths call ata_lpm_enable/disable() which must only be called from EH context directly. Also, ata_lpm_enable/disable() were called whether LPM was in use or not. * Implementation is per-port when it should be per-link. As a result, it can't be used for controllers with slave links or PMP. * LPM state isn't managed consistently. After a link reset for whatever reason including suspend/resume the actual LPM state would be reset leaving ap->lpm_policy inconsistent. * Generic/driver-specific logic boundary isn't clear. Currently, libahci has to mangle stuff which libata EH proper should be handling. This makes the implementation unnecessarily complex and fragile. * Tied to ALPM. Doesn't consider DIPM only cases and doesn't check whether the device allows HIPM. * Error handling isn't implemented. Given the extent of mismatch with the rest of libata, I don't think trying to fix it piecewise makes much sense. This patch reimplements LPM support. * The new implementation is per-link. The target policy is still port-wide (ap->target_lpm_policy) but all the mechanisms and states are per-link and integrate well with the rest of link abstraction and can work with slave and PMP links. * Core EH has proper control of LPM state. LPM state is reconfigured when and only when reconfiguration is necessary. It makes sure that LPM state is reset when probing for new device on the link. Controller agnostic logic is now implemented in libata EH proper and driver implementation only has to deal with controller specifics. * Proper error handling. LPM config failure is attributed to the device on the link and LPM is disabled for the link if it fails repeatedly. * ops->enable/disable_pm() are replaced with single ops->set_lpm() which takes @policy and @hints. This simplifies driver specific implementation. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2010-10-21libata: clean up lpm related symbols and sysfs show/store functionsTejun Heo1-1/+1
Link power management related symbols are in confusing state w/ mixed usages of lpm, ipm and pm. This patch cleans up lpm related symbols and sysfs show/store functions as follows. * lpm states - NOT_AVAILABLE, MIN_POWER, MAX_PERFORMANCE and MEDIUM_POWER are renamed to ATA_LPM_UNKNOWN and ATA_LPM_{MIN|MAX|MED}_POWER. * Pre/postfixes are unified to lpm. * sysfs show/store functions for link_power_management_policy were curiously named get/put and unnecessarily complex. Renamed to show/store and simplified. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2010-09-28ahci: fix module refcount breakage introduced by libahci splitTejun Heo1-1/+5
libata depends on scsi_host_template for module reference counting and sht's should be owned by each low level driver. During libahci split, the sht was left with libahci.ko leaving the actual low level drivers not reference counted. This made ahci and ahci_platform always unloadable even while they're being actively used. Fix it by defining AHCI_SHT() macro in ahci.h and defining a sht for each low level ahci driver. stable: only applicable to 2.6.35. Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: Pedro Francisco <pedrogfrancisco@gmail.com> Tested-by: Michael Tokarev <mjt@tls.msk.ru> Cc: stable@kernel.org Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2010-08-01ahci_platform: Remove unneeded ahci_driver.probe assignmentAnton Vorontsov1-1/+0
The driver is using platform_driver_probe() during initialization, so ahci_driver.probe hook is never used. But it causes the following (harmless, luckily) section mismatch: WARNING: vmlinux.o(.data+0x2fb20): Section mismatch in reference from the variable ahci_driver to the function .init.text:ahci_probe() This patch removes the ahci_driver.probe assignment, thus fixes the warning. p.s. Note that there's another patch[1] from Rene Bolldorf that tried to solve the same issue by __refdata annotation. __refdata says that this reference is actually OK, but in fact it is not OK, because dereferencing .probe() will cause problems. So the proper fix is to remove the assignment. [1] http://kerneltrap.org/mailarchive/linux-kernel/2010/3/18/4549547 Signed-off-by: Anton Vorontsov <avorontsov@mvista.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2010-08-01ahci_platform: Provide for vendor specific initJassi Brar1-10/+15
Some AHCI implementations may use Vendor Specific HBA[A0h, FFh] and/or Port[70h, 7Fh] registers to 'prepare' for initialization. For that, the platform needs memory mapped address of AHCI registers. This patch adds the 'mmio' argument and reorders the call to platform init function. Signed-off-by: Jassi Brar <jassi.brar@samsung.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2010-05-14ahci_platform: properly set up EM messagingJeff Garzik1-1/+1
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2010-05-14libata: update gfp/slab.h includesTejun Heo1-0/+1
Implicit slab.h inclusion via percpu.h is about to go away. Make sure gfp.h or slab.h is included as necessary. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2010-05-14ahci: Add platform driverAnton Vorontsov1-0/+191
This can be used for AHCI-compatible interfaces implemented inside System-On-Chip solutions, or AHCI devices connected via localbus. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>