Lines Matching +full:uniphier +full:- +full:ld20 +full:- +full:usb3 +full:- +full:reset
1 // SPDX-License-Identifier: GPL-2.0
3 // reset-uniphier-glue.c - Glue layer reset driver for UniPhier
11 #include <linux/reset.h>
12 #include <linux/reset/reset-simple.h>
35 clk_bulk_disable_unprepare(priv->data->nclks, priv->clk); in uniphier_clk_disable()
42 reset_control_bulk_assert(priv->data->nrsts, priv->rst); in uniphier_rst_assert()
47 struct device *dev = &pdev->dev; in uniphier_glue_reset_probe()
55 return -ENOMEM; in uniphier_glue_reset_probe()
57 priv->data = of_device_get_match_data(dev); in uniphier_glue_reset_probe()
58 if (WARN_ON(!priv->data || priv->data->nclks > MAX_CLKS || in uniphier_glue_reset_probe()
59 priv->data->nrsts > MAX_RSTS)) in uniphier_glue_reset_probe()
60 return -EINVAL; in uniphier_glue_reset_probe()
64 priv->rdata.membase = devm_ioremap_resource(dev, res); in uniphier_glue_reset_probe()
65 if (IS_ERR(priv->rdata.membase)) in uniphier_glue_reset_probe()
66 return PTR_ERR(priv->rdata.membase); in uniphier_glue_reset_probe()
68 for (i = 0; i < priv->data->nclks; i++) in uniphier_glue_reset_probe()
69 priv->clk[i].id = priv->data->clock_names[i]; in uniphier_glue_reset_probe()
70 ret = devm_clk_bulk_get(dev, priv->data->nclks, priv->clk); in uniphier_glue_reset_probe()
74 for (i = 0; i < priv->data->nrsts; i++) in uniphier_glue_reset_probe()
75 priv->rst[i].id = priv->data->reset_names[i]; in uniphier_glue_reset_probe()
76 ret = devm_reset_control_bulk_get_shared(dev, priv->data->nrsts, in uniphier_glue_reset_probe()
77 priv->rst); in uniphier_glue_reset_probe()
81 ret = clk_bulk_prepare_enable(priv->data->nclks, priv->clk); in uniphier_glue_reset_probe()
89 ret = reset_control_bulk_deassert(priv->data->nrsts, priv->rst); in uniphier_glue_reset_probe()
97 spin_lock_init(&priv->rdata.lock); in uniphier_glue_reset_probe()
98 priv->rdata.rcdev.owner = THIS_MODULE; in uniphier_glue_reset_probe()
99 priv->rdata.rcdev.nr_resets = size * BITS_PER_BYTE; in uniphier_glue_reset_probe()
100 priv->rdata.rcdev.ops = &reset_simple_ops; in uniphier_glue_reset_probe()
101 priv->rdata.rcdev.of_node = dev->of_node; in uniphier_glue_reset_probe()
102 priv->rdata.active_low = true; in uniphier_glue_reset_probe()
106 return devm_reset_controller_register(dev, &priv->rdata.rcdev); in uniphier_glue_reset_probe()
133 .compatible = "socionext,uniphier-pro4-usb3-reset",
137 .compatible = "socionext,uniphier-pro5-usb3-reset",
141 .compatible = "socionext,uniphier-pxs2-usb3-reset",
145 .compatible = "socionext,uniphier-ld20-usb3-reset",
149 .compatible = "socionext,uniphier-pxs3-usb3-reset",
153 .compatible = "socionext,uniphier-nx1-usb3-reset",
157 .compatible = "socionext,uniphier-pro4-ahci-reset",
161 .compatible = "socionext,uniphier-pxs2-ahci-reset",
165 .compatible = "socionext,uniphier-pxs3-ahci-reset",
175 .name = "uniphier-glue-reset",
182 MODULE_DESCRIPTION("UniPhier Glue layer reset driver");