Lines Matching +full:controller +full:- +full:data
1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2019-2021 ARM Ltd.
11 #include <linux/reset-controller.h>
17 * struct scmi_reset_data - reset controller information structure
18 * @rcdev: reset controller entity
19 * @ph: ARM SCMI protocol handle used for communication with system controller
27 #define to_scmi_handle(p) (to_scmi_reset_data(p)->ph)
30 * scmi_reset_assert() - assert device reset
31 * @rcdev: reset controller entity
44 return reset_ops->assert(ph, id); in scmi_reset_assert()
48 * scmi_reset_deassert() - deassert device reset
49 * @rcdev: reset controller entity
62 return reset_ops->deassert(ph, id); in scmi_reset_deassert()
66 * scmi_reset_reset() - reset the device
67 * @rcdev: reset controller entity
80 return reset_ops->reset(ph, id); in scmi_reset_reset()
91 struct scmi_reset_data *data; in scmi_reset_probe() local
92 struct device *dev = &sdev->dev; in scmi_reset_probe()
93 struct device_node *np = dev->of_node; in scmi_reset_probe()
94 const struct scmi_handle *handle = sdev->handle; in scmi_reset_probe()
98 return -ENODEV; in scmi_reset_probe()
100 reset_ops = handle->devm_protocol_get(sdev, SCMI_PROTOCOL_RESET, &ph); in scmi_reset_probe()
104 data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); in scmi_reset_probe()
105 if (!data) in scmi_reset_probe()
106 return -ENOMEM; in scmi_reset_probe()
108 data->rcdev.ops = &scmi_reset_ops; in scmi_reset_probe()
109 data->rcdev.owner = THIS_MODULE; in scmi_reset_probe()
110 data->rcdev.of_node = np; in scmi_reset_probe()
111 data->rcdev.nr_resets = reset_ops->num_domains_get(ph); in scmi_reset_probe()
112 data->ph = ph; in scmi_reset_probe()
114 return devm_reset_controller_register(dev, &data->rcdev); in scmi_reset_probe()
124 .name = "scmi-reset",
131 MODULE_DESCRIPTION("ARM SCMI reset controller driver");