tuner_e4k: fix off-by-one error in e4k_if_gain_set()

Thanks to patchvonbraun for providing debug logs
that helped to track this beast down.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
master
Steve Markgraf 13 years ago
parent 86c34428aa
commit 59198d6342
  1. 2
      src/tuner_e4k.c

@ -715,7 +715,7 @@ int e4k_if_gain_set(struct e4k_state *e4k, uint8_t stage, int8_t value)
return rc; return rc;
/* compute the bit-mask for the given gain field */ /* compute the bit-mask for the given gain field */
field = &if_stage_gain_regs[stage]; field = &if_stage_gain_regs[stage-1];
mask = width2mask[field->width] << field->shift; mask = width2mask[field->width] << field->shift;
return e4k_reg_set_mask(e4k, field->reg, mask, rc << field->shift); return e4k_reg_set_mask(e4k, field->reg, mask, rc << field->shift);

Loading…
Cancel
Save