5 * struct dm_spmi_ops - SPMI device I/O interface
7 * Should be implemented by UCLASS_SPMI device drivers. The standard
8 * device operations provides the I/O interface for it's childs.
10 * @read: read register 'reg' of slave 'usid' and peripheral 'pid'
11 * @write: write register 'reg' of slave 'usid' and peripheral 'pid'
13 * Each register is 8-bit, both read and write can return negative values
17 int (*read)(struct udevice *dev, void *buf, int usid, int pid, int reg,
19 int (*write)(struct udevice *dev, const void *buf, int usid, int pid,
24 * spmi_reg_read() - read a register from specific slave/peripheral
26 * @dev: SPMI bus to read
29 * @reg: Register to read
30 * @return value read on success or negative value of errno.
32 int spmi_reg_read(struct udevice *dev, int usid, int pid, int reg);
35 * spmi_reg_write() - write a register of specific slave/peripheral
37 * @dev: SPMI bus to write
40 * @reg: Register to write
41 * @value: Value to write
42 * @return 0 on success or negative value of errno.
44 int spmi_reg_write(struct udevice *dev, int usid, int pid, int reg,
48 * spmi_read() - read a range of registers from specific slave/peripheral
50 * @dev: SPMI bus to read
53 * @reg: Register to read
54 * @len: Byte count to read
55 * @return value read on success or negative value of errno.
57 int spmi_read(struct udevice *dev, void *buf, int usid, int pid, int reg,
61 * spmi_write() - write to a range of registers of specific slave/peripheral
63 * @dev: SPMI bus to write
66 * @reg: Register to write
67 * @value: Value to write
68 * @len: Byte count to write
69 * @return 0 on success or negative value of errno.
71 int spmi_write(struct udevice *dev, const void *buf, int usid, int pid,
72 int reg, uint8_t len);