[media] mn88472: simplify bandwidth registers setting code
Signed-off-by: Benjamin Larsson <benjamin@southpole.se> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
parent
e601044212
commit
5ee803a20f
|
@ -58,35 +58,22 @@ static int mn88472_set_frontend(struct dvb_frontend *fe)
|
|||
goto err;
|
||||
}
|
||||
|
||||
switch (c->delivery_system) {
|
||||
case SYS_DVBT:
|
||||
case SYS_DVBT2:
|
||||
if (c->bandwidth_hz <= 5000000) {
|
||||
memcpy(bw_val, "\xe5\x99\x9a\x1b\xa9\x1b\xa9", 7);
|
||||
bw_val2 = 0x03;
|
||||
} else if (c->bandwidth_hz <= 6000000) {
|
||||
/* IF 3570000 Hz, BW 6000000 Hz */
|
||||
memcpy(bw_val, "\xbf\x55\x55\x15\x6b\x15\x6b", 7);
|
||||
bw_val2 = 0x02;
|
||||
} else if (c->bandwidth_hz <= 7000000) {
|
||||
/* IF 4570000 Hz, BW 7000000 Hz */
|
||||
memcpy(bw_val, "\xa4\x00\x00\x0f\x2c\x0f\x2c", 7);
|
||||
bw_val2 = 0x01;
|
||||
} else if (c->bandwidth_hz <= 8000000) {
|
||||
/* IF 4570000 Hz, BW 8000000 Hz */
|
||||
memcpy(bw_val, "\x8f\x80\x00\x08\xee\x08\xee", 7);
|
||||
bw_val2 = 0x00;
|
||||
} else {
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
break;
|
||||
case SYS_DVBC_ANNEX_A:
|
||||
/* IF 5070000 Hz, BW 8000000 Hz */
|
||||
if (c->bandwidth_hz <= 5000000) {
|
||||
memcpy(bw_val, "\xe5\x99\x9a\x1b\xa9\x1b\xa9", 7);
|
||||
bw_val2 = 0x03;
|
||||
} else if (c->bandwidth_hz <= 6000000) {
|
||||
/* IF 3570000 Hz, BW 6000000 Hz */
|
||||
memcpy(bw_val, "\xbf\x55\x55\x15\x6b\x15\x6b", 7);
|
||||
bw_val2 = 0x02;
|
||||
} else if (c->bandwidth_hz <= 7000000) {
|
||||
/* IF 4570000 Hz, BW 7000000 Hz */
|
||||
memcpy(bw_val, "\xa4\x00\x00\x0f\x2c\x0f\x2c", 7);
|
||||
bw_val2 = 0x01;
|
||||
} else if (c->bandwidth_hz <= 8000000) {
|
||||
/* IF 4570000 Hz, BW 8000000 Hz */
|
||||
memcpy(bw_val, "\x8f\x80\x00\x08\xee\x08\xee", 7);
|
||||
bw_val2 = 0x00;
|
||||
break;
|
||||
default:
|
||||
} else {
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue