Skip to content

Commit 39aa8c4

Browse files
Nicolas FrattaroliAngeloGioacchino Del Regno
authored andcommitted
soc: mediatek: mtk-dvfsrc: Get and Enable DVFSRC clock
The DVFSRC has a clock on all platforms. Get and enable it in the probe function, so that Linux's common clock framework knows we're a user of it. Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
1 parent 75cf308 commit 39aa8c4

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/soc/mediatek/mtk-dvfsrc.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <linux/arm-smccc.h>
99
#include <linux/bitfield.h>
10+
#include <linux/clk.h>
1011
#include <linux/iopoll.h>
1112
#include <linux/module.h>
1213
#include <linux/of.h>
@@ -83,6 +84,7 @@ struct dvfsrc_opp_desc {
8384
struct dvfsrc_soc_data;
8485
struct mtk_dvfsrc {
8586
struct device *dev;
87+
struct clk *clk;
8688
struct platform_device *icc;
8789
struct platform_device *regulator;
8890
const struct dvfsrc_soc_data *dvd;
@@ -650,6 +652,11 @@ static int mtk_dvfsrc_probe(struct platform_device *pdev)
650652
if (IS_ERR(dvfsrc->regs))
651653
return PTR_ERR(dvfsrc->regs);
652654

655+
dvfsrc->clk = devm_clk_get_enabled(&pdev->dev, NULL);
656+
if (IS_ERR(dvfsrc->clk))
657+
return dev_err_probe(&pdev->dev, PTR_ERR(dvfsrc->clk),
658+
"Couldn't get and enable DVFSRC clock\n");
659+
653660
arm_smccc_smc(MTK_SIP_DVFSRC_VCOREFS_CONTROL, MTK_SIP_DVFSRC_INIT,
654661
0, 0, 0, 0, 0, 0, &ares);
655662
if (ares.a0)

0 commit comments

Comments
 (0)