24 #include <linux/device.h>
26 #include <asm/sizes.h>
27 #include <mach/hardware.h>
30 #define imx_ahci_imx_data_entry_single(soc, _devid) \
33 .iobase = soc ## _SATA_BASE_ADDR, \
34 .irq = soc ## _INT_SATA, \
37 #ifdef CONFIG_SOC_IMX53
49 static struct clk *sata_clk, *sata_ref_clk;
58 sata_clk =
clk_get(dev,
"ahci");
59 if (IS_ERR(sata_clk)) {
60 dev_err(dev,
"no sata clock.\n");
61 return PTR_ERR(sata_clk);
63 ret = clk_prepare_enable(sata_clk);
65 dev_err(dev,
"can't prepare/enable sata clock.\n");
70 sata_ref_clk =
clk_get(dev,
"ahci_phy");
71 if (IS_ERR(sata_ref_clk)) {
72 dev_err(dev,
"no sata ref clock.\n");
73 ret = PTR_ERR(sata_ref_clk);
74 goto release_sata_clk;
76 ret = clk_prepare_enable(sata_ref_clk);
78 dev_err(dev,
"can't prepare/enable sata ref clock.\n");
79 goto put_sata_ref_clk;
85 dev_err(dev,
"no dma clock.\n");
87 goto release_sata_ref_clk;
106 release_sata_ref_clk:
107 clk_disable_unprepare(sata_ref_clk);
111 clk_disable_unprepare(sata_clk);
118 static void imx_sata_exit(
struct device *
dev)
120 clk_disable_unprepare(sata_ref_clk);
123 clk_disable_unprepare(sata_clk);
143 return imx_add_platform_device_dmamask(data->
devid, 0,
151 .
init = imx_sata_init,
152 .exit = imx_sata_exit,