msm: kgsl: Scale hub clock to 150 Mhz

This is a new clock in a660 which needs to be run at
150 Mhz instead of running at 19.2 Mhz by default.

Also, there is no need to store a gmu_clk pointer
so get rid of it too.

Change-Id: If2741c061339e914683ca25565d1bac3ec6ac100
Signed-off-by: Harshdeep Dhatt <[email protected]>
This commit is contained in:
Harshdeep Dhatt 2020-03-12 16:38:47 -06:00
commit ffc94db8f0
2 changed files with 20 additions and 12 deletions

View file

@ -1309,14 +1309,6 @@ static int gmu_probe(struct kgsl_device *device, struct platform_device *pdev)
gmu->num_clks = ret;
/* Get a pointer to the GMU clock */
gmu->gmu_clk = kgsl_of_clk_by_name(gmu->clks, gmu->num_clks, "gmu_clk");
if (!gmu->gmu_clk) {
dev_err(&pdev->dev, "Couldn't get gmu_clk\n");
ret = -ENODEV;
goto error;
}
/* Set up GMU IOMMU and shared memory with GMU */
ret = gmu_iommu_init(gmu, pdev->dev.of_node);
if (ret)
@ -1406,14 +1398,32 @@ error:
return ret;
}
static int gmu_clk_set_rate(struct gmu_device *gmu, const char *id,
unsigned long rate)
{
struct clk *clk;
clk = kgsl_of_clk_by_name(gmu->clks, gmu->num_clks, id);
if (!clk)
return -ENODEV;
return clk_set_rate(clk, rate);
}
static int gmu_enable_clks(struct kgsl_device *device)
{
struct gmu_device *gmu = KGSL_GMU_DEVICE(device);
int ret;
ret = clk_set_rate(gmu->gmu_clk, GMU_FREQUENCY);
ret = gmu_clk_set_rate(gmu, "gmu_clk", GMU_FREQUENCY);
if (ret) {
dev_err(&gmu->pdev->dev, "Unable to set GMU clock\n");
dev_err(&gmu->pdev->dev, "Unable to set the GMU clock\n");
return ret;
}
ret = gmu_clk_set_rate(gmu, "hub_clk", 150000000);
if (ret && ret != ENODEV) {
dev_err(&gmu->pdev->dev, "Unable to set the HUB clock\n");
return ret;
}

View file

@ -194,8 +194,6 @@ struct gmu_device {
struct clk_bulk_data *clks;
/** @num_clks: Number of entries in the @clks array */
int num_clks;
/** @gmu_clk: Pointer to the core GMU clock */
struct clk *gmu_clk;
enum gmu_load_mode load_mode;
unsigned int wakeup_pwrlevel;
unsigned int idle_level;