Lines Matching refs:rc
66 int rc; in stk1160_i2c_write_reg() local
69 rc = stk1160_write_reg(dev, STK1160_SICTL_SDA, addr); in stk1160_i2c_write_reg()
70 if (rc < 0) in stk1160_i2c_write_reg()
71 return rc; in stk1160_i2c_write_reg()
74 rc = stk1160_write_reg(dev, STK1160_SBUSW_WA, reg); in stk1160_i2c_write_reg()
75 if (rc < 0) in stk1160_i2c_write_reg()
76 return rc; in stk1160_i2c_write_reg()
79 rc = stk1160_write_reg(dev, STK1160_SBUSW_WD, value); in stk1160_i2c_write_reg()
80 if (rc < 0) in stk1160_i2c_write_reg()
81 return rc; in stk1160_i2c_write_reg()
84 rc = stk1160_write_reg(dev, STK1160_SICTL, 0x01); in stk1160_i2c_write_reg()
85 if (rc < 0) in stk1160_i2c_write_reg()
86 return rc; in stk1160_i2c_write_reg()
88 rc = stk1160_i2c_busy_wait(dev, 0x04); in stk1160_i2c_write_reg()
89 if (rc < 0) in stk1160_i2c_write_reg()
90 return rc; in stk1160_i2c_write_reg()
98 int rc; in stk1160_i2c_read_reg() local
101 rc = stk1160_write_reg(dev, STK1160_SICTL_SDA, addr); in stk1160_i2c_read_reg()
102 if (rc < 0) in stk1160_i2c_read_reg()
103 return rc; in stk1160_i2c_read_reg()
106 rc = stk1160_write_reg(dev, STK1160_SBUSR_RA, reg); in stk1160_i2c_read_reg()
107 if (rc < 0) in stk1160_i2c_read_reg()
108 return rc; in stk1160_i2c_read_reg()
111 rc = stk1160_write_reg(dev, STK1160_SICTL, 0x20); in stk1160_i2c_read_reg()
112 if (rc < 0) in stk1160_i2c_read_reg()
113 return rc; in stk1160_i2c_read_reg()
115 rc = stk1160_i2c_busy_wait(dev, 0x01); in stk1160_i2c_read_reg()
116 if (rc < 0) in stk1160_i2c_read_reg()
117 return rc; in stk1160_i2c_read_reg()
119 rc = stk1160_read_reg(dev, STK1160_SBUSR_RD, value); in stk1160_i2c_read_reg()
120 if (rc < 0) in stk1160_i2c_read_reg()
121 return rc; in stk1160_i2c_read_reg()
133 int rc; in stk1160_i2c_check_for_device() local
136 rc = stk1160_write_reg(dev, STK1160_SICTL_SDA, addr); in stk1160_i2c_check_for_device()
137 if (rc < 0) in stk1160_i2c_check_for_device()
138 return rc; in stk1160_i2c_check_for_device()
141 rc = stk1160_write_reg(dev, STK1160_SBUSR_RA, 0x00); in stk1160_i2c_check_for_device()
142 if (rc < 0) in stk1160_i2c_check_for_device()
143 return rc; in stk1160_i2c_check_for_device()
146 rc = stk1160_write_reg(dev, STK1160_SICTL, 0x20); in stk1160_i2c_check_for_device()
147 if (rc < 0) in stk1160_i2c_check_for_device()
148 return rc; in stk1160_i2c_check_for_device()
150 rc = stk1160_i2c_busy_wait(dev, 0x01); in stk1160_i2c_check_for_device()
151 if (rc < 0) in stk1160_i2c_check_for_device()
165 int addr, rc, i; in stk1160_i2c_xfer() local
173 rc = stk1160_i2c_check_for_device(dev, addr); in stk1160_i2c_xfer()
174 if (rc < 0) { in stk1160_i2c_xfer()
176 return rc; in stk1160_i2c_xfer()
182 rc = -EOPNOTSUPP; in stk1160_i2c_xfer()
191 rc = -EOPNOTSUPP; in stk1160_i2c_xfer()
197 rc = stk1160_i2c_read_reg(dev, addr, msgs[i].buf[0], in stk1160_i2c_xfer()
208 rc = -EOPNOTSUPP; in stk1160_i2c_xfer()
215 rc = stk1160_i2c_write_reg(dev, addr, msgs[i].buf[0], in stk1160_i2c_xfer()
219 if (rc < 0) in stk1160_i2c_xfer()
226 dprintk_i2c(" ERROR: %d\n", rc); in stk1160_i2c_xfer()
259 int rc; in stk1160_i2c_register() local
268 rc = i2c_add_adapter(&dev->i2c_adap); in stk1160_i2c_register()
269 if (rc < 0) { in stk1160_i2c_register()
270 stk1160_err("cannot add i2c adapter (%d)\n", rc); in stk1160_i2c_register()
271 return rc; in stk1160_i2c_register()