summaryrefslogtreecommitdiff
path: root/include/linux/spmi.h
diff options
context:
space:
mode:
authorCaleb Connolly <caleb.connolly@linaro.org>2022-04-30 01:08:56 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-06-18 15:48:19 +0300
commit9a2139c2912ea64e288749c21452930dc752d4fd (patch)
tree909b1e94cac85cdb1a7860d1cf080d04a44ba610 /include/linux/spmi.h
parentf2906aa863381afb0015a9eb7fefad885d4e5a56 (diff)
downloadlinux-9a2139c2912ea64e288749c21452930dc752d4fd.tar.xz
spmi: add a helper to look up an SPMI device from a device node
The helper function spmi_device_from_of() takes a device node and returns the SPMI device associated with it. This is like of_find_device_by_node but for SPMI devices. Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org> Acked-by: Stephen Boyd <sboyd@kernel.org> Link: https://lore.kernel.org/r/20220429220904.137297-2-caleb.connolly@linaro.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'include/linux/spmi.h')
-rw-r--r--include/linux/spmi.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/spmi.h b/include/linux/spmi.h
index 729bcbf9f5ad..eac1956a8727 100644
--- a/include/linux/spmi.h
+++ b/include/linux/spmi.h
@@ -164,6 +164,9 @@ static inline void spmi_driver_unregister(struct spmi_driver *sdrv)
module_driver(__spmi_driver, spmi_driver_register, \
spmi_driver_unregister)
+struct device_node;
+
+struct spmi_device *spmi_device_from_of(struct device_node *np);
int spmi_register_read(struct spmi_device *sdev, u8 addr, u8 *buf);
int spmi_ext_register_read(struct spmi_device *sdev, u8 addr, u8 *buf,
size_t len);