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

Commit 898f3f6d authored by Vivek Aknurwar's avatar Vivek Aknurwar
Browse files

clk: qcom: gpucc: Voltage voting support for Lahaina



Add voltage voting support to the Lahaina GPU_CC driver.

Change-Id: Ie75cbf17a63f92eb014c3a3abeabef1144e20445
Signed-off-by: default avatarVivek Aknurwar <viveka@codeaurora.org>
parent be5c6c47
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -22,6 +22,9 @@
#include "clk-regmap-mux.h"
#include "clk-regmap-divider.h"
#include "reset.h"
#include "vdd-level.h"

static DEFINE_VDD_REGULATORS(vdd_mx, VDD_NUM, 1, vdd_corner);

enum {
	P_BI_TCXO,
@@ -63,6 +66,15 @@ static struct clk_alpha_pll gpu_cc_pll0 = {
			.num_parents = 1,
			.ops = &clk_alpha_pll_lucid_5lpe_ops,
		},
		.vdd_data = {
			.vdd_class = &vdd_mx,
			.num_rate_max = VDD_NUM,
			.rate_max = (unsigned long[VDD_NUM]) {
				[VDD_MIN] = 615000000,
				[VDD_LOW] = 1066000000,
				[VDD_LOW_L1] = 1600000000,
				[VDD_NOMINAL] = 2000000000},
		},
	},
};

@@ -93,6 +105,15 @@ static struct clk_alpha_pll gpu_cc_pll1 = {
			.num_parents = 1,
			.ops = &clk_alpha_pll_lucid_5lpe_ops,
		},
		.vdd_data = {
			.vdd_class = &vdd_mx,
			.num_rate_max = VDD_NUM,
			.rate_max = (unsigned long[VDD_NUM]) {
				[VDD_MIN] = 615000000,
				[VDD_LOW] = 1066000000,
				[VDD_LOW_L1] = 1600000000,
				[VDD_NOMINAL] = 2000000000},
		},
	},
};

@@ -567,6 +588,13 @@ static int gpu_cc_lahaina_probe(struct platform_device *pdev)
	struct regmap *regmap;
	int ret;

	vdd_mx.regulator[0] = devm_regulator_get(&pdev->dev, "vdd_mx");
	if (IS_ERR(vdd_mx.regulator[0])) {
		if (PTR_ERR(vdd_mx.regulator[0]) != -EPROBE_DEFER)
			dev_err(&pdev->dev, "Unable to get vdd_mx regulator\n");
		return PTR_ERR(vdd_mx.regulator[0]);
	}

	regmap = qcom_cc_map(pdev, &gpu_cc_lahaina_desc);
	if (IS_ERR(regmap)) {
		dev_err(&pdev->dev, "Failed to map gpu cc registers\n");