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

Commit ffc94db8 authored by Harshdeep Dhatt's avatar Harshdeep Dhatt
Browse files

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: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent f7f07211
Loading
Loading
Loading
Loading
+20 −10
Original line number Diff line number Diff line
@@ -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 @@ static int gmu_probe(struct kgsl_device *device, struct platform_device *pdev)
	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;
	}

+0 −2
Original line number Diff line number Diff line
@@ -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;