Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Nicolas Frattaroli and committed by
AngeloGioacchino Del Regno
39aa8c4e 75cf308f

+7
+7
drivers/soc/mediatek/mtk-dvfsrc.c
··· 7 7 8 8 #include <linux/arm-smccc.h> 9 9 #include <linux/bitfield.h> 10 + #include <linux/clk.h> 10 11 #include <linux/iopoll.h> 11 12 #include <linux/module.h> 12 13 #include <linux/of.h> ··· 84 83 struct dvfsrc_soc_data; 85 84 struct mtk_dvfsrc { 86 85 struct device *dev; 86 + struct clk *clk; 87 87 struct platform_device *icc; 88 88 struct platform_device *regulator; 89 89 const struct dvfsrc_soc_data *dvd; ··· 651 649 dvfsrc->regs = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); 652 650 if (IS_ERR(dvfsrc->regs)) 653 651 return PTR_ERR(dvfsrc->regs); 652 + 653 + dvfsrc->clk = devm_clk_get_enabled(&pdev->dev, NULL); 654 + if (IS_ERR(dvfsrc->clk)) 655 + return dev_err_probe(&pdev->dev, PTR_ERR(dvfsrc->clk), 656 + "Couldn't get and enable DVFSRC clock\n"); 654 657 655 658 arm_smccc_smc(MTK_SIP_DVFSRC_VCOREFS_CONTROL, MTK_SIP_DVFSRC_INIT, 656 659 0, 0, 0, 0, 0, 0, &ares);