Lines Matching +full:no +full:- +full:reset +full:- +full:on +full:- +full:init

1 // SPDX-License-Identifier: GPL-2.0-or-later
16 #include <linux/init.h>
24 #include <linux/reset.h>
36 struct reset_control *reset; member
55 struct reset_control *reset; in of_syscon_register() local
59 return ERR_PTR(-ENOMEM); in of_syscon_register()
62 return ERR_PTR(-ENOMEM); in of_syscon_register()
66 return ERR_PTR(-ENOMEM); in of_syscon_register()
69 if (of_property_read_bool(np, "big-endian")) in of_syscon_register()
71 else if (of_property_read_bool(np, "little-endian")) in of_syscon_register()
73 else if (of_property_read_bool(np, "native-endian")) in of_syscon_register()
77 * search for reg-io-width property in DT. If it is not provided, in of_syscon_register()
79 * are invalid so there is no need to check them here. in of_syscon_register()
81 ret = of_property_read_u32(np, "reg-io-width", &reg_io_width); in of_syscon_register()
92 case -ENOENT: in of_syscon_register()
98 case -EPROBE_DEFER: in of_syscon_register()
105 ret = -ENOMEM; in of_syscon_register()
110 syscon_config.max_register = resource_size(&res) - reg_io_width; in of_syscon_register()
115 pr_err("regmap init failed\n"); in of_syscon_register()
125 if (ret != -ENOENT) in of_syscon_register()
133 reset = of_reset_control_get_optional_exclusive(np, NULL); in of_syscon_register()
134 if (IS_ERR(reset)) { in of_syscon_register()
135 ret = PTR_ERR(reset); in of_syscon_register()
139 ret = reset_control_deassert(reset); in of_syscon_register()
144 syscon->regmap = regmap; in of_syscon_register()
145 syscon->np = np; in of_syscon_register()
148 list_add_tail(&syscon->list, &syscon_list); in of_syscon_register()
154 reset_control_put(reset); in of_syscon_register()
173 if (entry->np == np) { in device_node_get_regmap()
186 return syscon->regmap; in device_node_get_regmap()
190 * of_syscon_register_regmap() - Register regmap for specified device node
198 * Return: 0 on success, negative error code on failure.
206 return -EINVAL; in of_syscon_register_regmap()
210 return -ENOMEM; in of_syscon_register_regmap()
216 if (entry->np == np) { in of_syscon_register_regmap()
217 ret = -EEXIST; in of_syscon_register_regmap()
221 syscon->regmap = regmap; in of_syscon_register_regmap()
222 syscon->np = np; in of_syscon_register_regmap()
225 list_add_tail(&syscon->list, &syscon_list); in of_syscon_register_regmap()
246 return ERR_PTR(-EINVAL); in syscon_node_to_regmap()
259 return ERR_PTR(-ENODEV); in syscon_regmap_lookup_by_compatible()
280 return ERR_PTR(-ENODEV); in syscon_regmap_lookup_by_phandle()
309 return ERR_PTR(-ENODEV); in syscon_regmap_lookup_by_phandle_args()
322 * there is no regmap phandle. In this case, instead of returning -ENODEV,
331 if (IS_ERR(regmap) && PTR_ERR(regmap) == -ENODEV) in syscon_regmap_lookup_by_phandle_optional()
340 struct device *dev = &pdev->dev; in syscon_probe()
349 return -ENOMEM; in syscon_probe()
353 return -ENOENT; in syscon_probe()
355 base = devm_ioremap(dev, res->start, resource_size(res)); in syscon_probe()
357 return -ENOMEM; in syscon_probe()
359 syscon_config.max_register = resource_size(res) - 4; in syscon_probe()
361 syscon_config.name = pdata->label; in syscon_probe()
362 syscon->regmap = devm_regmap_init_mmio(dev, base, &syscon_config); in syscon_probe()
363 if (IS_ERR(syscon->regmap)) { in syscon_probe()
364 dev_err(dev, "regmap init failed\n"); in syscon_probe()
365 return PTR_ERR(syscon->regmap); in syscon_probe()