16 #include <linux/kernel.h>
18 #include <linux/module.h>
22 #include <linux/device.h>
42 .name =
"strict-ahci",
83 struct ata_port_info pi = ahci_port_info[
id ?
id->driver_data : 0];
95 dev_err(dev,
"no mmio space\n");
110 dev_err(dev,
"can't alloc ahci_host_priv\n");
118 dev_err(dev,
"can't map %pR\n", mem);
123 if (IS_ERR(hpriv->
clk)) {
124 dev_err(dev,
"can't get clock\n");
126 rc = clk_prepare_enable(hpriv->
clk);
128 dev_err(dev,
"clock prepare enable failed");
139 if (pdata && pdata->
init) {
142 goto disable_unprepare_clk;
181 for (i = 0; i < host->
n_ports; i++) {
210 if (pdata && pdata->
exit)
212 disable_unprepare_clk:
213 if (!IS_ERR(hpriv->
clk))
214 clk_disable_unprepare(hpriv->
clk);
216 if (!IS_ERR(hpriv->
clk))
230 if (pdata && pdata->
exit)
233 if (!IS_ERR(hpriv->
clk)) {
234 clk_disable_unprepare(hpriv->
clk);
241 #ifdef CONFIG_PM_SLEEP
242 static int ahci_suspend(
struct device *dev)
252 dev_err(dev,
"firmware update required for suspend/resume\n");
273 if (!IS_ERR(hpriv->
clk))
274 clk_disable_unprepare(hpriv->
clk);
279 static int ahci_resume(
struct device *dev)
286 if (!IS_ERR(hpriv->
clk)) {
287 rc = clk_prepare_enable(hpriv->
clk);
289 dev_err(dev,
"clock prepare enable failed");
294 if (pdata && pdata->
resume) {
297 goto disable_unprepare_clk;
303 goto disable_unprepare_clk;
308 ata_host_resume(host);
312 disable_unprepare_clk:
313 if (!IS_ERR(hpriv->
clk))
314 clk_disable_unprepare(hpriv->
clk);
323 { .compatible =
"snps,spear-ahci", },
333 .of_match_table = ahci_of_match,
336 .id_table = ahci_devtype,
339 static int __init ahci_init(
void)
345 static void __exit ahci_exit(
void)