Lines Matching +full:reset +full:- +full:assert +full:- +full:us
1 // SPDX-License-Identifier: GPL-2.0-only
5 * i.MX7 System Reset Controller (SRC) driver
14 #include <linux/reset-controller.h>
16 #include <dt-bindings/reset/imx7-reset.h>
17 #include <dt-bindings/reset/imx8mq-reset.h>
18 #include <dt-bindings/reset/imx8mp-reset.h>
51 const struct imx7_src_signal *signal = &imx7src->signals[id]; in imx7_reset_update()
53 return regmap_update_bits(imx7src->regmap, in imx7_reset_update()
54 signal->offset, signal->bit, value); in imx7_reset_update()
92 unsigned long id, bool assert) in imx7_reset_set() argument
95 const unsigned int bit = imx7src->signals[id].bit; in imx7_reset_set()
96 unsigned int value = assert ? bit : 0; in imx7_reset_set()
101 * wait for more than 10us to release phy g_rst and in imx7_reset_set()
104 if (!assert) in imx7_reset_set()
109 value = assert ? 0 : bit; in imx7_reset_set()
132 .assert = imx7_reset_assert,
220 unsigned long id, bool assert) in imx8mq_reset_set() argument
223 const unsigned int bit = imx7src->signals[id].bit; in imx8mq_reset_set()
224 unsigned int value = assert ? bit : 0; in imx8mq_reset_set()
230 * wait for more than 10us to release phy g_rst and in imx8mq_reset_set()
233 if (!assert) in imx8mq_reset_set()
245 value = assert ? 0 : bit; in imx8mq_reset_set()
268 .assert = imx8mq_reset_assert,
315 unsigned long id, bool assert) in imx8mp_reset_set() argument
318 const unsigned int bit = imx7src->signals[id].bit; in imx8mp_reset_set()
319 unsigned int value = assert ? bit : 0; in imx8mp_reset_set()
324 * wait for more than 10us to release phy g_rst and in imx8mp_reset_set()
327 if (!assert) in imx8mp_reset_set()
332 value = assert ? 0 : bit; in imx8mp_reset_set()
355 .assert = imx8mp_reset_assert,
363 struct device *dev = &pdev->dev; in imx7_reset_probe()
369 return -ENOMEM; in imx7_reset_probe()
371 imx7src->signals = variant->signals; in imx7_reset_probe()
372 imx7src->regmap = syscon_node_to_regmap(dev->of_node); in imx7_reset_probe()
373 if (IS_ERR(imx7src->regmap)) { in imx7_reset_probe()
374 dev_err(dev, "Unable to get imx7-src regmap"); in imx7_reset_probe()
375 return PTR_ERR(imx7src->regmap); in imx7_reset_probe()
377 regmap_attach_dev(dev, imx7src->regmap, &config); in imx7_reset_probe()
379 imx7src->rcdev.owner = THIS_MODULE; in imx7_reset_probe()
380 imx7src->rcdev.nr_resets = variant->signals_num; in imx7_reset_probe()
381 imx7src->rcdev.ops = &variant->ops; in imx7_reset_probe()
382 imx7src->rcdev.of_node = dev->of_node; in imx7_reset_probe()
384 return devm_reset_controller_register(dev, &imx7src->rcdev); in imx7_reset_probe()
388 { .compatible = "fsl,imx7d-src", .data = &variant_imx7 },
389 { .compatible = "fsl,imx8mq-src", .data = &variant_imx8mq },
390 { .compatible = "fsl,imx8mp-src", .data = &variant_imx8mp },
405 MODULE_DESCRIPTION("NXP i.MX7 reset driver");