Lines Matching +full:device +full:- +full:unique
3 * Texas Instruments Incorporated - http://www.ti.com/
4 * SPDX-License-Identifier: GPL-2.0+
13 #include <dm/device-internal.h>
16 #include <dm/uclass-internal.h>
21 * for_each_remoteproc_device() - iterate through the list of rproc devices
24 * @skip_dev: Device to skip calling the callback about.
54 * _rproc_name_is_unique() - iteration helper to check if rproc name is unique
55 * @dev: device that we are checking name for
57 * @data: compare data (this is the name we want to ensure is unique)
59 * Return: 0 is there is no match(is unique); if there is a match(we dont
60 * have a unique name), return -EINVAL.
68 /* devices not yet populated with data - so skip them */ in _rproc_name_is_unique()
69 if (!uc_pdata->name || !check_name) in _rproc_name_is_unique()
73 if (strlen(uc_pdata->name) != strlen(check_name)) in _rproc_name_is_unique()
76 if (!strcmp(uc_pdata->name, check_name)) in _rproc_name_is_unique()
77 return -EINVAL; in _rproc_name_is_unique()
83 * rproc_name_is_unique() - Check if the rproc name is unique
84 * @check_dev: Device we are attempting to ensure is unique
85 * @check_name: Name we are trying to ensure is unique.
87 * Return: true if we have a unique name, false if name is not unique.
100 * rproc_pre_probe() - Pre probe accessor for the uclass
101 * @dev: device for which we are preprobing
117 if (!dev->platdata) { in rproc_pre_probe()
120 const void *blob = gd->fdt_blob; in rproc_pre_probe()
123 debug("'%s' no dt?\n", dev->name); in rproc_pre_probe()
124 return -EINVAL; in rproc_pre_probe()
126 debug("'%s': using fdt\n", dev->name); in rproc_pre_probe()
127 uc_pdata->name = fdt_getprop(blob, node, in rproc_pre_probe()
128 "remoteproc-name", NULL); in rproc_pre_probe()
131 uc_pdata->mem_type = RPROC_INTERNAL_MEMORY_MAPPED; in rproc_pre_probe()
133 "remoteproc-internal-memory-mapped"); in rproc_pre_probe()
135 uc_pdata->mem_type = RPROC_INTERNAL_MEMORY_MAPPED; in rproc_pre_probe()
138 return -EINVAL; in rproc_pre_probe()
142 struct dm_rproc_uclass_pdata *pdata = dev->platdata; in rproc_pre_probe()
144 debug("'%s': using legacy data\n", dev->name); in rproc_pre_probe()
145 if (pdata->name) in rproc_pre_probe()
146 uc_pdata->name = pdata->name; in rproc_pre_probe()
147 uc_pdata->mem_type = pdata->mem_type; in rproc_pre_probe()
148 uc_pdata->driver_plat_data = pdata->driver_plat_data; in rproc_pre_probe()
151 /* Else try using device Name */ in rproc_pre_probe()
152 if (!uc_pdata->name) in rproc_pre_probe()
153 uc_pdata->name = dev->name; in rproc_pre_probe()
154 if (!uc_pdata->name) { in rproc_pre_probe()
155 debug("Unnamed device!"); in rproc_pre_probe()
156 return -EINVAL; in rproc_pre_probe()
159 if (!rproc_name_is_unique(dev, uc_pdata->name)) { in rproc_pre_probe()
160 debug("%s duplicate name '%s'\n", dev->name, uc_pdata->name); in rproc_pre_probe()
161 return -EINVAL; in rproc_pre_probe()
166 debug("%s driver has no ops?\n", dev->name); in rproc_pre_probe()
167 return -EINVAL; in rproc_pre_probe()
170 if (!ops->load || !ops->start) { in rproc_pre_probe()
171 debug("%s driver has missing mandatory ops?\n", dev->name); in rproc_pre_probe()
172 return -EINVAL; in rproc_pre_probe()
179 * rproc_post_probe() - post probe accessor for the uclass
196 debug("%s driver has no ops?\n", dev->name); in rproc_post_probe()
197 return -EINVAL; in rproc_post_probe()
200 if (ops->init) in rproc_post_probe()
201 return ops->init(dev); in rproc_post_probe()
218 * _rproc_probe_dev() - iteration helper to probe a rproc device
219 * @dev: device to probe
220 * @uc_pdata: uclass data allocated for the device
234 debug("%s: Failed to initialize - %d\n", dev->name, ret); in _rproc_probe_dev()
239 * _rproc_dev_is_probed() - check if the device has been probed
240 * @dev: device to check
244 * Return: -EAGAIN if not probed else return 0
250 if (dev->flags & DM_FLAG_ACTIVATED) in _rproc_dev_is_probed()
253 return -EAGAIN; in _rproc_dev_is_probed()
268 return -EINVAL; in rproc_init()
293 debug("%s driver has no ops?\n", dev->name); in rproc_load()
294 return -EINVAL; in rproc_load()
298 uc_pdata->name, addr, size); in rproc_load()
299 if (ops->load) in rproc_load()
300 return ops->load(dev, addr, size); in rproc_load()
303 dev->name); in rproc_load()
305 return -EINVAL; in rproc_load()
322 * _rproc_ops_wrapper() - wrapper for invoking remote proc driver callback
353 debug("%s driver has no ops?\n", dev->name); in _rproc_ops_wrapper()
354 return -EINVAL; in _rproc_ops_wrapper()
358 fn = ops->start; in _rproc_ops_wrapper()
363 fn = ops->stop; in _rproc_ops_wrapper()
367 fn = ops->reset; in _rproc_ops_wrapper()
371 fn = ops->is_running; in _rproc_ops_wrapper()
375 fn = ops->ping; in _rproc_ops_wrapper()
380 return -EINVAL; in _rproc_ops_wrapper()
383 debug("%s %s...\n", op_str, uc_pdata->name); in _rproc_ops_wrapper()
389 dev->name); in _rproc_ops_wrapper()
391 return -ENOSYS; in _rproc_ops_wrapper()