Commit e8da9934 authored by Richard Zhu's avatar Richard Zhu Committed by Jason Liu

ENGR00170244-4 ARM: AHCI: Enable PDDQ mode on mx6 sabrelite board

In order to save the power consumption, enable the
PDDQ mode of AHCI PHY when there is no sata disk
on the port
Signed-off-by: default avatarRichard Zhu <r65037@freescale.com>
parent 5a4f126d
......@@ -589,7 +589,7 @@ static void __init imx6q_sabrelite_init_usb(void)
static int mx6q_sabrelite_sata_init(struct device *dev, void __iomem *addr)
{
u32 tmpdata;
int ret = 0, iterations = 20;
int ret = 0;
struct clk *clk;
sata_clk = clk_get(dev, "imx_sata_clk");
......@@ -634,23 +634,9 @@ static int mx6q_sabrelite_sata_init(struct device *dev, void __iomem *addr)
tmpdata = clk_get_rate(clk) / 1000;
clk_put(clk);
sata_init(addr, tmpdata);
/* Release resources when there is no device on the port */
do {
if ((readl(addr + PORT_SATA_SR) & 0xF) == 0)
msleep(25);
else
break;
if (iterations == 0) {
dev_info(dev, "NO sata disk.\n");
ret = -ENODEV;
goto release_sata_clk;
}
} while (iterations-- > 0);
return ret;
ret = sata_init(addr, tmpdata);
if (ret == 0)
return ret;
release_sata_clk:
clk_disable(sata_clk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment