2 * SPMI bus uclass driver
4 * (C) Copyright 2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
6 * SPDX-License-Identifier: GPL-2.0+
12 #include <spmi/spmi.h>
13 #include <linux/ctype.h>
15 DECLARE_GLOBAL_DATA_PTR;
17 int spmi_reg_read(struct udevice *dev, int usid, int pid, int reg)
19 const struct dm_spmi_ops *ops = dev_get_driver_ops(dev);
21 if (!ops || !ops->read)
24 return ops->read(dev, usid, pid, reg);
27 int spmi_reg_write(struct udevice *dev, int usid, int pid, int reg,
30 const struct dm_spmi_ops *ops = dev_get_driver_ops(dev);
32 if (!ops || !ops->write)
35 return ops->write(dev, usid, pid, reg, value);
38 UCLASS_DRIVER(spmi) = {
41 .post_bind = dm_scan_fdt_dev,