Lines Matching refs:ret

27 	int ret;  in m88ds3103_wr_regs()  local
45 ret = i2c_transfer(priv->i2c, msg, 1); in m88ds3103_wr_regs()
47 if (ret == 1) { in m88ds3103_wr_regs()
48 ret = 0; in m88ds3103_wr_regs()
52 KBUILD_MODNAME, ret, reg, len); in m88ds3103_wr_regs()
53 ret = -EREMOTEIO; in m88ds3103_wr_regs()
56 return ret; in m88ds3103_wr_regs()
65 int ret; in m88ds3103_rd_regs() local
85 ret = i2c_transfer(priv->i2c, msg, 2); in m88ds3103_rd_regs()
87 if (ret == 2) { in m88ds3103_rd_regs()
89 ret = 0; in m88ds3103_rd_regs()
93 KBUILD_MODNAME, ret, reg, len); in m88ds3103_rd_regs()
94 ret = -EREMOTEIO; in m88ds3103_rd_regs()
97 return ret; in m88ds3103_rd_regs()
116 int ret; in m88ds3103_wr_reg_mask() local
121 ret = m88ds3103_rd_regs(priv, reg, &u8tmp, 1); in m88ds3103_wr_reg_mask()
122 if (ret) in m88ds3103_wr_reg_mask()
123 return ret; in m88ds3103_wr_reg_mask()
137 int ret, i; in m88ds3103_rd_reg_mask() local
140 ret = m88ds3103_rd_regs(priv, reg, &u8tmp, 1); in m88ds3103_rd_reg_mask()
141 if (ret) in m88ds3103_rd_reg_mask()
142 return ret; in m88ds3103_rd_reg_mask()
160 int ret, i, j; in m88ds3103_wr_reg_val_tab() local
166 ret = -EINVAL; in m88ds3103_wr_reg_val_tab()
175 ret = m88ds3103_wr_regs(priv, tab[i].reg - j, buf, j + 1); in m88ds3103_wr_reg_val_tab()
176 if (ret) in m88ds3103_wr_reg_val_tab()
185 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); in m88ds3103_wr_reg_val_tab()
186 return ret; in m88ds3103_wr_reg_val_tab()
193 int ret; in m88ds3103_read_status() local
199 ret = -EAGAIN; in m88ds3103_read_status()
205 ret = m88ds3103_rd_reg_mask(priv, 0xd1, &u8tmp, 0x07); in m88ds3103_read_status()
206 if (ret) in m88ds3103_read_status()
215 ret = m88ds3103_rd_reg_mask(priv, 0x0d, &u8tmp, 0x8f); in m88ds3103_read_status()
216 if (ret) in m88ds3103_read_status()
227 ret = -EINVAL; in m88ds3103_read_status()
238 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); in m88ds3103_read_status()
239 return ret; in m88ds3103_read_status()
246 int ret, len; in m88ds3103_set_frontend() local
261 ret = -EAGAIN; in m88ds3103_set_frontend()
266 ret = m88ds3103_wr_reg(priv, 0x07, 0x80); in m88ds3103_set_frontend()
267 if (ret) in m88ds3103_set_frontend()
270 ret = m88ds3103_wr_reg(priv, 0x07, 0x00); in m88ds3103_set_frontend()
271 if (ret) in m88ds3103_set_frontend()
276 ret = m88ds3103_wr_reg(priv, 0x06, 0xe0); in m88ds3103_set_frontend()
277 if (ret) in m88ds3103_set_frontend()
283 ret = fe->ops.tuner_ops.set_params(fe); in m88ds3103_set_frontend()
284 if (ret) in m88ds3103_set_frontend()
289 ret = fe->ops.tuner_ops.get_frequency(fe, &tuner_frequency); in m88ds3103_set_frontend()
290 if (ret) in m88ds3103_set_frontend()
314 ret = m88ds3103_wr_reg(priv, 0x06, 0x00); in m88ds3103_set_frontend()
315 if (ret) in m88ds3103_set_frontend()
343 ret = -EINVAL; in m88ds3103_set_frontend()
361 ret = m88ds3103_wr_reg_mask(priv, 0x22, u8tmp1 << 6, 0xc0); in m88ds3103_set_frontend()
362 if (ret) in m88ds3103_set_frontend()
364 ret = m88ds3103_wr_reg_mask(priv, 0x24, u8tmp2 << 6, 0xc0); in m88ds3103_set_frontend()
365 if (ret) in m88ds3103_set_frontend()
369 ret = m88ds3103_wr_reg(priv, 0xb2, 0x01); in m88ds3103_set_frontend()
370 if (ret) in m88ds3103_set_frontend()
373 ret = m88ds3103_wr_reg(priv, 0x00, 0x01); in m88ds3103_set_frontend()
374 if (ret) in m88ds3103_set_frontend()
399 ret = -EINVAL; in m88ds3103_set_frontend()
405 ret = m88ds3103_wr_reg_val_tab(priv, init, len); in m88ds3103_set_frontend()
406 if (ret) in m88ds3103_set_frontend()
413 ret = m88ds3103_wr_reg(priv, 0xc0, 0x04); in m88ds3103_set_frontend()
414 if (ret) in m88ds3103_set_frontend()
419 ret = m88ds3103_wr_regs(priv, 0x8a, buf, 3); in m88ds3103_set_frontend()
420 if (ret) in m88ds3103_set_frontend()
423 ret = m88ds3103_wr_reg_mask(priv, 0x9d, 0x08, 0x08); in m88ds3103_set_frontend()
424 if (ret) in m88ds3103_set_frontend()
426 ret = m88ds3103_wr_reg(priv, 0xf1, 0x01); in m88ds3103_set_frontend()
427 if (ret) in m88ds3103_set_frontend()
429 ret = m88ds3103_wr_reg_mask(priv, 0x30, 0x80, 0x80); in m88ds3103_set_frontend()
430 if (ret) in m88ds3103_set_frontend()
451 ret = -EINVAL; in m88ds3103_set_frontend()
459 ret = m88ds3103_wr_reg(priv, 0xfd, u8tmp); in m88ds3103_set_frontend()
460 if (ret) in m88ds3103_set_frontend()
466 ret = m88ds3103_wr_reg_mask(priv, 0x29, u8tmp1, 0x20); in m88ds3103_set_frontend()
467 if (ret) in m88ds3103_set_frontend()
491 ret = m88ds3103_rd_reg(priv, 0xfe, &u8tmp); in m88ds3103_set_frontend()
492 if (ret) in m88ds3103_set_frontend()
496 ret = m88ds3103_wr_reg(priv, 0xfe, u8tmp); in m88ds3103_set_frontend()
497 if (ret) in m88ds3103_set_frontend()
501 ret = m88ds3103_wr_reg(priv, 0xea, u8tmp); in m88ds3103_set_frontend()
502 if (ret) in m88ds3103_set_frontend()
512 ret = m88ds3103_wr_reg(priv, 0xc3, 0x08); in m88ds3103_set_frontend()
513 if (ret) in m88ds3103_set_frontend()
516 ret = m88ds3103_wr_reg(priv, 0xc8, u8tmp); in m88ds3103_set_frontend()
517 if (ret) in m88ds3103_set_frontend()
520 ret = m88ds3103_wr_reg(priv, 0xc4, 0x08); in m88ds3103_set_frontend()
521 if (ret) in m88ds3103_set_frontend()
524 ret = m88ds3103_wr_reg(priv, 0xc7, 0x00); in m88ds3103_set_frontend()
525 if (ret) in m88ds3103_set_frontend()
531 ret = m88ds3103_wr_regs(priv, 0x61, buf, 2); in m88ds3103_set_frontend()
532 if (ret) in m88ds3103_set_frontend()
535 ret = m88ds3103_wr_reg_mask(priv, 0x4d, priv->cfg->spec_inv << 1, 0x02); in m88ds3103_set_frontend()
536 if (ret) in m88ds3103_set_frontend()
539 ret = m88ds3103_wr_reg_mask(priv, 0x30, priv->cfg->agc_inv << 4, 0x10); in m88ds3103_set_frontend()
540 if (ret) in m88ds3103_set_frontend()
543 ret = m88ds3103_wr_reg(priv, 0x33, priv->cfg->agc); in m88ds3103_set_frontend()
544 if (ret) in m88ds3103_set_frontend()
557 ret = m88ds3103_wr_regs(priv, 0x5e, buf, 2); in m88ds3103_set_frontend()
558 if (ret) in m88ds3103_set_frontend()
561 ret = m88ds3103_wr_reg(priv, 0x00, 0x00); in m88ds3103_set_frontend()
562 if (ret) in m88ds3103_set_frontend()
565 ret = m88ds3103_wr_reg(priv, 0xb2, 0x00); in m88ds3103_set_frontend()
566 if (ret) in m88ds3103_set_frontend()
573 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); in m88ds3103_set_frontend()
574 return ret; in m88ds3103_set_frontend()
580 int ret, len, remaining; in m88ds3103_init() local
591 ret = m88ds3103_wr_reg_mask(priv, 0x08, 0x01, 0x01); in m88ds3103_init()
592 if (ret) in m88ds3103_init()
595 ret = m88ds3103_wr_reg_mask(priv, 0x04, 0x00, 0x01); in m88ds3103_init()
596 if (ret) in m88ds3103_init()
599 ret = m88ds3103_wr_reg_mask(priv, 0x23, 0x00, 0x10); in m88ds3103_init()
600 if (ret) in m88ds3103_init()
604 ret = m88ds3103_rd_reg(priv, 0xb9, &u8tmp); in m88ds3103_init()
605 if (ret) in m88ds3103_init()
614 ret = m88ds3103_wr_reg(priv, 0x07, 0xe0); in m88ds3103_init()
615 if (ret) in m88ds3103_init()
618 ret = m88ds3103_wr_reg(priv, 0x07, 0x00); in m88ds3103_init()
619 if (ret) in m88ds3103_init()
631 ret = request_firmware(&fw, fw_file, priv->i2c->dev.parent); in m88ds3103_init()
632 if (ret) { in m88ds3103_init()
641 ret = m88ds3103_wr_reg(priv, 0xb2, 0x01); in m88ds3103_init()
642 if (ret) in m88ds3103_init()
651 ret = m88ds3103_wr_regs(priv, 0xb0, in m88ds3103_init()
653 if (ret) { in m88ds3103_init()
656 KBUILD_MODNAME, ret); in m88ds3103_init()
661 ret = m88ds3103_wr_reg(priv, 0xb2, 0x00); in m88ds3103_init()
662 if (ret) in m88ds3103_init()
668 ret = m88ds3103_rd_reg(priv, 0xb9, &u8tmp); in m88ds3103_init()
669 if (ret) in m88ds3103_init()
675 ret = -EFAULT; in m88ds3103_init()
693 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); in m88ds3103_init()
694 return ret; in m88ds3103_init()
700 int ret; in m88ds3103_sleep() local
712 ret = m88ds3103_wr_reg_mask(priv, u8tmp, 0x00, 0x01); in m88ds3103_sleep()
713 if (ret) in m88ds3103_sleep()
717 ret = m88ds3103_wr_reg_mask(priv, 0x08, 0x00, 0x01); in m88ds3103_sleep()
718 if (ret) in m88ds3103_sleep()
721 ret = m88ds3103_wr_reg_mask(priv, 0x04, 0x01, 0x01); in m88ds3103_sleep()
722 if (ret) in m88ds3103_sleep()
725 ret = m88ds3103_wr_reg_mask(priv, 0x23, 0x10, 0x10); in m88ds3103_sleep()
726 if (ret) in m88ds3103_sleep()
731 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); in m88ds3103_sleep()
732 return ret; in m88ds3103_sleep()
739 int ret; in m88ds3103_get_frontend() local
745 ret = -EAGAIN; in m88ds3103_get_frontend()
751 ret = m88ds3103_rd_reg(priv, 0xe0, &buf[0]); in m88ds3103_get_frontend()
752 if (ret) in m88ds3103_get_frontend()
755 ret = m88ds3103_rd_reg(priv, 0xe6, &buf[1]); in m88ds3103_get_frontend()
756 if (ret) in m88ds3103_get_frontend()
793 ret = m88ds3103_rd_reg(priv, 0x7e, &buf[0]); in m88ds3103_get_frontend()
794 if (ret) in m88ds3103_get_frontend()
797 ret = m88ds3103_rd_reg(priv, 0x89, &buf[1]); in m88ds3103_get_frontend()
798 if (ret) in m88ds3103_get_frontend()
801 ret = m88ds3103_rd_reg(priv, 0xf2, &buf[2]); in m88ds3103_get_frontend()
802 if (ret) in m88ds3103_get_frontend()
892 ret = -EINVAL; in m88ds3103_get_frontend()
896 ret = m88ds3103_rd_regs(priv, 0x6d, buf, 2); in m88ds3103_get_frontend()
897 if (ret) in m88ds3103_get_frontend()
905 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); in m88ds3103_get_frontend()
906 return ret; in m88ds3103_get_frontend()
913 int ret, i, tmp; in m88ds3103_read_snr() local
929 ret = m88ds3103_rd_reg(priv, 0xff, &buf[0]); in m88ds3103_read_snr()
930 if (ret) in m88ds3103_read_snr()
949 ret = m88ds3103_rd_regs(priv, 0x8c, buf, 3); in m88ds3103_read_snr()
950 if (ret) in m88ds3103_read_snr()
977 ret = -EINVAL; in m88ds3103_read_snr()
983 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); in m88ds3103_read_snr()
984 return ret; in m88ds3103_read_snr()
991 int ret; in m88ds3103_read_ber() local
999 ret = m88ds3103_wr_reg(priv, 0xf9, 0x04); in m88ds3103_read_ber()
1000 if (ret) in m88ds3103_read_ber()
1003 ret = m88ds3103_rd_reg(priv, 0xf8, &u8tmp); in m88ds3103_read_ber()
1004 if (ret) in m88ds3103_read_ber()
1010 ret = m88ds3103_rd_regs(priv, 0xf6, buf, 2); in m88ds3103_read_ber()
1011 if (ret) in m88ds3103_read_ber()
1017 ret = m88ds3103_wr_reg(priv, 0xf8, u8tmp); in m88ds3103_read_ber()
1018 if (ret) in m88ds3103_read_ber()
1023 ret = m88ds3103_rd_regs(priv, 0xd5, buf, 3); in m88ds3103_read_ber()
1024 if (ret) in m88ds3103_read_ber()
1030 ret = m88ds3103_rd_regs(priv, 0xf7, buf, 2); in m88ds3103_read_ber()
1031 if (ret) in m88ds3103_read_ber()
1037 ret = m88ds3103_wr_reg(priv, 0xd1, 0x01); in m88ds3103_read_ber()
1038 if (ret) in m88ds3103_read_ber()
1041 ret = m88ds3103_wr_reg(priv, 0xf9, 0x01); in m88ds3103_read_ber()
1042 if (ret) in m88ds3103_read_ber()
1045 ret = m88ds3103_wr_reg(priv, 0xf9, 0x00); in m88ds3103_read_ber()
1046 if (ret) in m88ds3103_read_ber()
1049 ret = m88ds3103_wr_reg(priv, 0xd1, 0x00); in m88ds3103_read_ber()
1050 if (ret) in m88ds3103_read_ber()
1057 ret = -EINVAL; in m88ds3103_read_ber()
1065 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); in m88ds3103_read_ber()
1066 return ret; in m88ds3103_read_ber()
1073 int ret; in m88ds3103_set_tone() local
1080 ret = -EAGAIN; in m88ds3103_set_tone()
1096 ret = -EINVAL; in m88ds3103_set_tone()
1101 ret = m88ds3103_wr_reg_mask(priv, 0xa2, u8tmp, 0xe0); in m88ds3103_set_tone()
1102 if (ret) in m88ds3103_set_tone()
1106 ret = m88ds3103_wr_reg_mask(priv, 0xa1, u8tmp, reg_a1_mask); in m88ds3103_set_tone()
1107 if (ret) in m88ds3103_set_tone()
1112 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); in m88ds3103_set_tone()
1113 return ret; in m88ds3103_set_tone()
1120 int ret; in m88ds3103_set_voltage() local
1128 ret = -EAGAIN; in m88ds3103_set_voltage()
1148 ret = -EINVAL; in m88ds3103_set_voltage()
1157 ret = m88ds3103_wr_reg_mask(priv, 0xa2, u8tmp, 0x03); in m88ds3103_set_voltage()
1158 if (ret) in m88ds3103_set_voltage()
1163 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); in m88ds3103_set_voltage()
1164 return ret; in m88ds3103_set_voltage()
1171 int ret, i; in m88ds3103_diseqc_send_master_cmd() local
1178 ret = -EAGAIN; in m88ds3103_diseqc_send_master_cmd()
1183 ret = -EINVAL; in m88ds3103_diseqc_send_master_cmd()
1188 ret = m88ds3103_wr_reg_mask(priv, 0xa2, u8tmp, 0xe0); in m88ds3103_diseqc_send_master_cmd()
1189 if (ret) in m88ds3103_diseqc_send_master_cmd()
1192 ret = m88ds3103_wr_regs(priv, 0xa3, diseqc_cmd->msg, in m88ds3103_diseqc_send_master_cmd()
1194 if (ret) in m88ds3103_diseqc_send_master_cmd()
1197 ret = m88ds3103_wr_reg(priv, 0xa1, in m88ds3103_diseqc_send_master_cmd()
1199 if (ret) in m88ds3103_diseqc_send_master_cmd()
1209 ret = m88ds3103_rd_reg_mask(priv, 0xa1, &u8tmp, 0x40); in m88ds3103_diseqc_send_master_cmd()
1210 if (ret) in m88ds3103_diseqc_send_master_cmd()
1219 ret = m88ds3103_wr_reg_mask(priv, 0xa1, 0x40, 0xc0); in m88ds3103_diseqc_send_master_cmd()
1220 if (ret) in m88ds3103_diseqc_send_master_cmd()
1224 ret = m88ds3103_wr_reg_mask(priv, 0xa2, 0x80, 0xc0); in m88ds3103_diseqc_send_master_cmd()
1225 if (ret) in m88ds3103_diseqc_send_master_cmd()
1229 ret = -ETIMEDOUT; in m88ds3103_diseqc_send_master_cmd()
1235 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); in m88ds3103_diseqc_send_master_cmd()
1236 return ret; in m88ds3103_diseqc_send_master_cmd()
1243 int ret, i; in m88ds3103_diseqc_send_burst() local
1250 ret = -EAGAIN; in m88ds3103_diseqc_send_burst()
1255 ret = m88ds3103_wr_reg_mask(priv, 0xa2, u8tmp, 0xe0); in m88ds3103_diseqc_send_burst()
1256 if (ret) in m88ds3103_diseqc_send_burst()
1269 ret = -EINVAL; in m88ds3103_diseqc_send_burst()
1273 ret = m88ds3103_wr_reg(priv, 0xa1, burst); in m88ds3103_diseqc_send_burst()
1274 if (ret) in m88ds3103_diseqc_send_burst()
1284 ret = m88ds3103_rd_reg_mask(priv, 0xa1, &u8tmp, 0x40); in m88ds3103_diseqc_send_burst()
1285 if (ret) in m88ds3103_diseqc_send_burst()
1291 ret = m88ds3103_wr_reg_mask(priv, 0xa2, 0x80, 0xc0); in m88ds3103_diseqc_send_burst()
1292 if (ret) in m88ds3103_diseqc_send_burst()
1297 ret = -ETIMEDOUT; in m88ds3103_diseqc_send_burst()
1303 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); in m88ds3103_diseqc_send_burst()
1304 return ret; in m88ds3103_diseqc_send_burst()
1326 int ret; in m88ds3103_select() local
1339 ret = __i2c_transfer(priv->i2c, gate_open_msg, 1); in m88ds3103_select()
1340 if (ret != 1) { in m88ds3103_select()
1342 KBUILD_MODNAME, ret); in m88ds3103_select()
1343 if (ret >= 0) in m88ds3103_select()
1344 ret = -EREMOTEIO; in m88ds3103_select()
1346 return ret; in m88ds3103_select()
1365 int ret; in m88ds3103_attach() local
1372 ret = -ENOMEM; in m88ds3103_attach()
1382 ret = m88ds3103_rd_reg(priv, 0x00, &chip_id); in m88ds3103_attach()
1383 if (ret) in m88ds3103_attach()
1417 ret = m88ds3103_wr_reg(priv, 0x29, u8tmp); in m88ds3103_attach()
1418 if (ret) in m88ds3103_attach()
1422 ret = m88ds3103_wr_reg_mask(priv, 0x08, 0x00, 0x01); in m88ds3103_attach()
1423 if (ret) in m88ds3103_attach()
1426 ret = m88ds3103_wr_reg_mask(priv, 0x04, 0x01, 0x01); in m88ds3103_attach()
1427 if (ret) in m88ds3103_attach()
1430 ret = m88ds3103_wr_reg_mask(priv, 0x23, 0x10, 0x10); in m88ds3103_attach()
1431 if (ret) in m88ds3103_attach()
1451 dev_dbg(&i2c->dev, "%s: failed=%d\n", __func__, ret); in m88ds3103_attach()