diff options
author | Jean-Jacques Hiblot | 2018-11-29 10:57:37 +0100 |
---|---|---|
committer | Marek Vasut | 2018-12-07 16:31:45 +0100 |
commit | 6c3af1f24e4b8ccbef20bc00b9529f4a325583f2 (patch) | |
tree | 534081dec42ca033d3e9737965804d6d1ebe02e4 /include | |
parent | 4d3825c1915e1649c4be0320e74be158e4698655 (diff) |
syscon: dm: Add a new method to get a regmap from DTS
syscon_regmap_lookup_by_phandle() can be used to get the regmap of a syscon
device from a reference in the DTS. It operates similarly to the linux
version of the namesake function.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/syscon.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/syscon.h b/include/syscon.h index 2aa73e520af..3df96e32764 100644 --- a/include/syscon.h +++ b/include/syscon.h @@ -74,6 +74,19 @@ int syscon_get_by_driver_data(ulong driver_data, struct udevice **devp); struct regmap *syscon_get_regmap_by_driver_data(ulong driver_data); /** + * syscon_regmap_lookup_by_phandle() - Look up a controller by a phandle + * + * This operates by looking up the given name in the device (device + * tree property) of the device using the system controller. + * + * @dev: Device using the system controller + * @name: Name of property referring to the system controller + * @return A pointer to the regmap if found, ERR_PTR(-ve) on error + */ +struct regmap *syscon_regmap_lookup_by_phandle(struct udevice *dev, + const char *name); + +/** * syscon_get_first_range() - get the first memory range from a syscon regmap * * @driver_data: Driver data value to look up |