static int si2168_read_status(struct dvb_frontend *fe, fe_status_t *status)
{
struct si2168 *s = fe->demodulator_priv;
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret;
struct si2168_cmd cmd;
goto err;
}
- cmd.args[0] = 0xa0;
- cmd.args[1] = 0x01;
- cmd.wlen = 2;
- cmd.rlen = 13;
+ switch (c->delivery_system) {
+ case SYS_DVBT:
+ cmd.args[0] = 0xa0;
+ cmd.args[1] = 0x01;
+ cmd.wlen = 2;
+ cmd.rlen = 13;
+ break;
+ case SYS_DVBT2:
+ cmd.args[0] = 0x50;
+ cmd.args[1] = 0x01;
+ cmd.wlen = 2;
+ cmd.rlen = 14;
+ break;
+ default:
+ ret = -EINVAL;
+ goto err;
+ }
+
ret = si2168_cmd_execute(s, &cmd);
if (ret)
goto err;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret;
struct si2168_cmd cmd;
- u8 bandwidth;
+ u8 bandwidth, delivery_system;
dev_dbg(&s->client->dev,
"%s: delivery_system=%u modulation=%u frequency=%u bandwidth_hz=%u symbol_rate=%u inversion=%u\n",
goto err;
}
+ switch (c->delivery_system) {
+ case SYS_DVBT:
+ delivery_system = 0x20;
+ break;
+ case SYS_DVBT2:
+ delivery_system = 0x70;
+ break;
+ default:
+ ret = -EINVAL;
+ goto err;
+ }
+
switch (c->bandwidth_hz) {
case 5000000:
- bandwidth = 0x25;
+ bandwidth = 0x05;
break;
case 6000000:
- bandwidth = 0x26;
+ bandwidth = 0x06;
break;
case 7000000:
- bandwidth = 0x27;
+ bandwidth = 0x07;
break;
case 8000000:
- bandwidth = 0x28;
+ bandwidth = 0x08;
break;
default:
ret = -EINVAL;
if (ret)
goto err;
- memcpy(cmd.args, "\x89\x21\x06\x11\xff\x98", 6);
+ /* that has no big effect */
+ if (c->delivery_system == SYS_DVBT)
+ memcpy(cmd.args, "\x89\x21\x06\x11\xff\x98", 6);
+ else if (c->delivery_system == SYS_DVBT2)
+ memcpy(cmd.args, "\x89\x21\x06\x11\x89\x20", 6);
cmd.wlen = 6;
cmd.rlen = 3;
ret = si2168_cmd_execute(s, &cmd);
goto err;
memcpy(cmd.args, "\x14\x00\x0a\x10\x00\x00", 6);
- cmd.args[4] = bandwidth;
+ cmd.args[4] = delivery_system | bandwidth;
cmd.wlen = 6;
cmd.rlen = 1;
ret = si2168_cmd_execute(s, &cmd);
}
static const struct dvb_frontend_ops si2168_ops = {
- .delsys = {SYS_DVBT},
+ .delsys = {SYS_DVBT, SYS_DVBT2},
.info = {
.name = "Silicon Labs Si2168",
.caps = FE_CAN_FEC_1_2 |