Lines Matching defs:ret
62 int ret;
66 ret = wait_for_state(ccsr_i2c, I2C_SR_IF, I2C_SR_IF);
67 if (ret < 0) {
69 return ret;
71 if (ret & I2C_SR_RX_NAK) {
82 int ret;
87 ret = wait_for_state(ccsr_i2c, I2C_SR_IDLE, I2C_SR_BB);
88 if (ret < 0) {
91 return ret;
97 int ret;
110 ret = wait_for_state(ccsr_i2c, I2C_SR_IDLE, I2C_SR_BB);
111 if (ret < 0) {
112 return ret;
118 ret = wait_for_state(ccsr_i2c, I2C_SR_BB, I2C_SR_BB);
119 if (ret < 0) {
120 return ret;
126 ret = tx_byte(ccsr_i2c, chip << 1);
127 if (ret < 0) {
129 return ret;
134 ret = tx_byte(ccsr_i2c, (addr >> (alen << 3)) & 0xff);
135 if (ret < 0) {
137 return ret;
148 int ret;
160 ret = wait_for_state(ccsr_i2c, I2C_SR_IF, I2C_SR_IF);
161 if (ret < 0) {
163 return ret;
186 int ret;
189 ret = tx_byte(ccsr_i2c, buf[i]);
190 if (ret < 0) {
194 ret = gen_stop(ccsr_i2c);
196 return ret;
203 int ret;
207 ret = i2c_write_addr(ccsr_i2c, chip, addr, alen);
208 if (ret < 0) {
210 return ret;
217 ret = tx_byte(ccsr_i2c, (chip << 1) | 1);
218 if (ret < 0) {
220 return ret;
229 int ret;
232 ret = i2c_write_addr(ccsr_i2c, chip, addr, alen);
233 if (ret < 0) {
234 return ret;
242 int ret;
245 ret = i2c_write_addr(ccsr_i2c, chip, 0, 0);
246 if (ret < 0) {
248 return ret;
251 ret = gen_stop(ccsr_i2c);
252 if (ret < 0) {
256 return ret;