Lines Matching refs:regs
59 struct sandbox_emul_fake_regs *regs; in sandbox_spmi_write() local
64 regs = priv->gpios[pid & 0x3].r; /* Last 3 bits of pid are gpio # */ in sandbox_spmi_write()
68 val &= regs[off].access_mask; in sandbox_spmi_write()
71 regs[0x8].value &= ~0x1; in sandbox_spmi_write()
72 regs[0x8].value |= val & 0x1; 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()
85 struct sandbox_emul_fake_regs *regs; in sandbox_spmi_read() local
90 regs = priv->gpios[pid & 0x3].r; /* Last 3 bits of pid are gpio # */ in sandbox_spmi_read()
92 if (regs[0x46].value == 0) /* Block disabled */ in sandbox_spmi_read()
97 if (regs[0x46].value == 0) /* Block disabled */ 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()
119 struct sandbox_emul_fake_regs *regs = priv->gpios[i].r; in sandbox_spmi_probe() local
120 regs[4].perms = EMUL_PERM_R; in sandbox_spmi_probe()
121 regs[4].value = 0x10; in sandbox_spmi_probe()
122 regs[5].perms = EMUL_PERM_R; in sandbox_spmi_probe()
123 regs[5].value = 0x5; in sandbox_spmi_probe()
124 regs[8].access_mask = 0x81; in sandbox_spmi_probe()
125 regs[8].perms = EMUL_PERM_RW; in sandbox_spmi_probe()
126 regs[0x40].access_mask = 0x7F; in sandbox_spmi_probe()
127 regs[0x40].perms = EMUL_PERM_RW; in sandbox_spmi_probe()
128 regs[0x41].access_mask = 7; in sandbox_spmi_probe()
129 regs[0x41].perms = EMUL_PERM_RW; in sandbox_spmi_probe()
130 regs[0x42].access_mask = 7; in sandbox_spmi_probe()
131 regs[0x42].perms = EMUL_PERM_RW; in sandbox_spmi_probe()
132 regs[0x42].value = 0x4; in sandbox_spmi_probe()
133 regs[0x45].access_mask = 0x3F; in sandbox_spmi_probe()
134 regs[0x45].perms = EMUL_PERM_RW; in sandbox_spmi_probe()
135 regs[0x45].value = 0x1; in sandbox_spmi_probe()
136 regs[0x46].access_mask = 0x80; in sandbox_spmi_probe()
137 regs[0x46].perms = EMUL_PERM_RW; in sandbox_spmi_probe()
138 regs[0x46].value = 0x80; in sandbox_spmi_probe()