Lines Matching +full:meson +full:- +full:gx +full:- +full:vpu
5 * SPDX-License-Identifier: GPL-2.0+
52 regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, in meson_gx_pwrc_vpu_power_off()
58 regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG0, in meson_gx_pwrc_vpu_power_off()
63 regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG1, in meson_gx_pwrc_vpu_power_off()
68 regmap_update_bits(pd->regmap_hhi, HHI_MEM_PD_REG0, in meson_gx_pwrc_vpu_power_off()
74 regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, in meson_gx_pwrc_vpu_power_off()
79 clk_disable_unprepare(pd->vpu_clk); in meson_gx_pwrc_vpu_power_off()
80 clk_disable_unprepare(pd->vapb_clk); in meson_gx_pwrc_vpu_power_off()
90 regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, in meson_g12a_pwrc_vpu_power_off()
96 regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG0, in meson_g12a_pwrc_vpu_power_off()
101 regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG1, in meson_g12a_pwrc_vpu_power_off()
106 regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG2, in meson_g12a_pwrc_vpu_power_off()
111 regmap_update_bits(pd->regmap_hhi, HHI_MEM_PD_REG0, in meson_g12a_pwrc_vpu_power_off()
117 regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, in meson_g12a_pwrc_vpu_power_off()
122 clk_disable_unprepare(pd->vpu_clk); in meson_g12a_pwrc_vpu_power_off()
123 clk_disable_unprepare(pd->vapb_clk); in meson_g12a_pwrc_vpu_power_off()
132 ret = clk_prepare_enable(pd->vpu_clk); in meson_gx_pwrc_vpu_setup_clk()
136 ret = clk_prepare_enable(pd->vapb_clk); in meson_gx_pwrc_vpu_setup_clk()
138 clk_disable_unprepare(pd->vpu_clk); in meson_gx_pwrc_vpu_setup_clk()
149 regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, in meson_gx_pwrc_vpu_power_on()
155 regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG0, in meson_gx_pwrc_vpu_power_on()
161 regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG1, in meson_gx_pwrc_vpu_power_on()
167 regmap_update_bits(pd->regmap_hhi, HHI_MEM_PD_REG0, in meson_gx_pwrc_vpu_power_on()
173 ret = reset_control_assert(pd->rstc); in meson_gx_pwrc_vpu_power_on()
177 regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, in meson_gx_pwrc_vpu_power_on()
180 ret = reset_control_deassert(pd->rstc); in meson_gx_pwrc_vpu_power_on()
197 regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, in meson_g12a_pwrc_vpu_power_on()
203 regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG0, in meson_g12a_pwrc_vpu_power_on()
209 regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG1, in meson_g12a_pwrc_vpu_power_on()
215 regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG2, in meson_g12a_pwrc_vpu_power_on()
221 regmap_update_bits(pd->regmap_hhi, HHI_MEM_PD_REG0, in meson_g12a_pwrc_vpu_power_on()
227 ret = reset_control_assert(pd->rstc); in meson_g12a_pwrc_vpu_power_on()
231 regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, in meson_g12a_pwrc_vpu_power_on()
234 ret = reset_control_deassert(pd->rstc); in meson_g12a_pwrc_vpu_power_on()
249 regmap_read(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, ®); in meson_gx_pwrc_vpu_get_power()
281 vpu_pd_match = of_device_get_match_data(&pdev->dev); in meson_gx_pwrc_vpu_probe()
283 dev_err(&pdev->dev, "failed to get match data\n"); in meson_gx_pwrc_vpu_probe()
284 return -ENODEV; in meson_gx_pwrc_vpu_probe()
287 vpu_pd = devm_kzalloc(&pdev->dev, sizeof(*vpu_pd), GFP_KERNEL); in meson_gx_pwrc_vpu_probe()
289 return -ENOMEM; in meson_gx_pwrc_vpu_probe()
293 regmap_ao = syscon_node_to_regmap(of_get_parent(pdev->dev.of_node)); in meson_gx_pwrc_vpu_probe()
295 dev_err(&pdev->dev, "failed to get regmap\n"); in meson_gx_pwrc_vpu_probe()
299 regmap_hhi = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, in meson_gx_pwrc_vpu_probe()
300 "amlogic,hhi-sysctrl"); in meson_gx_pwrc_vpu_probe()
302 dev_err(&pdev->dev, "failed to get HHI regmap\n"); in meson_gx_pwrc_vpu_probe()
306 rstc = devm_reset_control_array_get(&pdev->dev, false, false); in meson_gx_pwrc_vpu_probe()
308 if (PTR_ERR(rstc) != -EPROBE_DEFER) in meson_gx_pwrc_vpu_probe()
309 dev_err(&pdev->dev, "failed to get reset lines\n"); in meson_gx_pwrc_vpu_probe()
313 vpu_clk = devm_clk_get(&pdev->dev, "vpu"); in meson_gx_pwrc_vpu_probe()
315 dev_err(&pdev->dev, "vpu clock request failed\n"); in meson_gx_pwrc_vpu_probe()
319 vapb_clk = devm_clk_get(&pdev->dev, "vapb"); in meson_gx_pwrc_vpu_probe()
321 dev_err(&pdev->dev, "vapb clock request failed\n"); in meson_gx_pwrc_vpu_probe()
325 vpu_pd->regmap_ao = regmap_ao; in meson_gx_pwrc_vpu_probe()
326 vpu_pd->regmap_hhi = regmap_hhi; in meson_gx_pwrc_vpu_probe()
327 vpu_pd->rstc = rstc; in meson_gx_pwrc_vpu_probe()
328 vpu_pd->vpu_clk = vpu_clk; in meson_gx_pwrc_vpu_probe()
329 vpu_pd->vapb_clk = vapb_clk; in meson_gx_pwrc_vpu_probe()
342 vpu_pd->genpd.flags = GENPD_FLAG_ALWAYS_ON; in meson_gx_pwrc_vpu_probe()
343 pm_genpd_init(&vpu_pd->genpd, NULL, powered_off); in meson_gx_pwrc_vpu_probe()
345 return of_genpd_add_provider_simple(pdev->dev.of_node, in meson_gx_pwrc_vpu_probe()
346 &vpu_pd->genpd); in meson_gx_pwrc_vpu_probe()
356 vpu_pd->genpd.power_off(&vpu_pd->genpd); in meson_gx_pwrc_vpu_shutdown()
360 { .compatible = "amlogic,meson-gx-pwrc-vpu", .data = &vpu_hdmi_pd },
362 .compatible = "amlogic,meson-g12a-pwrc-vpu",