@@ -215,6 +215,8 @@ struct dvb_tuner_ops {
int (*get_frequency)(struct dvb_frontend *fe, u32 *frequency);
int (*get_bandwidth)(struct dvb_frontend *fe, u32 *bandwidth);
int (*get_if_frequency)(struct dvb_frontend *fe, u32 *frequency);
+ int (*get_tuner_freq_range)(struct dvb_frontend *fe,
+ u32 *min_freq, u32 *max_freq);
#define TUNER_STATUS_LOCKED 1
#define TUNER_STATUS_STEREO 2
@@ -460,6 +460,13 @@ static void set_type(struct i2c_client *c, unsigned int type,
t->tv_range[i] = tv_range[i] * 16;
}
+ if (fe_tuner_ops->get_tuner_freq_range) {
+ u32 min, max;
+ fe_tuner_ops->get_tuner_freq_range(&t->fe, &min, &max);
+ t->sdr_range[0] = min / 16;
+ t->sdr_range[1] = max / 16;
+ }
+
tuner_dbg("%s %s I2C addr 0x%02x with type %d used for 0x%02x\n",
c->adapter->name, c->driver->driver.name, c->addr << 1, type,
t->mode_mask);
For SDR, the tuner range is different than TV or radio ranges. Only the actual tuner driver knows what's the range supported by the device. So, call the tuner to get it, if the tuner supports. Otherwise, keep the TV range, as is it broader than the radio one. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> --- drivers/media/dvb-core/dvb_frontend.h | 2 ++ drivers/media/v4l2-core/tuner-core.c | 7 +++++++ 2 files changed, 9 insertions(+)