Lines Matching +full:rst +full:- +full:syscon
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (c) 2016-2017 Linaro Ltd.
4 * Copyright (c) 2016-2017 HiSilicon Technologies Co., Ltd.
7 #include <linux/mfd/syscon.h>
12 #include <linux/reset-controller.h>
15 struct reset_controller_dev rst; member
20 container_of(_rst, struct hi3660_reset_controller, rst)
30 return regmap_write(rc->map, offset, mask); in hi3660_reset_program_hw()
32 return regmap_write(rc->map, offset + 4, mask); in hi3660_reset_program_hw()
70 offset = reset_spec->args[0]; in hi3660_reset_xlate()
71 bit = reset_spec->args[1]; in hi3660_reset_xlate()
79 struct device_node *np = pdev->dev.of_node; in hi3660_reset_probe()
80 struct device *dev = &pdev->dev; in hi3660_reset_probe()
84 return -ENOMEM; in hi3660_reset_probe()
86 rc->map = syscon_regmap_lookup_by_phandle(np, "hisilicon,rst-syscon"); in hi3660_reset_probe()
87 if (rc->map == ERR_PTR(-ENODEV)) { in hi3660_reset_probe()
89 rc->map = syscon_regmap_lookup_by_phandle(np, in hi3660_reset_probe()
90 "hisi,rst-syscon"); in hi3660_reset_probe()
92 if (IS_ERR(rc->map)) { in hi3660_reset_probe()
93 return dev_err_probe(dev, PTR_ERR(rc->map), in hi3660_reset_probe()
94 "failed to get hisilicon,rst-syscon\n"); in hi3660_reset_probe()
97 rc->rst.ops = &hi3660_reset_ops, in hi3660_reset_probe()
98 rc->rst.of_node = np; in hi3660_reset_probe()
99 rc->rst.of_reset_n_cells = 2; in hi3660_reset_probe()
100 rc->rst.of_xlate = hi3660_reset_xlate; in hi3660_reset_probe()
102 return reset_controller_register(&rc->rst); in hi3660_reset_probe()
106 { .compatible = "hisilicon,hi3660-reset", },
114 .name = "hi3660-reset",
126 MODULE_ALIAS("platform:hi3660-reset");