Commit c790885b authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] si2168: add support for DVB-C (annex A version)

Add support for DVB-C (annex A version).
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent ae4c8919
...@@ -84,6 +84,12 @@ static int si2168_read_status(struct dvb_frontend *fe, fe_status_t *status) ...@@ -84,6 +84,12 @@ static int si2168_read_status(struct dvb_frontend *fe, fe_status_t *status)
cmd.wlen = 2; cmd.wlen = 2;
cmd.rlen = 13; cmd.rlen = 13;
break; break;
case SYS_DVBC_ANNEX_A:
cmd.args[0] = 0x90;
cmd.args[1] = 0x01;
cmd.wlen = 2;
cmd.rlen = 9;
break;
case SYS_DVBT2: case SYS_DVBT2:
cmd.args[0] = 0x50; cmd.args[0] = 0x50;
cmd.args[1] = 0x01; cmd.args[1] = 0x01;
...@@ -157,6 +163,9 @@ static int si2168_set_frontend(struct dvb_frontend *fe) ...@@ -157,6 +163,9 @@ static int si2168_set_frontend(struct dvb_frontend *fe)
case SYS_DVBT: case SYS_DVBT:
delivery_system = 0x20; delivery_system = 0x20;
break; break;
case SYS_DVBC_ANNEX_A:
delivery_system = 0x30;
break;
case SYS_DVBT2: case SYS_DVBT2:
delivery_system = 0x70; delivery_system = 0x70;
break; break;
...@@ -165,23 +174,20 @@ static int si2168_set_frontend(struct dvb_frontend *fe) ...@@ -165,23 +174,20 @@ static int si2168_set_frontend(struct dvb_frontend *fe)
goto err; goto err;
} }
switch (c->bandwidth_hz) { if (c->bandwidth_hz <= 5000000)
case 5000000:
bandwidth = 0x05; bandwidth = 0x05;
break; else if (c->bandwidth_hz <= 6000000)
case 6000000:
bandwidth = 0x06; bandwidth = 0x06;
break; else if (c->bandwidth_hz <= 7000000)
case 7000000:
bandwidth = 0x07; bandwidth = 0x07;
break; else if (c->bandwidth_hz <= 8000000)
case 8000000:
bandwidth = 0x08; bandwidth = 0x08;
break; else if (c->bandwidth_hz <= 9000000)
default: bandwidth = 0x09;
ret = -EINVAL; else if (c->bandwidth_hz <= 10000000)
goto err; bandwidth = 0x0a;
} else
bandwidth = 0x0f;
/* program tuner */ /* program tuner */
if (fe->ops.tuner_ops.set_params) { if (fe->ops.tuner_ops.set_params) {
...@@ -200,6 +206,8 @@ static int si2168_set_frontend(struct dvb_frontend *fe) ...@@ -200,6 +206,8 @@ static int si2168_set_frontend(struct dvb_frontend *fe)
/* that has no big effect */ /* that has no big effect */
if (c->delivery_system == SYS_DVBT) if (c->delivery_system == SYS_DVBT)
memcpy(cmd.args, "\x89\x21\x06\x11\xff\x98", 6); memcpy(cmd.args, "\x89\x21\x06\x11\xff\x98", 6);
else if (c->delivery_system == SYS_DVBC_ANNEX_A)
memcpy(cmd.args, "\x89\x21\x06\x11\x89\xf0", 6);
else if (c->delivery_system == SYS_DVBT2) else if (c->delivery_system == SYS_DVBT2)
memcpy(cmd.args, "\x89\x21\x06\x11\x89\x20", 6); memcpy(cmd.args, "\x89\x21\x06\x11\x89\x20", 6);
cmd.wlen = 6; cmd.wlen = 6;
...@@ -614,7 +622,7 @@ static int si2168_deselect(struct i2c_adapter *adap, void *mux_priv, u32 chan) ...@@ -614,7 +622,7 @@ static int si2168_deselect(struct i2c_adapter *adap, void *mux_priv, u32 chan)
} }
static const struct dvb_frontend_ops si2168_ops = { static const struct dvb_frontend_ops si2168_ops = {
.delsys = {SYS_DVBT, SYS_DVBT2}, .delsys = {SYS_DVBT, SYS_DVBT2, SYS_DVBC_ANNEX_A},
.info = { .info = {
.name = "Silicon Labs Si2168", .name = "Silicon Labs Si2168",
.caps = FE_CAN_FEC_1_2 | .caps = FE_CAN_FEC_1_2 |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment