Lines Matching +full:rst +full:- +full:syscon
1 // SPDX-License-Identifier: GPL-2.0-or-later
7 #include <linux/reset-controller.h>
9 #include <linux/mfd/syscon.h>
11 #include <soc/canaan/k210-sysctl.h>
13 #include <dt-bindings/reset/k210-rst.h>
33 return regmap_update_bits(ksr->map, K210_SYSCTL_PERI_RESET, BIT(id), 1); in k210_rst_assert()
41 return regmap_update_bits(ksr->map, K210_SYSCTL_PERI_RESET, BIT(id), 0); in k210_rst_deassert()
65 ret = regmap_read(ksr->map, K210_SYSCTL_PERI_RESET, ®); in k210_rst_status()
75 unsigned long id = reset_spec->args[0]; in k210_rst_xlate()
78 return -EINVAL; in k210_rst_xlate()
92 struct device *dev = &pdev->dev; in k210_rst_probe()
100 return -ENOMEM; in k210_rst_probe()
102 parent_np = of_get_parent(dev->of_node); in k210_rst_probe()
103 ksr->map = syscon_node_to_regmap(parent_np); in k210_rst_probe()
105 if (IS_ERR(ksr->map)) in k210_rst_probe()
106 return PTR_ERR(ksr->map); in k210_rst_probe()
108 ksr->rcdev.owner = THIS_MODULE; in k210_rst_probe()
109 ksr->rcdev.dev = dev; in k210_rst_probe()
110 ksr->rcdev.of_node = dev->of_node; in k210_rst_probe()
111 ksr->rcdev.ops = &k210_rst_ops; in k210_rst_probe()
112 ksr->rcdev.nr_resets = fls(K210_RST_MASK); in k210_rst_probe()
113 ksr->rcdev.of_reset_n_cells = 1; in k210_rst_probe()
114 ksr->rcdev.of_xlate = k210_rst_xlate; in k210_rst_probe()
116 return devm_reset_controller_register(dev, &ksr->rcdev); in k210_rst_probe()
120 { .compatible = "canaan,k210-rst" },
127 .name = "k210-rst",