#include <linux/mfd/syscon.h>
#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
#include <linux/libata.h>
+#include <linux/busfreq-imx6.h>
#include "ahci.h"
enum {
IMX6Q_GPR13_SATA_MPLL_CLK_EN,
!IMX6Q_GPR13_SATA_MPLL_CLK_EN);
clk_disable_unprepare(imxpriv->sata_ref_clk);
+ release_bus_freq(BUS_FREQ_HIGH);
imxpriv->no_device = true;
}
dev_err(dev, "prepare-enable sata_ref clock err:%d\n", ret);
return ret;
}
+ request_bus_freq(BUS_FREQ_HIGH);
/*
* set PHY Paremeters, two steps to configure the GPR13,
{
struct imx_ahci_priv *imxpriv = dev_get_drvdata(dev->parent);
- regmap_update_bits(imxpriv->gpr, 0x34, IMX6Q_GPR13_SATA_MPLL_CLK_EN,
- !IMX6Q_GPR13_SATA_MPLL_CLK_EN);
- clk_disable_unprepare(imxpriv->sata_ref_clk);
+ if (!imxpriv->no_device) {
+ regmap_update_bits(imxpriv->gpr, 0x34,
+ IMX6Q_GPR13_SATA_MPLL_CLK_EN,
+ !IMX6Q_GPR13_SATA_MPLL_CLK_EN);
+ clk_disable_unprepare(imxpriv->sata_ref_clk);
+ release_bus_freq(BUS_FREQ_HIGH);
+ }
}
static int imx_ahci_suspend(struct device *dev)
IMX6Q_GPR13_SATA_MPLL_CLK_EN,
!IMX6Q_GPR13_SATA_MPLL_CLK_EN);
clk_disable_unprepare(imxpriv->sata_ref_clk);
+ release_bus_freq(BUS_FREQ_HIGH);
}
return 0;
dev_err(dev, "pre-enable sata_ref clock err:%d\n", ret);
return ret;
}
+ request_bus_freq(BUS_FREQ_HIGH);
regmap_update_bits(imxpriv->gpr, IOMUXC_GPR13,
IMX6Q_GPR13_SATA_MPLL_CLK_EN,