Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271742
b: refs/heads/master
c: f8a26f0
h: refs/heads/master
v: v3
  • Loading branch information
Edward Sheldrake authored and Mauro Carvalho Chehab committed Sep 4, 2011
1 parent 99b7ecb commit 76c95e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 133a9fe949862d9ed8411fb423739f4cee08232d
refs/heads/master: f8a26f052a5f62c7555d09680c1fe8cbfcac590f
13 changes: 9 additions & 4 deletions trunk/drivers/media/dvb/frontends/drxd_hard.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,10 +889,15 @@ static int ReadIFAgc(struct drxd_state *state, u32 * pValue)
u32 R2 = state->if_agc_cfg.R2;
u32 R3 = state->if_agc_cfg.R3;

u32 Vmax = (3300 * R2) / (R1 + R2);
u32 Rpar = (R2 * R3) / (R3 + R2);
u32 Vmin = (3300 * Rpar) / (R1 + Rpar);
u32 Vout = Vmin + ((Vmax - Vmin) * Value) / 1024;
u32 Vmax, Rpar, Vmin, Vout;

if (R2 == 0 && (R1 == 0 || R3 == 0))
return 0;

Vmax = (3300 * R2) / (R1 + R2);
Rpar = (R2 * R3) / (R3 + R2);
Vmin = (3300 * Rpar) / (R1 + Rpar);
Vout = Vmin + ((Vmax - Vmin) * Value) / 1024;

*pValue = Vout;
}
Expand Down

0 comments on commit 76c95e3

Please sign in to comment.