struct reset_control *host_rst;
struct reset_control *ss_rst;
+ struct tegra_pmc *pmc;
struct device *genpd_dev_host;
struct device *genpd_dev_ss;
bool use_genpd;
return rc;
}
} else {
- rc = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_XUSBA,
- tegra->ss_clk,
- tegra->ss_rst);
+ rc = tegra_pmc_powergate_sequence_power_up(tegra->pmc,
+ TEGRA_POWERGATE_XUSBA,
+ tegra->ss_clk,
+ tegra->ss_rst);
if (rc < 0) {
dev_err(dev, "failed to enable XUSB SS partition\n");
return rc;
}
- rc = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_XUSBC,
- tegra->host_clk,
- tegra->host_rst);
+ rc = tegra_pmc_powergate_sequence_power_up(tegra->pmc,
+ TEGRA_POWERGATE_XUSBC,
+ tegra->host_clk,
+ tegra->host_rst);
if (rc < 0) {
dev_err(dev, "failed to enable XUSB Host partition\n");
- tegra_powergate_power_off(TEGRA_POWERGATE_XUSBA);
+ tegra_pmc_powergate_power_off(tegra->pmc,
+ TEGRA_POWERGATE_XUSBA);
return rc;
}
}
return rc;
}
} else {
- rc = tegra_powergate_power_off(TEGRA_POWERGATE_XUSBC);
+ rc = tegra_pmc_powergate_power_off(tegra->pmc,
+ TEGRA_POWERGATE_XUSBC);
if (rc < 0) {
dev_err(dev, "failed to disable XUSB Host partition\n");
return rc;
}
- rc = tegra_powergate_power_off(TEGRA_POWERGATE_XUSBA);
+ rc = tegra_pmc_powergate_power_off(tegra->pmc,
+ TEGRA_POWERGATE_XUSBA);
if (rc < 0) {
dev_err(dev, "failed to disable XUSB SS partition\n");
- tegra_powergate_sequence_power_up(TEGRA_POWERGATE_XUSBC,
- tegra->host_clk,
- tegra->host_rst);
+ tegra_pmc_powergate_sequence_power_up(tegra->pmc,
+ TEGRA_POWERGATE_XUSBC,
+ tegra->host_clk,
+ tegra->host_rst);
return rc;
}
}
err);
goto put_padctl;
}
+
+ tegra->pmc = devm_tegra_pmc_get(&pdev->dev);
+ if (IS_ERR(tegra->pmc)) {
+ err = dev_err_probe(&pdev->dev, PTR_ERR(tegra->pmc),
+ "failed to get PMC\n");
+ goto put_padctl;
+ }
} else {
err = tegra_xusb_powerdomain_init(&pdev->dev, tegra);
if (err)