@@ -903,10 +903,33 @@
switch (params->mode) {
case V4L2_TUNER_RADIO:
ret = xc5000_set_radio_freq(fe, params);
+ if (fe->callback) {
+ fe->callback(((fe->dvb) && (fe->dvb->priv)) ?
+ fe->dvb->priv :
+ priv->i2c_props.adap->algo_data,
+ DVB_FRONTEND_COMPONENT_TUNER,
+ XC5000_TUNER_SET_RADIO, 0);
+ }
break;
case V4L2_TUNER_ANALOG_TV:
+ ret = xc5000_set_tv_freq(fe, params);
+ if (fe->callback) {
+ fe->callback(((fe->dvb) && (fe->dvb->priv)) ?
+ fe->dvb->priv :
+ priv->i2c_props.adap->algo_data,
+ DVB_FRONTEND_COMPONENT_TUNER,
+ XC5000_TUNER_SET_ANALOG_TV, 0);
+ }
+ break;
case V4L2_TUNER_DIGITAL_TV:
ret = xc5000_set_tv_freq(fe, params);
+ if (fe->callback) {
+ fe->callback(((fe->dvb) && (fe->dvb->priv)) ?
+ fe->dvb->priv :
+ priv->i2c_props.adap->algo_data,
+ DVB_FRONTEND_COMPONENT_TUNER,
+ XC5000_TUNER_SET_DIGITAL_TV, 0);
+ }
break;
}
@@ -35,6 +35,9 @@
/* xc5000 callback command */
#define XC5000_TUNER_RESET 0
+#define XC5000_TUNER_SET_RADIO 1
+#define XC5000_TUNER_SET_ANALOG_TV 2
+#define XC5000_TUNER_SET_DIGITAL_TV 3
/* Possible Radio inputs */
#define XC5000_RADIO_NOT_CONFIGURED 0
@@ -6842,12 +6842,53 @@
case SAA7134_BOARD_BEHOLD_X7:
case SAA7134_BOARD_BEHOLD_H7:
case SAA7134_BOARD_BEHOLD_A7:
- if (command == XC5000_TUNER_RESET) {
- /* Down and UP pheripherial RESET pin for reset all chips */
+ switch (command) {
+ case XC5000_TUNER_RESET:
+ /* Down/UP pheripherial RESET pin for reset all chips */
saa_writeb(SAA7134_SPECIAL_MODE, 0x00);
msleep(10);
saa_writeb(SAA7134_SPECIAL_MODE, 0x01);
msleep(10);
+ break;
+ case XC5000_TUNER_SET_RADIO:
+ {
+ static u8 zl10353_ant2_enable[] = { 0x63, 0x40 };
+ struct i2c_msg zl10353_msg = {.addr = 0x1e >> 1,
+ .flags = 0, .len = 2};
+
+ zl10353_msg.buf = zl10353_ant2_enable;
+
+ /* Switch RF to the ANT2 source */
+ if (i2c_transfer(&dev->i2c_adap, &zl10353_msg, 1) != 1) {
+ printk(KERN_INFO "could not access RF
+ source control\n");
+ return -EIO;
+ }
+
+ msleep(10);
+ }
+ break;
+ case XC5000_TUNER_SET_ANALOG_TV:
+ case XC5000_TUNER_SET_DIGITAL_TV:
+ {
+ static u8 zl10353_ant1_enable[] = { 0x63, 0x00 };
+ struct i2c_msg zl10353_msg = {.addr = 0x1e >> 1,
+ .flags = 0, .len = 2};
+
+ zl10353_msg.buf = zl10353_ant1_enable;
+
+ /* Switch RF to the ANT1 source */
+ if (i2c_transfer(&dev->i2c_adap, &zl10353_msg, 1) != 1) {
+ printk(KERN_INFO "could not access RF
+ source control\n");
+ return -EIO;
+ }
+
+ msleep(10);
+ }
+ break;
+ default:
+ break;
}
break;
default:
Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>