2 * SPMI bus uclass driver
4 * (C) Copyright 2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
6 * SPDX-License-Identifier: GPL-2.0+
13 #include <spmi/spmi.h>
14 #include <linux/ctype.h>
16 DECLARE_GLOBAL_DATA_PTR;
18 int spmi_reg_read(struct udevice *dev, int usid, int pid, int reg)
20 const struct dm_spmi_ops *ops = dev_get_driver_ops(dev);
22 if (!ops || !ops->read)
25 return ops->read(dev, usid, pid, reg);
28 int spmi_reg_write(struct udevice *dev, int usid, int pid, int reg,
31 const struct dm_spmi_ops *ops = dev_get_driver_ops(dev);
33 if (!ops || !ops->write)
36 return ops->write(dev, usid, pid, reg, value);
39 static int spmi_post_bind(struct udevice *dev)
41 return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
44 UCLASS_DRIVER(spmi) = {
47 .post_bind = spmi_post_bind,