Lines Matching refs:val
63 static int lg216x_write_reg(struct lg216x_state *state, u16 reg, u8 val) in lg216x_write_reg() argument
66 u8 buf[] = { reg >> 8, reg & 0xff, val }; in lg216x_write_reg()
72 lg_reg("reg: 0x%04x, val: 0x%02x\n", reg, val); in lg216x_write_reg()
87 static int lg216x_read_reg(struct lg216x_state *state, u16 reg, u8 *val) in lg216x_read_reg() argument
95 .flags = I2C_M_RD, .buf = val, .len = 1 }, in lg216x_read_reg()
115 u8 val; member
126 ret = lg216x_write_reg(state, regs[i].reg, regs[i].val); in lg216x_write_regs()
136 u8 val; in lg216x_set_reg_bit() local
141 ret = lg216x_read_reg(state, reg, &val); in lg216x_set_reg_bit()
145 val &= ~(1 << bit); in lg216x_set_reg_bit()
146 val |= (onoff & 1) << bit; in lg216x_set_reg_bit()
148 ret = lg216x_write_reg(state, reg, val); in lg216x_set_reg_bit()
199 { .reg = 0x0015, .val = 0xe6 }, in lg216x_initialize()
201 { .reg = 0x0015, .val = 0xf7 }, in lg216x_initialize()
202 { .reg = 0x001b, .val = 0x52 }, in lg216x_initialize()
203 { .reg = 0x0208, .val = 0x00 }, in lg216x_initialize()
204 { .reg = 0x0209, .val = 0x82 }, in lg216x_initialize()
205 { .reg = 0x0210, .val = 0xf9 }, in lg216x_initialize()
206 { .reg = 0x020a, .val = 0x00 }, in lg216x_initialize()
207 { .reg = 0x020b, .val = 0x82 }, in lg216x_initialize()
208 { .reg = 0x020d, .val = 0x28 }, in lg216x_initialize()
209 { .reg = 0x020f, .val = 0x14 }, in lg216x_initialize()
214 { .reg = 0x0000, .val = 0x41 }, in lg216x_initialize()
215 { .reg = 0x0001, .val = 0xfb }, in lg216x_initialize()
216 { .reg = 0x0216, .val = 0x00 }, in lg216x_initialize()
217 { .reg = 0x0219, .val = 0x00 }, in lg216x_initialize()
218 { .reg = 0x021b, .val = 0x55 }, in lg216x_initialize()
219 { .reg = 0x0606, .val = 0x0a }, in lg216x_initialize()
248 u8 val; in lg216x_set_if() local
253 ret = lg216x_read_reg(state, 0x0132, &val); in lg216x_set_if()
257 val &= 0xfb; in lg216x_set_if()
258 val |= (0 == state->cfg->if_khz) ? 0x04 : 0x00; in lg216x_set_if()
260 ret = lg216x_write_reg(state, 0x0132, val); in lg216x_set_if()
273 u8 val; in lg2160_agc_fix() local
276 ret = lg216x_read_reg(state, 0x0100, &val); in lg2160_agc_fix()
280 val &= 0xf3; in lg2160_agc_fix()
281 val |= (if_agc_fix) ? 0x08 : 0x00; in lg2160_agc_fix()
282 val |= (rf_agc_fix) ? 0x04 : 0x00; in lg2160_agc_fix()
284 ret = lg216x_write_reg(state, 0x0100, val); in lg2160_agc_fix()
294 u8 val;
297 ret = lg216x_read_reg(state, 0x0100, &val);
301 val &= 0xcf;
302 val |= (if_agc_freeze) ? 0x20 : 0x00;
303 val |= (rf_agc_freeze) ? 0x10 : 0x00;
305 ret = lg216x_write_reg(state, 0x0100, val);
315 u8 val; in lg2160_agc_polarity() local
318 ret = lg216x_read_reg(state, 0x0100, &val); in lg2160_agc_polarity()
322 val &= 0xfc; in lg2160_agc_polarity()
323 val |= (if_agc_polarity) ? 0x02 : 0x00; in lg2160_agc_polarity()
324 val |= (rf_agc_polarity) ? 0x01 : 0x00; in lg2160_agc_polarity()
326 ret = lg216x_write_reg(state, 0x0100, val); in lg2160_agc_polarity()
335 u8 val; in lg2160_tuner_pwr_save_polarity() local
338 ret = lg216x_read_reg(state, 0x0008, &val); in lg2160_tuner_pwr_save_polarity()
342 val &= 0xfe; in lg2160_tuner_pwr_save_polarity()
343 val |= (polarity) ? 0x01 : 0x00; in lg2160_tuner_pwr_save_polarity()
345 ret = lg216x_write_reg(state, 0x0008, val); in lg2160_tuner_pwr_save_polarity()
354 u8 val; in lg2160_spectrum_polarity() local
357 ret = lg216x_read_reg(state, 0x0132, &val); in lg2160_spectrum_polarity()
361 val &= 0xfd; in lg2160_spectrum_polarity()
362 val |= (inverted) ? 0x02 : 0x00; in lg2160_spectrum_polarity()
364 ret = lg216x_write_reg(state, 0x0132, val); in lg2160_spectrum_polarity()
372 u8 val; in lg2160_tuner_pwr_save() local
375 ret = lg216x_read_reg(state, 0x0007, &val); in lg2160_tuner_pwr_save()
379 val &= 0xbf; in lg2160_tuner_pwr_save()
380 val |= (onoff) ? 0x40 : 0x00; in lg2160_tuner_pwr_save()
382 ret = lg216x_write_reg(state, 0x0007, val); in lg2160_tuner_pwr_save()
405 u8 val; in lg216x_set_ensemble() local
417 ret = lg216x_read_reg(state, reg, &val); in lg216x_set_ensemble()
421 val &= 0xfe; in lg216x_set_ensemble()
422 val |= (id) ? 0x01 : 0x00; in lg216x_set_ensemble()
424 ret = lg216x_write_reg(state, reg, val); in lg216x_set_ensemble()
432 u8 val; in lg2160_set_spi_clock() local
435 ret = lg216x_read_reg(state, 0x0014, &val); in lg2160_set_spi_clock()
439 val &= 0xf3; in lg2160_set_spi_clock()
440 val |= (state->cfg->spi_clock << 2); in lg2160_set_spi_clock()
442 ret = lg216x_write_reg(state, 0x0014, val); in lg2160_set_spi_clock()
450 u8 val; in lg2161_set_output_interface() local
453 ret = lg216x_read_reg(state, 0x0014, &val); in lg2161_set_output_interface()
457 val &= ~0x07; in lg2161_set_output_interface()
458 val |= state->cfg->output_if; /* FIXME: needs sanity check */ in lg2161_set_output_interface()
460 ret = lg216x_write_reg(state, 0x0014, val); in lg2161_set_output_interface()
506 u8 val; in lg216x_get_fic_version() local
511 ret = lg216x_read_reg(state, 0x0128, &val); in lg216x_get_fic_version()
515 *ficver = (val >> 3) & 0x1f; in lg216x_get_fic_version()
523 u8 val;
528 ret = lg216x_read_reg(state, 0x0123, &val);
532 *id = val & 0x7f;
540 u8 val; in lg216x_get_nog() local
545 ret = lg216x_read_reg(state, 0x0124, &val); in lg216x_get_nog()
549 *nog = ((val >> 4) & 0x07) + 1; in lg216x_get_nog()
556 u8 val; in lg216x_get_tnog() local
561 ret = lg216x_read_reg(state, 0x0125, &val); in lg216x_get_tnog()
565 *tnog = val & 0x1f; in lg216x_get_tnog()
572 u8 val; in lg216x_get_sgn() local
577 ret = lg216x_read_reg(state, 0x0124, &val); in lg216x_get_sgn()
581 *sgn = val & 0x0f; in lg216x_get_sgn()
588 u8 val; in lg216x_get_prc() local
593 ret = lg216x_read_reg(state, 0x0125, &val); in lg216x_get_prc()
597 *prc = ((val >> 5) & 0x07) + 1; in lg216x_get_prc()
607 u8 val; in lg216x_get_rs_frame_mode() local
612 ret = lg216x_read_reg(state, 0x0410, &val); in lg216x_get_rs_frame_mode()
615 ret = lg216x_read_reg(state, 0x0513, &val); in lg216x_get_rs_frame_mode()
623 switch ((val >> 4) & 0x03) { in lg216x_get_rs_frame_mode()
647 u8 val; in lg216x_get_rs_frame_ensemble() local
652 ret = lg216x_read_reg(state, 0x0400, &val); in lg216x_get_rs_frame_ensemble()
655 ret = lg216x_read_reg(state, 0x0500, &val); in lg216x_get_rs_frame_ensemble()
663 val &= 0x01; in lg216x_get_rs_frame_ensemble()
664 *rs_frame_ens = (enum atscmh_rs_frame_ensemble) val; in lg216x_get_rs_frame_ensemble()
673 u8 val; in lg216x_get_rs_code_mode() local
678 ret = lg216x_read_reg(state, 0x0410, &val); in lg216x_get_rs_code_mode()
681 ret = lg216x_read_reg(state, 0x0513, &val); in lg216x_get_rs_code_mode()
689 *rs_code_pri = (enum atscmh_rs_code_mode) ((val >> 2) & 0x03); in lg216x_get_rs_code_mode()
690 *rs_code_sec = (enum atscmh_rs_code_mode) (val & 0x03); in lg216x_get_rs_code_mode()
698 u8 val; in lg216x_get_sccc_block_mode() local
703 ret = lg216x_read_reg(state, 0x0315, &val); in lg216x_get_sccc_block_mode()
706 ret = lg216x_read_reg(state, 0x0511, &val); in lg216x_get_sccc_block_mode()
714 switch (val & 0x03) { in lg216x_get_sccc_block_mode()
735 u8 val; in lg216x_get_sccc_code_mode() local
740 ret = lg216x_read_reg(state, 0x0316, &val); in lg216x_get_sccc_code_mode()
743 ret = lg216x_read_reg(state, 0x0512, &val); in lg216x_get_sccc_code_mode()
751 switch ((val >> 6) & 0x03) { in lg216x_get_sccc_code_mode()
763 switch ((val >> 4) & 0x03) { in lg216x_get_sccc_code_mode()
775 switch ((val >> 2) & 0x03) { in lg216x_get_sccc_code_mode()
787 switch (val & 0x03) { in lg216x_get_sccc_code_mode()
1132 u8 val; in lg2160_read_lock_status() local
1138 ret = lg216x_read_reg(state, 0x011b, &val); in lg2160_read_lock_status()
1142 *sync_lock = (val & 0x20) ? 0 : 1; in lg2160_read_lock_status()
1143 *acq_lock = (val & 0x40) ? 0 : 1; in lg2160_read_lock_status()
1152 u8 val; in lg2161_read_lock_status() local
1158 ret = lg216x_read_reg(state, 0x0304, &val); in lg2161_read_lock_status()
1162 *sync_lock = (val & 0x80) ? 0 : 1; in lg2161_read_lock_status()
1164 ret = lg216x_read_reg(state, 0x011b, &val); in lg2161_read_lock_status()
1168 *acq_lock = (val & 0x40) ? 0 : 1; in lg2161_read_lock_status()