Merge "clk: msm: clock-osm: Request Nominal Fmax frequency after OSM enable"

This commit is contained in:
Linux Build Service Account 2016-10-31 13:04:14 -07:00 committed by Gerrit - the friendly Code Review server
commit e8035d93b6

View file

@ -2748,33 +2748,26 @@ static int cpu_clock_osm_driver_probe(struct platform_device *pdev)
}
clk_prepare_enable(&sys_apcsaux_clk_gcc.c);
/* Set boot rate */
rc = clk_set_rate(&pwrcl_clk.c, msmcobalt_v1 ?
MSMCOBALTV1_PWRCL_BOOT_RATE :
MSMCOBALTV2_PWRCL_BOOT_RATE);
if (rc) {
dev_err(&pdev->dev, "Unable to set boot rate on pwr cluster, rc=%d\n",
rc);
clk_disable_unprepare(&sys_apcsaux_clk_gcc.c);
return rc;
}
rc = clk_set_rate(&perfcl_clk.c, msmcobalt_v1 ?
MSMCOBALTV1_PERFCL_BOOT_RATE :
MSMCOBALTV2_PERFCL_BOOT_RATE);
if (rc) {
dev_err(&pdev->dev, "Unable to set boot rate on perf cluster, rc=%d\n",
rc);
clk_disable_unprepare(&sys_apcsaux_clk_gcc.c);
return rc;
}
rc = clk_set_rate(&osm_clk_src.c, osm_clk_init_rate);
if (rc) {
dev_err(&pdev->dev, "Unable to set init rate on osm_clk, rc=%d\n",
rc);
clk_disable_unprepare(&sys_apcsaux_clk_gcc.c);
return rc;
goto exit2;
}
/* Make sure index zero is selected */
rc = clk_set_rate(&pwrcl_clk.c, init_rate);
if (rc) {
dev_err(&pdev->dev, "Unable to set init rate on pwr cluster, rc=%d\n",
rc);
goto exit2;
}
rc = clk_set_rate(&perfcl_clk.c, init_rate);
if (rc) {
dev_err(&pdev->dev, "Unable to set init rate on perf cluster, rc=%d\n",
rc);
goto exit2;
}
get_online_cpus();
@ -2785,6 +2778,25 @@ static int cpu_clock_osm_driver_probe(struct platform_device *pdev)
"Failed to enable clock for cpu %d\n", cpu);
}
/* Set final boot rate */
rc = clk_set_rate(&pwrcl_clk.c, msmcobalt_v1 ?
MSMCOBALTV1_PWRCL_BOOT_RATE :
MSMCOBALTV2_PWRCL_BOOT_RATE);
if (rc) {
dev_err(&pdev->dev, "Unable to set boot rate on pwr cluster, rc=%d\n",
rc);
goto exit2;
}
rc = clk_set_rate(&perfcl_clk.c, msmcobalt_v1 ?
MSMCOBALTV1_PERFCL_BOOT_RATE :
MSMCOBALTV2_PERFCL_BOOT_RATE);
if (rc) {
dev_err(&pdev->dev, "Unable to set boot rate on perf cluster, rc=%d\n",
rc);
goto exit2;
}
pwrcl_clk.version = clk_osm_read_reg(&pwrcl_clk, VERSION_REG);
perfcl_clk.version = clk_osm_read_reg(&perfcl_clk, VERSION_REG);
@ -2801,6 +2813,8 @@ static int cpu_clock_osm_driver_probe(struct platform_device *pdev)
return 0;
exit2:
clk_disable_unprepare(&sys_apcsaux_clk_gcc.c);
exit:
dev_err(&pdev->dev, "OSM driver failed to initialize, rc=%d\n",
rc);