From 898f3f6dcb5822873a386edd1130c6189fc6dbb3 Mon Sep 17 00:00:00 2001 From: Vivek Aknurwar Date: Fri, 22 Nov 2019 15:54:06 -0800 Subject: [PATCH] clk: qcom: gpucc: Voltage voting support for Lahaina Add voltage voting support to the Lahaina GPU_CC driver. Change-Id: Ie75cbf17a63f92eb014c3a3abeabef1144e20445 Signed-off-by: Vivek Aknurwar --- drivers/clk/qcom/gpucc-lahaina.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/clk/qcom/gpucc-lahaina.c b/drivers/clk/qcom/gpucc-lahaina.c index 800164c68f1c..8a3863e8ccf0 100644 --- a/drivers/clk/qcom/gpucc-lahaina.c +++ b/drivers/clk/qcom/gpucc-lahaina.c @@ -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");