Ejemplo n.º 1
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);

	
	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;
}
Ejemplo n.º 2
0
void msm_sata_deinit(struct device *ahci_dev)
{
	struct device *dev = ahci_dev->parent;

	msm_sata_phy_deinit(dev);
	msm_sata_vreg_deinit(dev);
	msm_sata_clk_deinit(dev);
}
Ejemplo n.º 3
0
void msm_sata_deinit(struct device *ahci_dev)
{
	struct device *dev = ahci_dev->parent;

	msm_sata_phy_deinit(dev);
#ifndef CONFIG_SATA_SNPS_PHY
	msm_sata_vreg_deinit(dev);
#endif
	msm_sata_clk_deinit(dev);
}
Ejemplo 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;
}