mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 12:21:22 -05:00
clk: mediatek: clk-mtk: Introduce mtk_clk_get_hwv_regmap()
On MT8196, some clock controllers use a separate regmap for hardware voting via set/clear/status registers. Add mtk_clk_get_hwv_regmap() to retrieve this optional regmap, avoiding duplicated lookup code in mtk_clk_register_muxes() and mtk_clk_register_gate(). Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Signed-off-by: Laura Nao <laura.nao@collabora.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
@@ -685,4 +685,20 @@ void mtk_clk_simple_remove(struct platform_device *pdev)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mtk_clk_simple_remove);
|
||||
|
||||
struct regmap *mtk_clk_get_hwv_regmap(struct device_node *node)
|
||||
{
|
||||
struct device_node *hwv_node;
|
||||
struct regmap *regmap_hwv;
|
||||
|
||||
hwv_node = of_parse_phandle(node, "mediatek,hardware-voter", 0);
|
||||
if (!hwv_node)
|
||||
return NULL;
|
||||
|
||||
regmap_hwv = device_node_to_regmap(hwv_node);
|
||||
of_node_put(hwv_node);
|
||||
|
||||
return regmap_hwv;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mtk_clk_get_hwv_regmap);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
@@ -245,5 +245,6 @@ int mtk_clk_pdev_probe(struct platform_device *pdev);
|
||||
void mtk_clk_pdev_remove(struct platform_device *pdev);
|
||||
int mtk_clk_simple_probe(struct platform_device *pdev);
|
||||
void mtk_clk_simple_remove(struct platform_device *pdev);
|
||||
struct regmap *mtk_clk_get_hwv_regmap(struct device_node *node);
|
||||
|
||||
#endif /* __DRV_CLK_MTK_H */
|
||||
|
||||
Reference in New Issue
Block a user