aboutsummaryrefslogtreecommitdiffstats
path: root/src/tuner_e4k.c
diff options
context:
space:
mode:
authorHoernchen <la@tfc-server.de>2012-05-14 19:17:15 +0200
committerSteve Markgraf <steve@steve-m.de>2012-05-14 19:28:55 +0200
commitf7d9e578a069a03fb799e583e62143af5c52a44f (patch)
tree06f7a6b63d61c42dea25f656ad8fb8c82a9d32cf /src/tuner_e4k.c
parent8dda69410141b8933f9f1c85a9a1ce67beede800 (diff)
tuner_e4k: use empty entry instead of offset for if_stage_gain_regs[]
Signed-off-by: Steve Markgraf <steve@steve-m.de>
Diffstat (limited to 'src/tuner_e4k.c')
-rw-r--r--src/tuner_e4k.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tuner_e4k.c b/src/tuner_e4k.c
index bc97399..1801f63 100644
--- a/src/tuner_e4k.c
+++ b/src/tuner_e4k.c
@@ -617,6 +617,7 @@ static const uint8_t if_stage_gain_len[] = {
};
static const struct reg_field if_stage_gain_regs[] = {
+ { 0, 0, 0 },
{ E4K_REG_GAIN3, 0, 1 },
{ E4K_REG_GAIN3, 1, 2 },
{ E4K_REG_GAIN3, 3, 2 },
@@ -724,7 +725,7 @@ int e4k_if_gain_set(struct e4k_state *e4k, uint8_t stage, int8_t value)
return rc;
/* compute the bit-mask for the given gain field */
- field = &if_stage_gain_regs[stage-1];
+ field = &if_stage_gain_regs[stage];
mask = width2mask[field->width] << field->shift;
return e4k_reg_set_mask(e4k, field->reg, mask, rc << field->shift);