Lines Matching +full:stg +full:- +full:syscon
1 // SPDX-License-Identifier: GPL-2.0
3 * cdns3-starfive.c - StarFive specific Glue layer for Cadence USB Controller
13 #include <linux/mfd/syscon.h>
49 regmap_update_bits(data->stg_syscon, data->stg_usb_mode, in cdns_mode_init()
54 mode = usb_get_dr_mode(&pdev->dev); in cdns_mode_init()
58 regmap_update_bits(data->stg_syscon, in cdns_mode_init()
59 data->stg_usb_mode, in cdns_mode_init()
62 regmap_update_bits(data->stg_syscon, in cdns_mode_init()
63 data->stg_usb_mode, in cdns_mode_init()
69 regmap_update_bits(data->stg_syscon, data->stg_usb_mode, in cdns_mode_init()
71 regmap_update_bits(data->stg_syscon, data->stg_usb_mode, in cdns_mode_init()
83 ret = clk_bulk_prepare_enable(data->num_clks, data->clks); in cdns_clk_rst_init()
85 return dev_err_probe(data->dev, ret, in cdns_clk_rst_init()
88 ret = reset_control_deassert(data->resets); in cdns_clk_rst_init()
90 dev_err(data->dev, "failed to reset clocks\n"); in cdns_clk_rst_init()
97 clk_bulk_disable_unprepare(data->num_clks, data->clks); in cdns_clk_rst_init()
103 reset_control_assert(data->resets); in cdns_clk_rst_deinit()
104 clk_bulk_disable_unprepare(data->num_clks, data->clks); in cdns_clk_rst_deinit()
109 struct device *dev = &pdev->dev; in cdns_starfive_probe()
116 return -ENOMEM; in cdns_starfive_probe()
118 data->dev = dev; in cdns_starfive_probe()
120 data->stg_syscon = in cdns_starfive_probe()
121 syscon_regmap_lookup_by_phandle_args(pdev->dev.of_node, in cdns_starfive_probe()
122 "starfive,stg-syscon", 1, &args); in cdns_starfive_probe()
124 if (IS_ERR(data->stg_syscon)) in cdns_starfive_probe()
125 return dev_err_probe(dev, PTR_ERR(data->stg_syscon), in cdns_starfive_probe()
126 "Failed to parse starfive,stg-syscon\n"); in cdns_starfive_probe()
128 data->stg_usb_mode = args; in cdns_starfive_probe()
130 data->num_clks = devm_clk_bulk_get_all(data->dev, &data->clks); in cdns_starfive_probe()
131 if (data->num_clks < 0) in cdns_starfive_probe()
132 return dev_err_probe(data->dev, -ENODEV, in cdns_starfive_probe()
135 data->resets = devm_reset_control_array_get_exclusive(data->dev); in cdns_starfive_probe()
136 if (IS_ERR(data->resets)) in cdns_starfive_probe()
137 return dev_err_probe(data->dev, PTR_ERR(data->resets), in cdns_starfive_probe()
145 ret = of_platform_populate(dev->of_node, NULL, NULL, dev); in cdns_starfive_probe()
171 struct device *dev = &pdev->dev; in cdns_starfive_remove()
188 return clk_bulk_prepare_enable(data->num_clks, data->clks); in cdns_starfive_runtime_resume()
195 clk_bulk_disable_unprepare(data->num_clks, data->clks); in cdns_starfive_runtime_suspend()
226 { .compatible = "starfive,jh7110-usb", },
235 .name = "cdns3-starfive",
242 MODULE_ALIAS("platform:cdns3-starfive");