Lines Matching +full:meson +full:- +full:hhi +full:- +full:sysctrl
5 * SPDX-License-Identifier: GPL-2.0+
26 /* HHI Offsets */
53 regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, in meson_gx_pwrc_vpu_power_off()
59 regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG0, in meson_gx_pwrc_vpu_power_off()
64 regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG1, in meson_gx_pwrc_vpu_power_off()
69 regmap_update_bits(pd->regmap_hhi, HHI_MEM_PD_REG0, in meson_gx_pwrc_vpu_power_off()
75 regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, in meson_gx_pwrc_vpu_power_off()
80 clk_disable_unprepare(pd->vpu_clk); in meson_gx_pwrc_vpu_power_off()
81 clk_disable_unprepare(pd->vapb_clk); in meson_gx_pwrc_vpu_power_off()
91 regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, in meson_g12a_pwrc_vpu_power_off()
97 regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG0, in meson_g12a_pwrc_vpu_power_off()
102 regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG1, in meson_g12a_pwrc_vpu_power_off()
107 regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG2, in meson_g12a_pwrc_vpu_power_off()
112 regmap_update_bits(pd->regmap_hhi, HHI_MEM_PD_REG0, in meson_g12a_pwrc_vpu_power_off()
118 regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, in meson_g12a_pwrc_vpu_power_off()
123 clk_disable_unprepare(pd->vpu_clk); in meson_g12a_pwrc_vpu_power_off()
124 clk_disable_unprepare(pd->vapb_clk); in meson_g12a_pwrc_vpu_power_off()
133 ret = clk_prepare_enable(pd->vpu_clk); in meson_gx_pwrc_vpu_setup_clk()
137 ret = clk_prepare_enable(pd->vapb_clk); in meson_gx_pwrc_vpu_setup_clk()
139 clk_disable_unprepare(pd->vpu_clk); in meson_gx_pwrc_vpu_setup_clk()
150 regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, in meson_gx_pwrc_vpu_power_on()
156 regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG0, in meson_gx_pwrc_vpu_power_on()
162 regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG1, in meson_gx_pwrc_vpu_power_on()
168 regmap_update_bits(pd->regmap_hhi, HHI_MEM_PD_REG0, in meson_gx_pwrc_vpu_power_on()
174 ret = reset_control_assert(pd->rstc); in meson_gx_pwrc_vpu_power_on()
178 regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, in meson_gx_pwrc_vpu_power_on()
181 ret = reset_control_deassert(pd->rstc); in meson_gx_pwrc_vpu_power_on()
198 regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, in meson_g12a_pwrc_vpu_power_on()
204 regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG0, in meson_g12a_pwrc_vpu_power_on()
210 regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG1, in meson_g12a_pwrc_vpu_power_on()
216 regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG2, in meson_g12a_pwrc_vpu_power_on()
222 regmap_update_bits(pd->regmap_hhi, HHI_MEM_PD_REG0, in meson_g12a_pwrc_vpu_power_on()
228 ret = reset_control_assert(pd->rstc); in meson_g12a_pwrc_vpu_power_on()
232 regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, in meson_g12a_pwrc_vpu_power_on()
235 ret = reset_control_deassert(pd->rstc); in meson_g12a_pwrc_vpu_power_on()
250 regmap_read(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, ®); in meson_gx_pwrc_vpu_get_power()
283 vpu_pd_match = of_device_get_match_data(&pdev->dev); in meson_gx_pwrc_vpu_probe()
285 dev_err(&pdev->dev, "failed to get match data\n"); in meson_gx_pwrc_vpu_probe()
286 return -ENODEV; in meson_gx_pwrc_vpu_probe()
289 vpu_pd = devm_kzalloc(&pdev->dev, sizeof(*vpu_pd), GFP_KERNEL); in meson_gx_pwrc_vpu_probe()
291 return -ENOMEM; in meson_gx_pwrc_vpu_probe()
295 parent_np = of_get_parent(pdev->dev.of_node); in meson_gx_pwrc_vpu_probe()
299 dev_err(&pdev->dev, "failed to get regmap\n"); in meson_gx_pwrc_vpu_probe()
303 regmap_hhi = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, in meson_gx_pwrc_vpu_probe()
304 "amlogic,hhi-sysctrl"); in meson_gx_pwrc_vpu_probe()
306 dev_err(&pdev->dev, "failed to get HHI regmap\n"); in meson_gx_pwrc_vpu_probe()
310 rstc = devm_reset_control_array_get_exclusive(&pdev->dev); in meson_gx_pwrc_vpu_probe()
312 if (PTR_ERR(rstc) != -EPROBE_DEFER) in meson_gx_pwrc_vpu_probe()
313 dev_err(&pdev->dev, "failed to get reset lines\n"); in meson_gx_pwrc_vpu_probe()
317 vpu_clk = devm_clk_get(&pdev->dev, "vpu"); in meson_gx_pwrc_vpu_probe()
319 dev_err(&pdev->dev, "vpu clock request failed\n"); in meson_gx_pwrc_vpu_probe()
323 vapb_clk = devm_clk_get(&pdev->dev, "vapb"); in meson_gx_pwrc_vpu_probe()
325 dev_err(&pdev->dev, "vapb clock request failed\n"); in meson_gx_pwrc_vpu_probe()
329 vpu_pd->regmap_ao = regmap_ao; in meson_gx_pwrc_vpu_probe()
330 vpu_pd->regmap_hhi = regmap_hhi; in meson_gx_pwrc_vpu_probe()
331 vpu_pd->rstc = rstc; in meson_gx_pwrc_vpu_probe()
332 vpu_pd->vpu_clk = vpu_clk; in meson_gx_pwrc_vpu_probe()
333 vpu_pd->vapb_clk = vapb_clk; in meson_gx_pwrc_vpu_probe()
346 vpu_pd->genpd.flags = GENPD_FLAG_ALWAYS_ON; in meson_gx_pwrc_vpu_probe()
347 pm_genpd_init(&vpu_pd->genpd, NULL, powered_off); in meson_gx_pwrc_vpu_probe()
349 return of_genpd_add_provider_simple(pdev->dev.of_node, in meson_gx_pwrc_vpu_probe()
350 &vpu_pd->genpd); in meson_gx_pwrc_vpu_probe()
360 vpu_pd->genpd.power_off(&vpu_pd->genpd); in meson_gx_pwrc_vpu_shutdown()
364 { .compatible = "amlogic,meson-gx-pwrc-vpu", .data = &vpu_hdmi_pd },
366 .compatible = "amlogic,meson-g12a-pwrc-vpu",