static int msm_sata_resume(struct device *ahci_dev)
{
	int ret;
	struct device *dev = ahci_dev->parent;

	ret = msm_sata_clk_init(dev);
	if (ret) {
		dev_err(dev, "SATA clk init failed with err=%d\n", ret);
		BUG();
	}

	
	ret = msm_sata_hard_reset(dev);
	if (ret)
		goto out;

	ret = msm_sata_vreg_init(dev);
	if (ret) {
		dev_err(dev, "SATA vreg init failed with err=%d\n", ret);
		
		goto out;
	}

	ret = msm_sata_phy_init(dev);
	if (ret) {
		dev_err(dev, "SATA PHY init failed with err=%d\n", ret);
		
		msm_sata_vreg_deinit(dev);
		goto out;
	}
out:
	return ret;
}
int msm_sata_init(struct device *ahci_dev, void __iomem *mmio)
{
	int ret;
	struct device *dev = ahci_dev->parent;
	struct msm_sata_hba *hba = dev_get_drvdata(dev);

	
	hba->ahci_base = mmio;

	ret = msm_sata_clk_init(dev);
	if (ret) {
		dev_err(dev, "SATA clk init failed with err=%d\n", ret);
		goto out;
	}

	ret = msm_sata_vreg_init(dev);
	if (ret) {
		dev_err(dev, "SATA vreg init failed with err=%d\n", ret);
		msm_sata_clk_deinit(dev);
		goto out;
	}

	ret = msm_sata_phy_init(dev);
	if (ret) {
		dev_err(dev, "SATA PHY init failed with err=%d\n", ret);
		msm_sata_vreg_deinit(dev);
		msm_sata_clk_deinit(dev);
		goto out;
	}

out:
	return ret;
}
Esempio n. 3
0
static int msm_sata_resume(struct device *ahci_dev)
{
	int ret;
	struct device *dev = ahci_dev->parent;

	ret = msm_sata_clk_init(dev);
	if (ret) {
		dev_err(dev, "SATA clk init failed with err=%d\n", ret);
		/*
		 * If clock initialization failed, that means ahci driver
		 * cannot access any register going further. Since there is
		 * no check within ahci driver to check for clock failures,
		 * panic here instead of making an unclocked register access.
		 */
		BUG();
		/* Take proper error path, if BUG() is not defined */
		goto out;
	}

	/* Issue asynchronous reset to reset PHY */
	ret = msm_sata_hard_reset(dev);
	if (ret)
		goto out;

#ifndef CONFIG_SATA_SNPS_PHY
	ret = msm_sata_vreg_init(dev);
	if (ret) {
		dev_err(dev, "SATA vreg init failed with err=%d\n", ret);
		/* Do not turn off clks, AHCI driver might do register access */
		goto out;
	}
#endif

	ret = msm_sata_phy_init(dev);
	if (ret) {
		dev_err(dev, "SATA PHY init failed with err=%d\n", ret);
		/* Do not turn off clks, AHCI driver might do register access */
		msm_sata_vreg_deinit(dev);
		goto out;
	}
out:
	return ret;
}
Esempio n. 4
0
int msm_sata_init(struct device *ahci_dev, void __iomem *mmio)
{
	int ret;
	struct device *dev = ahci_dev->parent;
	struct msm_sata_hba *hba = dev_get_drvdata(dev);

	/* Save ahci mmio to access vendor specific registers */
	hba->ahci_base = mmio;

	ret = msm_sata_clk_init(dev);
	if (ret) {
		dev_err(dev, "SATA clk init failed with err=%d\n", ret);
		goto out;
	}

	ret = msm_sata_vreg_init(dev);
	if (ret) {
		dev_err(dev, "SATA vreg init failed with err=%d\n", ret);
		msm_sata_clk_deinit(dev);
		goto out;
	}

	ret = msm_sata_phy_init(dev);
	if (ret) {
		dev_err(dev, "SATA PHY init failed with err=%d\n", ret);
		msm_sata_vreg_deinit(dev);
		msm_sata_clk_deinit(dev);
		goto out;
	}
	ret = device_create_file(ahci_dev, &dev_attr_msm_sata_suspend);
	if (ret < 0) {
		dev_err(dev, "SATA failed to create suspend /sys endpoint err=%d\n", ret);
	}

	hba->power_state = SATA_PWR_STATE_UP;

out:
	return ret;
}