Lines Matching refs:smi
81 struct mtk_smi smi; member
89 static int mtk_smi_clk_enable(const struct mtk_smi *smi) in mtk_smi_clk_enable() argument
93 ret = clk_prepare_enable(smi->clk_apb); in mtk_smi_clk_enable()
97 ret = clk_prepare_enable(smi->clk_smi); in mtk_smi_clk_enable()
101 ret = clk_prepare_enable(smi->clk_gals0); in mtk_smi_clk_enable()
105 ret = clk_prepare_enable(smi->clk_gals1); in mtk_smi_clk_enable()
112 clk_disable_unprepare(smi->clk_gals0); in mtk_smi_clk_enable()
114 clk_disable_unprepare(smi->clk_smi); in mtk_smi_clk_enable()
116 clk_disable_unprepare(smi->clk_apb); in mtk_smi_clk_enable()
120 static void mtk_smi_clk_disable(const struct mtk_smi *smi) in mtk_smi_clk_disable() argument
122 clk_disable_unprepare(smi->clk_gals1); in mtk_smi_clk_disable()
123 clk_disable_unprepare(smi->clk_gals0); in mtk_smi_clk_disable()
124 clk_disable_unprepare(smi->clk_smi); in mtk_smi_clk_disable()
125 clk_disable_unprepare(smi->clk_apb); in mtk_smi_clk_disable()
287 larb->smi.clk_apb = devm_clk_get(dev, "apb"); in mtk_smi_larb_probe()
288 if (IS_ERR(larb->smi.clk_apb)) in mtk_smi_larb_probe()
289 return PTR_ERR(larb->smi.clk_apb); in mtk_smi_larb_probe()
291 larb->smi.clk_smi = devm_clk_get(dev, "smi"); in mtk_smi_larb_probe()
292 if (IS_ERR(larb->smi.clk_smi)) in mtk_smi_larb_probe()
293 return PTR_ERR(larb->smi.clk_smi); in mtk_smi_larb_probe()
297 larb->smi.clk_gals0 = devm_clk_get(dev, "gals"); in mtk_smi_larb_probe()
298 if (PTR_ERR(larb->smi.clk_gals0) == -ENOENT) in mtk_smi_larb_probe()
299 larb->smi.clk_gals0 = NULL; in mtk_smi_larb_probe()
300 else if (IS_ERR(larb->smi.clk_gals0)) in mtk_smi_larb_probe()
301 return PTR_ERR(larb->smi.clk_gals0); in mtk_smi_larb_probe()
303 larb->smi.dev = dev; in mtk_smi_larb_probe()
345 ret = mtk_smi_clk_enable(&larb->smi); in mtk_smi_larb_resume()
362 mtk_smi_clk_disable(&larb->smi); in mtk_smi_larb_suspend()