Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6629c11 authored by Veera Vegivada's avatar Veera Vegivada
Browse files

clk: qcom: sm6150: Add dev_pm_ops for scc



scc_pll has non-zero POR value for its L_VAL and CAL_L_VAL
so support early resume to reconfigure the scc pll.

Change-Id: Iaff1d1584058823a05022f79a2aeb40ccf4d9f4a
Signed-off-by: default avatarVeera Vegivada <vvegivad@codeaurora.org>
parent 7ef0da4b
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -541,10 +541,26 @@ static const struct of_device_id scc_sm6150_match_table[] = {
};
MODULE_DEVICE_TABLE(of, scc_sm6150_match_table);

static int scc_sa6150_resume(struct device *dev)
{
	struct regmap *regmap = dev_get_drvdata(dev);

	clk_alpha_pll_configure(&scc_pll_out_aux2, regmap,
			scc_pll_out_aux2.config);

	return 0;
}

static const struct dev_pm_ops scc_sa6150_pm_ops = {
	.restore_early = scc_sa6150_resume,
};

static void scc_sm6150_fixup_sa6155(struct platform_device *pdev)
{
	vdd_scc_cx.num_levels = VDD_NUM_SA6155;
	vdd_scc_cx.cur_level = VDD_NUM_SA6155;

	pdev->dev.driver->pm =  &scc_sa6150_pm_ops;
}

static int scc_sm6150_probe(struct platform_device *pdev)
@@ -588,6 +604,9 @@ static int scc_sm6150_probe(struct platform_device *pdev)
		return ret;
	}

	if (is_sa6155)
		dev_set_drvdata(&pdev->dev, regmap);

	dev_info(&pdev->dev, "Registered SCC clocks\n");

	return ret;