Lines Matching refs:off
44 static bool check_address_valid(int usid, int pid, int off) in check_address_valid() argument
50 if (off > EMUL_GPIO_REG_END) in check_address_valid()
55 static int sandbox_spmi_write(struct udevice *dev, int usid, int pid, int off, in sandbox_spmi_write() argument
61 if (!check_address_valid(usid, pid, off)) in sandbox_spmi_write()
66 switch (off) { in sandbox_spmi_write()
68 val &= regs[off].access_mask; in sandbox_spmi_write()
76 if (regs[off].perms & EMUL_PERM_W) in sandbox_spmi_write()
77 regs[off].value = val & regs[off].access_mask; in sandbox_spmi_write()
82 static int sandbox_spmi_read(struct udevice *dev, int usid, int pid, int off) in sandbox_spmi_read() argument
87 if (!check_address_valid(usid, pid, off)) in sandbox_spmi_read()
95 switch (off) { in sandbox_spmi_read()
99 return regs[off].value; in sandbox_spmi_read()
101 if (regs[off].perms & EMUL_PERM_R) in sandbox_spmi_read()
102 return regs[off].value; in sandbox_spmi_read()