mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 08:42:12 +02:00
dm: syscon: Allow finding devices by driver data
We have a way to find a regmap by its syscon driver data value. Add the same for syscon itself. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
@@ -32,6 +32,20 @@ struct syscon_ops {
|
||||
*/
|
||||
struct regmap *syscon_get_regmap(struct udevice *dev);
|
||||
|
||||
/**
|
||||
* syscon_get_regmap_by_driver_data() - Look up a controller by its ID
|
||||
*
|
||||
* Each system controller can be accessed by its driver data, which is
|
||||
* assumed to be unique through the scope of all system controllers that
|
||||
* are in use. This function looks up the controller given this driver data.
|
||||
*
|
||||
* @driver_data: Driver data value to look up
|
||||
* @devp: Returns the controller correponding to @driver_data
|
||||
* @return 0 on success, -ENODEV if the ID was not found, or other -ve error
|
||||
* code
|
||||
*/
|
||||
int syscon_get_by_driver_data(ulong driver_data, struct udevice **devp);
|
||||
|
||||
/**
|
||||
* syscon_get_regmap_by_driver_data() - Look up a controller by its ID
|
||||
*
|
||||
|
Reference in New Issue
Block a user