@@ -21,7 +21,7 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/dvb-usb/dw2102.c linux-3.2.10/dri
#define DW2102_RC_QUERY (0x1a00)
#define DW2102_LED_CTRL (0x1b00)

+/*Bst device index in table*/
+/*Bst device index in table*/
+#define BST_6830_Index 15
+
#define err_str "did not find the firmware file. (%s) " \
@@ -31,68 +31,68 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/dvb-usb/dw2102.c linux-3.2.10/dri

return 0;
}
+
+static int bstusb_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
+{
+
+ struct dvb_usb_adapter *udev_adap =
+ (struct dvb_usb_adapter *)(fe->dvb->priv);
+
+ u8 obuf[3] = { 0xe, 0x80, 0 };
+ u8 ibuf[] = { 0 };
+
+ info("US6830: %s!\n", __func__);
+
+ if (voltage == SEC_VOLTAGE_OFF)
+ obuf[2] = 0;
+ else
+ obuf[2] = 1;
+
+ if (dvb_usb_generic_rw(udev_adap->dev, obuf, 3, ibuf, 1, 0) < 0)
+ err("command 0x0e transfer failed.");
+
+ return 0;
+}
+
+static int bstusb_restart(struct dvb_frontend *fe)
+{
+
+ struct dvb_usb_adapter *udev_adap =
+ (struct dvb_usb_adapter *)(fe->dvb->priv);
+
+ u8 obuf[3] = { 0x36, 3, 0 };
+ u8 ibuf[] = { 0 };
+
+
+ if (dvb_usb_generic_rw(udev_adap->dev, obuf, 3, ibuf, 1, 0) < 0)
+ err("command 0x36 transfer failed.");
+
+ return 0;
+}
+
+static int bstusb_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
+{
+
+ struct dvb_usb_adapter *udev_adap =
+ (struct dvb_usb_adapter *)(fe->dvb->priv);
+
+ u8 obuf[3] = { 0xe, 0x80, 0 };
+ u8 ibuf[] = { 0 };
+
+ info("US6830: %s!\n", __func__);
+
+ if (voltage == SEC_VOLTAGE_OFF)
+ obuf[2] = 0;
+ else
+ obuf[2] = 1;
+
+ if (dvb_usb_generic_rw(udev_adap->dev, obuf, 3, ibuf, 1, 0) < 0)
+ err("command 0x0e transfer failed.");
+
+ return 0;
+}
+
+static int bstusb_restart(struct dvb_frontend *fe)
+{
+
+ struct dvb_usb_adapter *udev_adap =
+ (struct dvb_usb_adapter *)(fe->dvb->priv);
+
+ u8 obuf[3] = { 0x36, 3, 0 };
+ u8 ibuf[] = { 0 };
+
+
+ if (dvb_usb_generic_rw(udev_adap->dev, obuf, 3, ibuf, 1, 0) < 0)
+ err("command 0x36 transfer failed.");
+
+ return 0;
+}

static void dw210x_led_ctrl(struct dvb_frontend *fe, int offon)
{
@@ -987,6 +1030,24 @@ static struct ds3000_config su3000_ds300
.ci_mode = 1,
};

+static struct m88ds3103_config US6830_ds3103_config = {
+ .demod_address = 0x68,
+ .ci_mode = 1,
+ .pin_ctrl = 0x83,
+ .ts_mode = 0,
+ .start_ctrl = bstusb_restart,
+ .set_voltage = bstusb_set_voltage,
+};
+
+static struct m88ds3103_config US6832_ds3103_config = {
+ .demod_address = 0x68,
+ .ci_mode = 1,
+ .pin_ctrl = 0x80,
+ .ts_mode = 0,
+ .start_ctrl = bstusb_restart,
+ .set_voltage = bstusb_set_voltage,
+};
+static struct m88ds3103_config US6830_ds3103_config = {
+ .demod_address = 0x68,
+ .ci_mode = 1,
+ .pin_ctrl = 0x83,
+ .ts_mode = 0,
+ .start_ctrl = bstusb_restart,
+ .set_voltage = bstusb_set_voltage,
+};
+
+static struct m88ds3103_config US6832_ds3103_config = {
+ .demod_address = 0x68,
+ .ci_mode = 1,
+ .pin_ctrl = 0x80,
+ .ts_mode = 0,
+ .start_ctrl = bstusb_restart,
+ .set_voltage = bstusb_set_voltage,
+};
+
static int dw2104_frontend_attach(struct dvb_usb_adapter *d)
{
@@ -101,70 +101,70 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/dvb-usb/dw2102.c linux-3.2.10/dri
return 0;
}

+static int US6830_frontend_attach(struct dvb_usb_adapter *d)
+{
+ u8 obuf[3] = { 0xe, 0x83, 0 };
+ u8 ibuf[] = { 0 };
+
+
+ info("US6830: %s!\n", __func__);
+
+ if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
+ err("command 0x0e transfer failed.");
+
+ obuf[0] = 0xe;
+ obuf[1] = 0x83;
+ obuf[2] = 1;
+
+ if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
+ err("command 0x0e transfer failed.");
+
+ obuf[0] = 0x51;
+
+ if (dvb_usb_generic_rw(d->dev, obuf, 1, ibuf, 1, 0) < 0)
+ err("command 0x51 transfer failed.");
+
+ d->fe_adap[0].fe = dvb_attach(m88ds3103_attach, &US6830_ds3103_config,
+ &d->dev->i2c_adap);
+ if (d->fe_adap[0].fe == NULL)
+ return -EIO;
+
+ info("Attached DS3000!\n");
+
+ return 0;
+}
+
+static int US6832_frontend_attach(struct dvb_usb_adapter *d)
+{
+ u8 obuf[3] = { 0xe, 0x83, 0 };
+ u8 ibuf[] = { 0 };
+
+
+ info("US6832: %s!\n", __func__);
+
+ if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
+ err("command 0x0e transfer failed.");
+
+ obuf[0] = 0xe;
+ obuf[1] = 0x83;
+ obuf[2] = 1;
+
+ if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
+ err("command 0x0e transfer failed.");
+
+ obuf[0] = 0x51;
+
+ if (dvb_usb_generic_rw(d->dev, obuf, 1, ibuf, 1, 0) < 0)
+ err("command 0x51 transfer failed.");
+
+ d->fe_adap[0].fe = dvb_attach(m88ds3103_attach, &US6832_ds3103_config,
+ &d->dev->i2c_adap);
+ if (d->fe_adap[0].fe == NULL)
+ return -EIO;
+
+ info("Attached DS3000!\n");
+
+ return 0;
+static int US6830_frontend_attach(struct dvb_usb_adapter *d)
+{
+ u8 obuf[3] = { 0xe, 0x83, 0 };
+ u8 ibuf[] = { 0 };
+
+
+ info("US6830: %s!\n", __func__);
+
+ if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
+ err("command 0x0e transfer failed.");
+
+ obuf[0] = 0xe;
+ obuf[1] = 0x83;
+ obuf[2] = 1;
+
+ if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
+ err("command 0x0e transfer failed.");
+
+ obuf[0] = 0x51;
+
+ if (dvb_usb_generic_rw(d->dev, obuf, 1, ibuf, 1, 0) < 0)
+ err("command 0x51 transfer failed.");
+
+ d->fe_adap[0].fe = dvb_attach(m88ds3103_attach, &US6830_ds3103_config,
+ &d->dev->i2c_adap);
+ if (d->fe_adap[0].fe == NULL)
+ return -EIO;
+
+ info("Attached DS3000!\n");
+
+ return 0;
+}
+
+static int US6832_frontend_attach(struct dvb_usb_adapter *d)
+{
+ u8 obuf[3] = { 0xe, 0x83, 0 };
+ u8 ibuf[] = { 0 };
+
+
+ info("US6832: %s!\n", __func__);
+
+ if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
+ err("command 0x0e transfer failed.");
+
+ obuf[0] = 0xe;
+ obuf[1] = 0x83;
+ obuf[2] = 1;
+
+ if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
+ err("command 0x0e transfer failed.");
+
+ obuf[0] = 0x51;
+
+ if (dvb_usb_generic_rw(d->dev, obuf, 1, ibuf, 1, 0) < 0)
+ err("command 0x51 transfer failed.");
+
+ d->fe_adap[0].fe = dvb_attach(m88ds3103_attach, &US6832_ds3103_config,
+ &d->dev->i2c_adap);
+ if (d->fe_adap[0].fe == NULL)
+ return -EIO;
+
+ info("Attached DS3000!\n");
+
+ return 0;
+}
+
static int dw2102_tuner_attach(struct dvb_usb_adapter *adap)
@@ -174,8 +174,8 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/dvb-usb/dw2102.c linux-3.2.10/dri
{USB_DEVICE(0x9022, USB_PID_TEVII_S480_1)},
{USB_DEVICE(0x9022, USB_PID_TEVII_S480_2)},
{USB_DEVICE(0x1f4d, 0x3100)},
+ {USB_DEVICE(0x0572, 0x6830)},
+ {USB_DEVICE(0x0572, 0x6831)},
+ {USB_DEVICE(0x0572, 0x6830)},
+ {USB_DEVICE(0x0572, 0x6831)},
+ {USB_DEVICE(0x0572, 0x6832)},
{ }
};
@@ -184,105 +184,105 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/dvb-usb/dw2102.c linux-3.2.10/dri
}
};

+static struct dvb_usb_device_properties US6830_properties = {
+ .caps = DVB_USB_IS_AN_I2C_ADAPTER,
+ .usb_ctrl = DEVICE_SPECIFIC,
+ .size_of_priv = sizeof(struct su3000_state),
+ .power_ctrl = su3000_power_ctrl,
+ .num_adapters = 1,
+ .identify_state = su3000_identify_state,
+ .i2c_algo = &su3000_i2c_algo,
+
+ .rc.legacy = {
+ .rc_map_table = rc_map_su3000_table,
+ .rc_map_size = ARRAY_SIZE(rc_map_su3000_table),
+ .rc_interval = 150,
+ .rc_query = dw2102_rc_query,
+ },
+
+ .read_mac_address = su3000_read_mac_address,
+
+ .generic_bulk_ctrl_endpoint = 0x01,
+static struct dvb_usb_device_properties US6830_properties = {
+ .caps = DVB_USB_IS_AN_I2C_ADAPTER,
+ .usb_ctrl = DEVICE_SPECIFIC,
+ .size_of_priv = sizeof(struct su3000_state),
+ .power_ctrl = su3000_power_ctrl,
+ .num_adapters = 1,
+ .identify_state = su3000_identify_state,
+ .i2c_algo = &su3000_i2c_algo,
+
+ .rc.legacy = {
+ .rc_map_table = rc_map_su3000_table,
+ .rc_map_size = ARRAY_SIZE(rc_map_su3000_table),
+ .rc_interval = 150,
+ .rc_query = dw2102_rc_query,
+ },
+
+ .read_mac_address = su3000_read_mac_address,
+
+ .generic_bulk_ctrl_endpoint = 0x01,
+
+ .adapter = {
+ .adapter = {
+ {
+ .num_frontends = 1,
+ .fe = {{
+ .streaming_ctrl = su3000_streaming_ctrl,
+ .frontend_attach = US6830_frontend_attach,
+ .stream = {
+ .type = USB_BULK,
+ .count = 8,
+ .endpoint = 0x82,
+ .u = {
+ .bulk = {
+ .buffersize = 4096,
+ }
+ }
+ }
+ .fe = {{
+ .streaming_ctrl = su3000_streaming_ctrl,
+ .frontend_attach = US6830_frontend_attach,
+ .stream = {
+ .type = USB_BULK,
+ .count = 8,
+ .endpoint = 0x82,
+ .u = {
+ .bulk = {
+ .buffersize = 4096,
+ }
+ }
+ }
+ }},
+ }
+ },
+ .num_device_descs = 2,
+ .devices = {
+ { "Bestunar US6830 HD",
+ { &dw2102_table[BST_6830_Index], NULL },
+ { NULL },
+ },
+ { "Bestunar US6831 HD",
+ { &dw2102_table[BST_6830_Index+1], NULL },
+ { NULL },
+ },
+ }
+};
+
+static struct dvb_usb_device_properties US6832_properties = {
+ .caps = DVB_USB_IS_AN_I2C_ADAPTER,
+ .usb_ctrl = DEVICE_SPECIFIC,
+ .size_of_priv = sizeof(struct su3000_state),
+ .power_ctrl = su3000_power_ctrl,
+ .num_adapters = 1,
+ .identify_state = su3000_identify_state,
+ .i2c_algo = &su3000_i2c_algo,
+
+ .rc.legacy = {
+ .rc_map_table = rc_map_su3000_table,
+ .rc_map_size = ARRAY_SIZE(rc_map_su3000_table),
+ .rc_interval = 150,
+ .rc_query = dw2102_rc_query,
+ },
+
+ .read_mac_address = su3000_read_mac_address,
+
+ .generic_bulk_ctrl_endpoint = 0x01,
+
+ .adapter = {
+ {
+ }
+ },
+ .num_device_descs = 2,
+ .devices = {
+ { "Bestunar US6830 HD",
+ { &dw2102_table[BST_6830_Index], NULL },
+ { NULL },
+ },
+ { "Bestunar US6831 HD",
+ { &dw2102_table[BST_6830_Index+1], NULL },
+ { NULL },
+ },
+ }
+};
+
+static struct dvb_usb_device_properties US6832_properties = {
+ .caps = DVB_USB_IS_AN_I2C_ADAPTER,
+ .usb_ctrl = DEVICE_SPECIFIC,
+ .size_of_priv = sizeof(struct su3000_state),
+ .power_ctrl = su3000_power_ctrl,
+ .num_adapters = 1,
+ .identify_state = su3000_identify_state,
+ .i2c_algo = &su3000_i2c_algo,
+
+ .rc.legacy = {
+ .rc_map_table = rc_map_su3000_table,
+ .rc_map_size = ARRAY_SIZE(rc_map_su3000_table),
+ .rc_interval = 150,
+ .rc_query = dw2102_rc_query,
+ },
+
+ .read_mac_address = su3000_read_mac_address,
+
+ .generic_bulk_ctrl_endpoint = 0x01,
+
+ .adapter = {
+ {
+ .num_frontends = 1,
+ .fe = {{
+ .streaming_ctrl = su3000_streaming_ctrl,
+ .frontend_attach = US6832_frontend_attach,
+ .stream = {
+ .type = USB_BULK,
+ .count = 8,
+ .endpoint = 0x82,
+ .u = {
+ .bulk = {
+ .buffersize = 4096,
+ }
+ }
+ }
+ .streaming_ctrl = su3000_streaming_ctrl,
+ .frontend_attach = US6832_frontend_attach,
+ .stream = {
+ .type = USB_BULK,
+ .count = 8,
+ .endpoint = 0x82,
+ .u = {
+ .bulk = {
+ .buffersize = 4096,
+ }
+ }
+ }
+ }},
+ }
+ },
+ .num_device_descs = 1,
+ .devices = {
+ { "Bestunar US6832 HD",
+ { &dw2102_table[BST_6830_Index+2], NULL },
+ { NULL },
+ },
+
+ }
+ }
+ },
+ .num_device_descs = 1,
+ .devices = {
+ { "Bestunar US6832 HD",
+ { &dw2102_table[BST_6830_Index+2], NULL },
+ { NULL },
+ },
+
+ }
+};
+
static int dw2102_probe(struct usb_interface *intf,
@@ -292,10 +292,10 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/dvb-usb/dw2102.c linux-3.2.10/dri
0 == dvb_usb_device_init(intf, p7500,
THIS_MODULE, NULL, adapter_nr) ||
0 == dvb_usb_device_init(intf, &su3000_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &US6830_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &US6832_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &US6830_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &US6832_properties,
THIS_MODULE, NULL, adapter_nr))
return 0;

@@ -385,356 +385,356 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/frontends/m88ds3103.c linux-3.2.1
+#define UNKNOW_ID 0x0000
+
+/* For M88DS3103 demod dvbs mode.*/
+static u8 ds3103_dvbs_init_tab[] = {
+ 0x23, 0x07,
+ 0x08, 0x03,
+ 0x0c, 0x02,
+ 0x21, 0x54,
+ 0x25, 0x82,
+ 0x27, 0x31,
+ 0x30, 0x08,
+ 0x31, 0x40,
+ 0x32, 0x32,
+ 0x33, 0x35,
+ 0x35, 0xff,
+ 0x3a, 0x00,
+ 0x37, 0x10,
+ 0x38, 0x10,
+ 0x39, 0x02,
+ 0x42, 0x60,
+ 0x4a, 0x80,
+ 0x4b, 0x04,
+ 0x4d, 0x91,
+ 0x5d, 0xc8,
+ 0x50, 0x36,
+ 0x51, 0x36,
+ 0x52, 0x36,
+ 0x53, 0x36,
+ 0x63, 0x0f,
+ 0x64, 0x30,
+ 0x65, 0x40,
+ 0x68, 0x26,
+ 0x69, 0x4c,
+ 0x70, 0x20,
+ 0x71, 0x70,
+ 0x72, 0x04,
+ 0x73, 0x00,
+ 0x70, 0x40,
+ 0x71, 0x70,
+ 0x72, 0x04,
+ 0x73, 0x00,
+ 0x70, 0x60,
+ 0x71, 0x70,
+ 0x72, 0x04,
+ 0x73, 0x00,
+ 0x70, 0x80,
+ 0x71, 0x70,
+ 0x72, 0x04,
+ 0x73, 0x00,
+ 0x70, 0xa0,
+ 0x71, 0x70,
+ 0x72, 0x04,
+ 0x73, 0x00,
+ 0x70, 0x1f,
+ 0x76, 0x38,
+ 0x77, 0xa6,
+ 0x78, 0x0c,
+ 0x79, 0x80,
+ 0x7f, 0x14,
+ 0x7c, 0x00,
+ 0xae, 0x82,
+ 0x80, 0x64,
+ 0x81, 0x66,
+ 0x82, 0x44,
+ 0x85, 0x04,
+ 0xcd, 0xf4,
+ 0x90, 0x33,
+ 0xa0, 0x44,
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+ 0x80, 0xa8,
+ 0x81, 0xda,
+ 0x7c, 0x01,
+ 0x80, 0xda,
+ 0x81, 0xec,
+ 0x7c, 0x02,
+ 0x80, 0xca,
+ 0x81, 0xeb,
+ 0x7c, 0x03,
+ 0x80, 0xba,
+ 0x81, 0xdb,
+ 0x85, 0x08,
+ 0x86, 0x00,
+ 0x87, 0x02,
+ 0x89, 0x80,
+ 0x8b, 0x44,
+ 0x8c, 0xaa,
+ 0x8a, 0x10,
+ 0xba, 0x00,
+ 0xf5, 0x04,
+ 0xd2, 0x32,
+ 0xb8, 0x00,
+};
+
@@ -1059,7 +1059,7 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/frontends/m88ds3103.c linux-3.2.1
+ ldpc_frame_cnt = (tmp1 << 16) | (tmp2 << 8) | tmp3;
+
+ tmp1 = m88ds3103_readreg(state, 0xf8) & 0xff;
+ tmp2 = m88ds3103_readreg(state, 0xf7) & 0xff;
+ tmp2 = m88ds3103_readreg(state, 0xf7) & 0xff;
+ pre_err_packags = tmp1<<8 | tmp2;
+
+ if (ldpc_frame_cnt > 1000){
@@ -1117,70 +1117,70 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/frontends/m88ds3103.c linux-3.2.1
+{
+ struct m88ds3103_state *state = fe->demodulator_priv;
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+ u8 val, npow1, npow2, spow1, cnt;
+ u16 tmp, snr;
+ u8 val, npow1, npow2, spow1, cnt;
+ u16 tmp, snr;
+ u32 npow, spow, snr_total;
+ static const u16 mes_log10[] ={
+ 0, 3010, 4771, 6021, 6990, 7781, 8451, 9031, 9542, 10000,
+ 10414, 10792, 11139, 11461, 11761, 12041, 12304, 12553, 12788, 13010,
+ 13222, 13424, 13617, 13802, 13979, 14150, 14314, 14472, 14624, 14771,
+ 14914, 15052, 15185, 15315, 15441, 15563, 15682, 15798, 15911, 16021,
+ 16128, 16232, 16335, 16435, 16532, 16628, 16721, 16812, 16902, 16990,
+ 17076, 17160, 17243, 17324, 17404, 17482, 17559, 17634, 17709, 17782,
+ 17853, 17924, 17993, 18062, 18129, 18195, 18261, 18325, 18388, 18451,
+ 18513, 18573, 18633, 18692, 18751, 18808, 18865, 18921, 18976, 19031
+ };
+ static const u16 mes_loge[] ={
+ 0, 6931, 10986, 13863, 16094, 17918, 19459, 20794, 21972, 23026,
+ 23979, 24849, 25649, 26391, 27081, 27726, 28332, 28904, 29444, 29957,
+ 30445, 30910, 31355, 31781, 32189, 32581, 32958, 33322, 33673, 34012,
+ 34340, 34657,
+ static const u16 mes_log10[] ={
+ 0, 3010, 4771, 6021, 6990, 7781, 8451, 9031, 9542, 10000,
+ 10414, 10792, 11139, 11461, 11761, 12041, 12304, 12553, 12788, 13010,
+ 13222, 13424, 13617, 13802, 13979, 14150, 14314, 14472, 14624, 14771,
+ 14914, 15052, 15185, 15315, 15441, 15563, 15682, 15798, 15911, 16021,
+ 16128, 16232, 16335, 16435, 16532, 16628, 16721, 16812, 16902, 16990,
+ 17076, 17160, 17243, 17324, 17404, 17482, 17559, 17634, 17709, 17782,
+ 17853, 17924, 17993, 18062, 18129, 18195, 18261, 18325, 18388, 18451,
+ 18513, 18573, 18633, 18692, 18751, 18808, 18865, 18921, 18976, 19031
+ };
+ static const u16 mes_loge[] ={
+ 0, 6931, 10986, 13863, 16094, 17918, 19459, 20794, 21972, 23026,
+ 23979, 24849, 25649, 26391, 27081, 27726, 28332, 28904, 29444, 29957,
+ 30445, 30910, 31355, 31781, 32189, 32581, 32958, 33322, 33673, 34012,
+ 34340, 34657,
+ };
+
+ dprintk("%s()\n", __func__);
+
+ switch (c->delivery_system){
+ case SYS_DVBS:
+ cnt = 10; snr_total = 0;
+ while(cnt > 0){
+ cnt = 10; snr_total = 0;
+ while(cnt > 0){
+ val = m88ds3103_readreg(state, 0xff);
+ snr_total += val;
+ cnt--;
+ }
+ tmp = (u16)(snr_total/80);
+ if(tmp > 0){
+ if (tmp > 32) tmp = 32;
+ snr = (mes_loge[tmp - 1] * 100) / 45;
+ }else{
+ snr = 0;
+ snr_total += val;
+ cnt--;
+ }
+ tmp = (u16)(snr_total/80);
+ if(tmp > 0){
+ if (tmp > 32) tmp = 32;
+ snr = (mes_loge[tmp - 1] * 100) / 45;
+ }else{
+ snr = 0;
+ }
+ break;
+ case SYS_DVBS2:
+ cnt = 10; npow = 0; spow = 0;
+ while(cnt >0){
+ cnt = 10; npow = 0; spow = 0;
+ while(cnt >0){
+ npow1 = m88ds3103_readreg(state, 0x8c) & 0xff;
+ npow2 = m88ds3103_readreg(state, 0x8d) & 0xff;
+ npow += (((npow1 & 0x3f) + (u16)(npow2 << 6)) >> 2);
+
+ npow2 = m88ds3103_readreg(state, 0x8d) & 0xff;
+ npow += (((npow1 & 0x3f) + (u16)(npow2 << 6)) >> 2);
+
+ spow1 = m88ds3103_readreg(state, 0x8e) & 0xff;
+ spow += ((spow1 * spow1) >> 1);
+ cnt--;
+ }
+ npow /= 10; spow /= 10;
+ if(spow == 0){
+ snr = 0;
+ }else if(npow == 0){
+ snr = 19;
+ }else{
+ if(spow > npow){
+ tmp = (u16)(spow / npow);
+ if (tmp > 80) tmp = 80;
+ spow += ((spow1 * spow1) >> 1);
+ cnt--;
+ }
+ npow /= 10; spow /= 10;
+ if(spow == 0){
+ snr = 0;
+ }else if(npow == 0){
+ snr = 19;
+ }else{
+ if(spow > npow){
+ tmp = (u16)(spow / npow);
+ if (tmp > 80) tmp = 80;
+ snr = mes_log10[tmp - 1]*3;
+ }else{
+ tmp = (u16)(npow / spow);
+ if (tmp > 80) tmp = 80;
+ snr = -(mes_log10[tmp - 1] / 1000);
+ }
+ }else{
+ tmp = (u16)(npow / spow);
+ if (tmp > 80) tmp = 80;
+ snr = -(mes_log10[tmp - 1] / 1000);
+ }
+ }
+ break;
+ default:
@@ -1283,39 +1283,39 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/frontends/m88ds3103.c linux-3.2.1
+ }
+ }
+
+ tmp = m88ds3103_readreg(state, 0xa2);
+ tmp &= ~0xc0;
+ if(state->demod_id == DS3103_ID)
+ tmp = m88ds3103_readreg(state, 0xa2);
+ tmp &= ~0xc0;
+ if(state->demod_id == DS3103_ID)
+ tmp &= ~0x20;
+ m88ds3103_writereg(state, 0xa2, tmp);
+ m88ds3103_writereg(state, 0xa2, tmp);
+
+ for (i = 0; i < d->msg_len; i ++)
+ m88ds3103_writereg(state, (0xa3+i), d->msg[i]);
+
+ tmp = m88ds3103_readreg(state, 0xa1);
+ tmp &= ~0x38;
+ tmp &= ~0x40;
+ tmp |= ((d->msg_len-1) << 3) | 0x07;
+ tmp &= ~0x80;
+ m88ds3103_writereg(state, 0xa1, tmp);
+ /* 1.5 * 9 * 8 = 108ms */
+ time_out = 150;
+ while (time_out > 0){
+ msleep(10);
+ time_out -= 10;
+ tmp = m88ds3103_readreg(state, 0xa1);
+ if ((tmp & 0x40) == 0)
+ break;
+ for (i = 0; i < d->msg_len; i ++)
+ m88ds3103_writereg(state, (0xa3+i), d->msg[i]);
+
+ tmp = m88ds3103_readreg(state, 0xa1);
+ tmp &= ~0x38;
+ tmp &= ~0x40;
+ tmp |= ((d->msg_len-1) << 3) | 0x07;
+ tmp &= ~0x80;
+ m88ds3103_writereg(state, 0xa1, tmp);
+ /* 1.5 * 9 * 8 = 108ms */
+ time_out = 150;
+ while (time_out > 0){
+ msleep(10);
+ time_out -= 10;
+ tmp = m88ds3103_readreg(state, 0xa1);
+ if ((tmp & 0x40) == 0)
+ break;
+ }
+ if (time_out == 0){
+ tmp = m88ds3103_readreg(state, 0xa1);
+ tmp &= ~0x80;
+ if (time_out == 0){
+ tmp = m88ds3103_readreg(state, 0xa1);
+ tmp &= ~0x80;
+ tmp |= 0x40;
+ m88ds3103_writereg(state, 0xa1, tmp);
+ ret = 1;
+ m88ds3103_writereg(state, 0xa1, tmp);
+ ret = 1;
+ }
+ tmp = m88ds3103_readreg(state, 0xa2);
+ tmp &= ~0xc0;
+ tmp &= ~0xc0;
+ tmp |= 0x80;
+ m88ds3103_writereg(state, 0xa2, tmp);
+ return ret;
@@ -1327,34 +1327,34 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/frontends/m88ds3103.c linux-3.2.1
+{
+ struct m88ds3103_state *state = fe->demodulator_priv;
+ u8 val, time_out;
+
+ dprintk("%s()\n", __func__);
+
+
+ dprintk("%s()\n", __func__);
+
+ val = m88ds3103_readreg(state, 0xa2);
+ val &= ~0xc0;
+ if(state->demod_id == DS3103_ID)
+ val &= 0xdf; /* Normal mode */
+ val &= 0xdf; /* Normal mode */
+ m88ds3103_writereg(state, 0xa2, val);
+ /* DiSEqC burst */
+ if (burst == SEC_MINI_B)
+ if (burst == SEC_MINI_B)
+ m88ds3103_writereg(state, 0xa1, 0x01);
+ else
+ else
+ m88ds3103_writereg(state, 0xa1, 0x02);
+
+ msleep(13);
+
+ time_out = 5;
+ do{
+ val = m88ds3103_readreg(state, 0xa1);
+ if ((val & 0x40) == 0)
+ break;
+ msleep(1);
+ time_out --;
+ } while (time_out > 0);
+
+ val = m88ds3103_readreg(state, 0xa2);
+ val &= ~0xc0;
+ val |= 0x80;
+
+ msleep(13);
+
+ time_out = 5;
+ do{
+ val = m88ds3103_readreg(state, 0xa1);
+ if ((val & 0x40) == 0)
+ break;
+ msleep(1);
+ time_out --;
+ } while (time_out > 0);
+
+ val = m88ds3103_readreg(state, 0xa2);
+ val &= ~0xc0;
+ val |= 0x80;
+ m88ds3103_writereg(state, 0xa2, val);
+
+ return 0;
@@ -1544,7 +1544,7 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/frontends/m88ds3103.c linux-3.2.1
+
+ div4 = 0;
+ if(state->tuner_id == TS2022_ID){
+ m88ds3103_tuner_writereg(state, 0x10, 0x0a);
+ m88ds3103_tuner_writereg(state, 0x10, 0x0a);
+ m88ds3103_tuner_writereg(state, 0x11, 0x40);
+ if (p->frequency < 1103000) {
+ m88ds3103_tuner_writereg(state, 0x10, 0x1b);
@@ -1556,9 +1556,9 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/frontends/m88ds3103.c linux-3.2.1
+ ndiv = ndiv + ndiv%2;
+ if(ndiv < 4095)
+ ndiv = ndiv - 1024;
+ else if (ndiv < 6143)
+ ndiv = ndiv + 1024;
+ else
+ else if (ndiv < 6143)
+ ndiv = ndiv + 1024;
+ else
+ ndiv = ndiv + 3072;
+
+ m88ds3103_tuner_writereg(state, 0x01, (ndiv & 0x3f00) >> 8);
@@ -1585,48 +1585,48 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/frontends/m88ds3103.c linux-3.2.1
+ m88ds3103_tuner_writereg(state, 0x50, 0x00);
+
+ if(state->tuner_id == TS2022_ID){
+ if(( p->frequency >= 1650000 ) && (p->frequency <= 1850000)){
+ msleep(5);
+ value = m88ds3103_tuner_readreg(state, 0x14);
+ value &= 0x7f;
+ if(value < 64){
+ m88ds3103_tuner_writereg(state, 0x10, 0x82);
+ m88ds3103_tuner_writereg(state, 0x11, 0x6f);
+
+ m88ds3103_tuner_writereg(state, 0x51, 0x0f);
+ m88ds3103_tuner_writereg(state, 0x51, 0x1f);
+ m88ds3103_tuner_writereg(state, 0x50, 0x10);
+ m88ds3103_tuner_writereg(state, 0x50, 0x00);
+ }
+ }
+ msleep(5);
+ value = m88ds3103_tuner_readreg(state, 0x14);
+ value &= 0x1f;
+
+ if(value > 19){
+ if(( p->frequency >= 1650000 ) && (p->frequency <= 1850000)){
+ msleep(5);
+ value = m88ds3103_tuner_readreg(state, 0x14);
+ value &= 0x7f;
+ if(value < 64){
+ m88ds3103_tuner_writereg(state, 0x10, 0x82);
+ m88ds3103_tuner_writereg(state, 0x11, 0x6f);
+
+ m88ds3103_tuner_writereg(state, 0x51, 0x0f);
+ m88ds3103_tuner_writereg(state, 0x51, 0x1f);
+ m88ds3103_tuner_writereg(state, 0x50, 0x10);
+ m88ds3103_tuner_writereg(state, 0x50, 0x00);
+ }
+ }
+ msleep(5);
+ value = m88ds3103_tuner_readreg(state, 0x14);
+ value &= 0x1f;
+
+ if(value > 19){
+ value = m88ds3103_tuner_readreg(state, 0x10);
+ value &= 0x1d;
+ m88ds3103_tuner_writereg(state, 0x10, value);
+ value &= 0x1d;
+ m88ds3103_tuner_writereg(state, 0x10, value);
+ }
+ }else{
+ msleep(5);
+ value = m88ds3103_tuner_readreg(state, 0x66);
+ changePLL = (((value & 0x80) >> 7) != div4);
+
+ value = m88ds3103_tuner_readreg(state, 0x66);
+ changePLL = (((value & 0x80) >> 7) != div4);
+
+ if(changePLL){
+ m88ds3103_tuner_writereg(state, 0x10, 0x11);
+ div4 = 1;
+ ndiv = (p->frequency * (6 + 8) * 4)/MT_FE_CRYSTAL_KHZ;
+ ndiv = ndiv + ndiv%2;
+ ndiv = ndiv - 1024;
+
+
+ m88ds3103_tuner_writereg(state, 0x01, (ndiv>>8) & 0x0f);
+ m88ds3103_tuner_writereg(state, 0x02, ndiv & 0xff);
+
+ m88ds3103_tuner_writereg(state, 0x51, 0x0f);
+ m88ds3103_tuner_writereg(state, 0x51, 0x1f);
+ m88ds3103_tuner_writereg(state, 0x50, 0x10);
+ m88ds3103_tuner_writereg(state, 0x50, 0x00);
+ m88ds3103_tuner_writereg(state, 0x51, 0x0f);
+ m88ds3103_tuner_writereg(state, 0x51, 0x1f);
+ m88ds3103_tuner_writereg(state, 0x50, 0x10);
+ m88ds3103_tuner_writereg(state, 0x50, 0x00);
+ }
+ }
+ /*set the RF gain*/
@@ -1657,11 +1657,11 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/frontends/m88ds3103.c linux-3.2.1
+ }
+
+ /* set the LPF */
+ if(state->tuner_id == TS2022_ID){
+ m88ds3103_tuner_writereg(state, 0x25, 0x00);
+ m88ds3103_tuner_writereg(state, 0x27, 0x70);
+ m88ds3103_tuner_writereg(state, 0x41, 0x09);
+ m88ds3103_tuner_writereg(state, 0x08, 0x0b);
+ if(state->tuner_id == TS2022_ID){
+ m88ds3103_tuner_writereg(state, 0x25, 0x00);
+ m88ds3103_tuner_writereg(state, 0x27, 0x70);
+ m88ds3103_tuner_writereg(state, 0x41, 0x09);
+ m88ds3103_tuner_writereg(state, 0x08, 0x0b);
+ }
+
+ f3db = ((c->symbol_rate / 1000) *135) / 200 + 2000;
@@ -1682,17 +1682,17 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/frontends/m88ds3103.c linux-3.2.1
+ value = m88ds3103_tuner_readreg(state, 0x26);
+ capCode = value & 0x3f;
+ if(state->tuner_id == TS2022_ID){
+ m88ds3103_tuner_writereg(state, 0x41, 0x0d);
+
+ m88ds3103_tuner_writereg(state, 0x51, 0x1b);
+ m88ds3103_tuner_writereg(state, 0x51, 0x1f);
+ m88ds3103_tuner_writereg(state, 0x50, 0x04);
+ m88ds3103_tuner_writereg(state, 0x50, 0x00);
+
+ msleep(2);
+
+ value = m88ds3103_tuner_readreg(state, 0x26);
+ value &= 0x3f;
+ m88ds3103_tuner_writereg(state, 0x41, 0x0d);
+
+ m88ds3103_tuner_writereg(state, 0x51, 0x1b);
+ m88ds3103_tuner_writereg(state, 0x51, 0x1f);
+ m88ds3103_tuner_writereg(state, 0x50, 0x04);
+ m88ds3103_tuner_writereg(state, 0x50, 0x00);
+
+ msleep(2);
+
+ value = m88ds3103_tuner_readreg(state, 0x26);
+ value &= 0x3f;
+ value = (capCode + value) / 2;
+ }
+ else
@@ -1732,26 +1732,26 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/frontends/m88ds3103.c linux-3.2.1
+ msleep(5);
+
+ if(state->tuner_id == TS2022_ID){
+ msleep(2);
+ value = m88ds3103_tuner_readreg(state, 0x26);
+ capCode = value & 0x3f;
+
+ m88ds3103_tuner_writereg(state, 0x41, 0x09);
+
+ m88ds3103_tuner_writereg(state, 0x51, 0x1b);
+ m88ds3103_tuner_writereg(state, 0x51, 0x1f);
+ m88ds3103_tuner_writereg(state, 0x50, 0x04);
+ m88ds3103_tuner_writereg(state, 0x50, 0x00);
+
+ msleep(2);
+ value = m88ds3103_tuner_readreg(state, 0x26);
+ value &= 0x3f;
+ value = (capCode + value) / 2;
+
+ value = value | 0x80;
+ m88ds3103_tuner_writereg(state, 0x25, value);
+ m88ds3103_tuner_writereg(state, 0x27, 0x30);
+
+ msleep(2);
+ value = m88ds3103_tuner_readreg(state, 0x26);
+ capCode = value & 0x3f;
+
+ m88ds3103_tuner_writereg(state, 0x41, 0x09);
+
+ m88ds3103_tuner_writereg(state, 0x51, 0x1b);
+ m88ds3103_tuner_writereg(state, 0x51, 0x1f);
+ m88ds3103_tuner_writereg(state, 0x50, 0x04);
+ m88ds3103_tuner_writereg(state, 0x50, 0x00);
+
+ msleep(2);
+ value = m88ds3103_tuner_readreg(state, 0x26);
+ value &= 0x3f;
+ value = (capCode + value) / 2;
+
+ value = value | 0x80;
+ m88ds3103_tuner_writereg(state, 0x25, value);
+ m88ds3103_tuner_writereg(state, 0x27, 0x30);
+
+ m88ds3103_tuner_writereg(state, 0x08, 0x09);
+ }
+
@@ -1763,14 +1763,14 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/frontends/m88ds3103.c linux-3.2.1
+ if(state->tuner_id == TS2020_ID){
+ if(RFgain == 15){
+ msleep(40);
+ value = m88ds3103_tuner_readreg(state, 0x21);
+ value &= 0x0f;
+ value = m88ds3103_tuner_readreg(state, 0x21);
+ value &= 0x0f;
+ if(value < 3){
+ m88ds3103_tuner_writereg(state, 0x60, 0x61);
+ m88ds3103_tuner_writereg(state, 0x51, 0x17);
+ m88ds3103_tuner_writereg(state, 0x51, 0x1f);
+ m88ds3103_tuner_writereg(state, 0x50, 0x08);
+ m88ds3103_tuner_writereg(state, 0x50, 0x00);
+ m88ds3103_tuner_writereg(state, 0x50, 0x00);
+ }
+ }
+ }
@@ -1834,7 +1834,7 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/frontends/m88ds3103.c linux-3.2.1
+
+ val1 &= 0x3f;
+ val2 &= 0x3f;
+ val1 |= 0x80;
+ val1 |= 0x80;
+ val2 |= 0x40;
+
+ m88ds3103_writereg(state, 0x22, val1);
@@ -1888,7 +1888,7 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/frontends/m88ds3103.c linux-3.2.1
+ val1 &= 0x3f;
+ val2 &= 0x3f;
+ if(state->config->ts_mode == 1){
+ val1 |= 0x80;
+ val1 |= 0x80;
+ val2 |= 0x40;
+ }else{
+ if (c->symbol_rate >= 28000000){
@@ -1921,21 +1921,21 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/frontends/m88ds3103.c linux-3.2.1
+ /* enable ac coupling */
+ m88ds3103_writereg(state, 0x25, 0x8a);
+
+ if ((c->symbol_rate / 1000) <= 3000){
+ m88ds3103_writereg(state, 0xc3, 0x08); /* 8 * 32 * 100 / 64 = 400*/
+ m88ds3103_writereg(state, 0xc8, 0x20);
+ m88ds3103_writereg(state, 0xc4, 0x08); /* 8 * 0 * 100 / 128 = 0*/
+ m88ds3103_writereg(state, 0xc7, 0x00);
+ }else if((c->symbol_rate / 1000) <= 10000){
+ m88ds3103_writereg(state, 0xc3, 0x08); /* 8 * 16 * 100 / 64 = 200*/
+ m88ds3103_writereg(state, 0xc8, 0x10);
+ m88ds3103_writereg(state, 0xc4, 0x08); /* 8 * 0 * 100 / 128 = 0*/
+ m88ds3103_writereg(state, 0xc7, 0x00);
+ }else{
+ m88ds3103_writereg(state, 0xc3, 0x08); /* 8 * 6 * 100 / 64 = 75*/
+ m88ds3103_writereg(state, 0xc8, 0x06);
+ m88ds3103_writereg(state, 0xc4, 0x08); /* 8 * 0 * 100 / 128 = 0*/
+ m88ds3103_writereg(state, 0xc7, 0x00);
+ if ((c->symbol_rate / 1000) <= 3000){
+ m88ds3103_writereg(state, 0xc3, 0x08); /* 8 * 32 * 100 / 64 = 400*/
+ m88ds3103_writereg(state, 0xc8, 0x20);
+ m88ds3103_writereg(state, 0xc4, 0x08); /* 8 * 0 * 100 / 128 = 0*/
+ m88ds3103_writereg(state, 0xc7, 0x00);
+ }else if((c->symbol_rate / 1000) <= 10000){
+ m88ds3103_writereg(state, 0xc3, 0x08); /* 8 * 16 * 100 / 64 = 200*/
+ m88ds3103_writereg(state, 0xc8, 0x10);
+ m88ds3103_writereg(state, 0xc4, 0x08); /* 8 * 0 * 100 / 128 = 0*/
+ m88ds3103_writereg(state, 0xc7, 0x00);
+ }else{
+ m88ds3103_writereg(state, 0xc3, 0x08); /* 8 * 6 * 100 / 64 = 75*/
+ m88ds3103_writereg(state, 0xc8, 0x06);
+ m88ds3103_writereg(state, 0xc4, 0x08); /* 8 * 0 * 100 / 128 = 0*/
+ m88ds3103_writereg(state, 0xc7, 0x00);
+ }
+
+ m88ds3103_set_symrate(fe);
@@ -1951,33 +1951,33 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/frontends/m88ds3103.c linux-3.2.1
+
+ for (i = 0; i < 30 ; i++) {
+ m88ds3103_read_status(fe, &status);
+ if (status && FE_HAS_LOCK){
+ if(state->config->start_ctrl){
+ if(state->first_lock == 0){
+ state->config->start_ctrl(fe);
+ state->first_lock = 1;
+ }
+ }
+ break;
+ if (status && FE_HAS_LOCK){
+ if(state->config->start_ctrl){
+ if(state->first_lock == 0){
+ state->config->start_ctrl(fe);
+ state->first_lock = 1;
+ }
+ }
+ break;
+ }
+ msleep(10);
+ }
+ return 0;
+}
+
+static int m88ds3103_tune(struct dvb_frontend *fe,
+ struct dvb_frontend_parameters *params,
+ unsigned int mode_flags,
+ unsigned int *delay,
+ fe_status_t *status)
+{
+static int m88ds3103_tune(struct dvb_frontend *fe,
+ struct dvb_frontend_parameters *params,
+ unsigned int mode_flags,
+ unsigned int *delay,
+ fe_status_t *status)
+{
+ *delay = HZ / 5;
+ if (params) {
+ int ret = m88ds3103_set_frontend(fe, params);
+ if (ret)
+ return ret;
+ }
+ return m88ds3103_read_status(fe, status);
+ if (params) {
+ int ret = m88ds3103_set_frontend(fe, params);
+ if (ret)
+ return ret;
+ }
+ return m88ds3103_read_status(fe, status);
+}
+
+static enum dvbfe_algo m88ds3103_get_algo(struct dvb_frontend *fe)
@@ -2008,7 +2008,7 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/frontends/m88ds3103.c linux-3.2.1
+ msleep(2);
+ m88ds3103_tuner_writereg(state, 0x05, 0x01);
+ m88ds3103_tuner_writereg(state, 0x62, 0xb5);
+ m88ds3103_tuner_writereg(state, 0x07, 0x02);
+ m88ds3103_tuner_writereg(state, 0x07, 0x02);
+ m88ds3103_tuner_writereg(state, 0x08, 0x01);
+ }
+ else if(state->tuner_id == TS2022_ID){
@@ -2017,18 +2017,18 @@ diff -uprN linux-3.2.10.orig/drivers/media/dvb/frontends/m88ds3103.c linux-3.2.1
+ msleep(2);
+ m88ds3103_tuner_writereg(state, 0x42, 0x6c);
+ msleep(2);
+ m88ds3103_tuner_writereg(state, 0x7d, 0x9d);
+ m88ds3103_tuner_writereg(state, 0x7c, 0x9a);
+ m88ds3103_tuner_writereg(state, 0x7a, 0x76);
+
+ m88ds3103_tuner_writereg(state, 0x3b, 0x01);
+ m88ds3103_tuner_writereg(state, 0x63, 0x88);
+
+ m88ds3103_tuner_writereg(state, 0x61, 0x85);
+ m88ds3103_tuner_writereg(state, 0x22, 0x30);
+ m88ds3103_tuner_writereg(state, 0x30, 0x40);
+ m88ds3103_tuner_writereg(state, 0x20, 0x23);
+ m88ds3103_tuner_writereg(state, 0x24, 0x02);
+ m88ds3103_tuner_writereg(state, 0x7d, 0x9d);
+ m88ds3103_tuner_writereg(state, 0x7c, 0x9a);
+ m88ds3103_tuner_writereg(state, 0x7a, 0x76);
+
+ m88ds3103_tuner_writereg(state, 0x3b, 0x01);
+ m88ds3103_tuner_writereg(state, 0x63, 0x88);
+
+ m88ds3103_tuner_writereg(state, 0x61, 0x85);
+ m88ds3103_tuner_writereg(state, 0x22, 0x30);
+ m88ds3103_tuner_writereg(state, 0x30, 0x40);
+ m88ds3103_tuner_writereg(state, 0x20, 0x23);
+ m88ds3103_tuner_writereg(state, 0x24, 0x02);
+ m88ds3103_tuner_writereg(state, 0x12, 0xa0);
+ }
+
@@ -2311,20 +2311,20 @@ diff -uprN linux-3.2.10.orig/drivers/media/video/cx23885/cx23885-cards.c linux-3
.amux = CX25840_AUDIO7,
.gpio0 = 0,
} },
+ },
+ [CX23885_BOARD_BST_PS8512] = {
+ .name = "Bestunar PS8512",
+ .portb = CX23885_MPEG_DVB,
+ },
+ [CX23885_BOARD_DVBSKY_S950] = {
+ .name = "DVBSKY S950",
+ .portb = CX23885_MPEG_DVB,
+ },
+ [CX23885_BOARD_BST_PS8512] = {
+ .name = "Bestunar PS8512",
+ .portb = CX23885_MPEG_DVB,
+ },
+ [CX23885_BOARD_DVBSKY_S950] = {
+ .name = "DVBSKY S950",
+ .portb = CX23885_MPEG_DVB,
},
+ [CX23885_BOARD_DVBSKY_S952] = {
+ .name = "DVBSKY S952",
+ .portb = CX23885_MPEG_DVB,
+ .portc = CX23885_MPEG_DVB,
+ },
+ [CX23885_BOARD_DVBSKY_S952] = {
+ .name = "DVBSKY S952",
+ .portb = CX23885_MPEG_DVB,
+ .portc = CX23885_MPEG_DVB,
+ },
+
};
const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);
@@ -2333,18 +2333,18 @@ diff -uprN linux-3.2.10.orig/drivers/media/video/cx23885/cx23885-cards.c linux-3
.subvendor = 0x1b55,
.subdevice = 0xe2e4,
.card = CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF,
+ }, {
+ .subvendor = 0x14f1,
+ .subdevice = 0x8512,
+ .card = CX23885_BOARD_BST_PS8512,
+ }, {
+ .subvendor = 0x4254,
+ .subdevice = 0x0950,
+ .subvendor = 0x14f1,
+ .subdevice = 0x8512,
+ .card = CX23885_BOARD_BST_PS8512,
+ }, {
+ .subvendor = 0x4254,
+ .subdevice = 0x0950,
+ .card = CX23885_BOARD_DVBSKY_S950,
+ }, {
+ .subvendor = 0x4254,
+ .subdevice = 0x0952,
+ .card = CX23885_BOARD_DVBSKY_S952,
+ }, {
+ .subvendor = 0x4254,
+ .subdevice = 0x0952,
+ .card = CX23885_BOARD_DVBSKY_S952,
},
};
const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);
@@ -2353,24 +2353,24 @@ diff -uprN linux-3.2.10.orig/drivers/media/video/cx23885/cx23885-cards.c linux-3
cx_write(GPIO_ISM, 0x00000000);/* INTERRUPTS active low*/
break;
+ case CX23885_BOARD_DVBSKY_S950:
+ case CX23885_BOARD_BST_PS8512:
+ cx23885_gpio_enable(dev, GPIO_2, 1);
+ cx23885_gpio_clear(dev, GPIO_2);
+ msleep(100);
+ case CX23885_BOARD_BST_PS8512:
+ cx23885_gpio_enable(dev, GPIO_2, 1);
+ cx23885_gpio_clear(dev, GPIO_2);
+ msleep(100);
+ cx23885_gpio_set(dev, GPIO_2);
+ break;
+ case CX23885_BOARD_DVBSKY_S952:
+ cx_write(MC417_CTL, 0x00000037);/* enable GPIO3-18 pins */
+
+ cx23885_gpio_enable(dev, GPIO_2, 1);
+ cx23885_gpio_enable(dev, GPIO_11, 1);
+
+ cx23885_gpio_clear(dev, GPIO_2);
+ cx23885_gpio_clear(dev, GPIO_11);
+ msleep(100);
+ cx23885_gpio_set(dev, GPIO_2);
+ cx23885_gpio_set(dev, GPIO_11);
+
+ case CX23885_BOARD_DVBSKY_S952:
+ cx_write(MC417_CTL, 0x00000037);/* enable GPIO3-18 pins */
+
+ cx23885_gpio_enable(dev, GPIO_2, 1);
+ cx23885_gpio_enable(dev, GPIO_11, 1);
+
+ cx23885_gpio_clear(dev, GPIO_2);
+ cx23885_gpio_clear(dev, GPIO_11);
+ msleep(100);
+ cx23885_gpio_set(dev, GPIO_2);
+ cx23885_gpio_set(dev, GPIO_11);
+
+ break;
}
}
@@ -2469,13 +2469,13 @@ diff -uprN linux-3.2.10.orig/drivers/media/video/cx23885/cx23885-cards.c linux-3
ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */
ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
break;
+ case CX23885_BOARD_DVBSKY_S952:
+ ts1->gen_ctrl_val = 0x5; /* Parallel */
+ ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */
+ ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
+ ts2->gen_ctrl_val = 0xe; /* Serial bus + punctured clock */
+ ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */
+ ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
+ case CX23885_BOARD_DVBSKY_S952:
+ ts1->gen_ctrl_val = 0x5; /* Parallel */
+ ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */
+ ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
+ ts2->gen_ctrl_val = 0xe; /* Serial bus + punctured clock */
+ ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */
+ ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
+ break;
case CX23885_BOARD_HAUPPAUGE_HVR1250:
case CX23885_BOARD_HAUPPAUGE_HVR1500:
@@ -2505,29 +2505,29 @@ diff -uprN linux-3.2.10.orig/drivers/media/video/cx23885/cx23885-dvb.c linux-3.2
.if_khz = 5380,
};

+/* bestunar single dvb-s2 */
+static struct m88ds3103_config bst_ds3103_config = {
+ .demod_address = 0x68,
+ .ci_mode = 0,
+ .pin_ctrl = 0x82,
+ .ts_mode = 0,
+ .set_voltage = bst_set_voltage,
+};
+/* DVBSKY dual dvb-s2 */
+static struct m88ds3103_config dvbsky_ds3103_config_pri = {
+ .demod_address = 0x68,
+ .ci_mode = 0,
+ .pin_ctrl = 0x82,
+ .ts_mode = 0,
+ .set_voltage = bst_set_voltage,
+};
+static struct m88ds3103_config dvbsky_ds3103_config_sec = {
+ .demod_address = 0x68,
+ .ci_mode = 0,
+ .pin_ctrl = 0x82,
+ .ts_mode = 1,
+ .set_voltage = dvbsky_set_voltage_sec,
+};
+/* bestunar single dvb-s2 */
+static struct m88ds3103_config bst_ds3103_config = {
+ .demod_address = 0x68,
+ .ci_mode = 0,
+ .pin_ctrl = 0x82,
+ .ts_mode = 0,
+ .set_voltage = bst_set_voltage,
+};
+/* DVBSKY dual dvb-s2 */
+static struct m88ds3103_config dvbsky_ds3103_config_pri = {
+ .demod_address = 0x68,
+ .ci_mode = 0,
+ .pin_ctrl = 0x82,
+ .ts_mode = 0,
+ .set_voltage = bst_set_voltage,
+};
+static struct m88ds3103_config dvbsky_ds3103_config_sec = {
+ .demod_address = 0x68,
+ .ci_mode = 0,
+ .pin_ctrl = 0x82,
+ .ts_mode = 1,
+ .set_voltage = dvbsky_set_voltage_sec,
+};
+
static int cx23885_dvb_set_frontend(struct dvb_frontend *fe,
struct dvb_frontend_parameters *param)
@@ -2537,30 +2537,30 @@ diff -uprN linux-3.2.10.orig/drivers/media/video/cx23885/cx23885-dvb.c linux-3.2
}
break;
+ case CX23885_BOARD_BST_PS8512:
+ case CX23885_BOARD_DVBSKY_S950:
+ i2c_bus = &dev->i2c_bus[1];
+ fe0->dvb.frontend = dvb_attach(m88ds3103_attach,
+ &bst_ds3103_config,
+ &i2c_bus->i2c_adap);
+ break;
+
+ case CX23885_BOARD_DVBSKY_S952:
+ switch (port->nr) {
+ /* port B */
+ case 1:
+ i2c_bus = &dev->i2c_bus[1];
+ fe0->dvb.frontend = dvb_attach(m88ds3103_attach,
+ &dvbsky_ds3103_config_pri,
+ &i2c_bus->i2c_adap);
+ break;
+ /* port C */
+ case 2:
+ i2c_bus = &dev->i2c_bus[0];
+ fe0->dvb.frontend = dvb_attach(m88ds3103_attach,
+ &dvbsky_ds3103_config_sec,
+ &i2c_bus->i2c_adap);
+ break;
+ }
+ case CX23885_BOARD_DVBSKY_S950:
+ i2c_bus = &dev->i2c_bus[1];
+ fe0->dvb.frontend = dvb_attach(m88ds3103_attach,
+ &bst_ds3103_config,
+ &i2c_bus->i2c_adap);
+ break;
+
+ case CX23885_BOARD_DVBSKY_S952:
+ switch (port->nr) {
+ /* port B */
+ case 1:
+ i2c_bus = &dev->i2c_bus[1];
+ fe0->dvb.frontend = dvb_attach(m88ds3103_attach,
+ &dvbsky_ds3103_config_pri,
+ &i2c_bus->i2c_adap);
+ break;
+ /* port C */
+ case 2:
+ i2c_bus = &dev->i2c_bus[0];
+ fe0->dvb.frontend = dvb_attach(m88ds3103_attach,
+ &dvbsky_ds3103_config_sec,
+ &i2c_bus->i2c_adap);
+ break;
+ }
+ break;
default:
printk(KERN_INFO "%s: The frontend of your DVB/ATSC card "
@@ -3871,69 +3871,69 @@ diff -uprN linux-3.2.10.orig/drivers/media/video/cx23885/cx23885-f300.c linux-3.
return f300_xfer(fe, buf);
}
+
+/* bst control */
+int bst_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
+{
+ struct cx23885_tsport *port = fe->dvb->priv;
+ struct cx23885_dev *dev = port->dev;
+
+ cx23885_gpio_enable(dev, GPIO_1, 1);
+ cx23885_gpio_enable(dev, GPIO_0, 1);
+
+ switch (voltage) {
+ case SEC_VOLTAGE_13:
+ cx23885_gpio_set(dev, GPIO_1);
+ cx23885_gpio_clear(dev, GPIO_0);
+ break;
+ case SEC_VOLTAGE_18:
+ cx23885_gpio_set(dev, GPIO_1);
+ cx23885_gpio_set(dev, GPIO_0);
+ break;
+ case SEC_VOLTAGE_OFF:
+ cx23885_gpio_clear(dev, GPIO_1);
+ cx23885_gpio_clear(dev, GPIO_0);
+ break;
+ }
+
+
+ return 0;
+}
+
+int dvbsky_set_voltage_sec(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
+{
+ struct cx23885_tsport *port = fe->dvb->priv;
+ struct cx23885_dev *dev = port->dev;
+
+ cx23885_gpio_enable(dev, GPIO_12, 1);
+ cx23885_gpio_enable(dev, GPIO_13, 1);
+
+ switch (voltage) {
+ case SEC_VOLTAGE_13:
+ cx23885_gpio_set(dev, GPIO_13);
+ cx23885_gpio_clear(dev, GPIO_12);
+ break;
+ case SEC_VOLTAGE_18:
+ cx23885_gpio_set(dev, GPIO_13);
+ cx23885_gpio_set(dev, GPIO_12);
+ break;
+ case SEC_VOLTAGE_OFF:
+ cx23885_gpio_clear(dev, GPIO_13);
+ cx23885_gpio_clear(dev, GPIO_12);
+ break;
+ }
+
+
+ return 0;
+/* bst control */
+int bst_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
+{
+ struct cx23885_tsport *port = fe->dvb->priv;
+ struct cx23885_dev *dev = port->dev;
+
+ cx23885_gpio_enable(dev, GPIO_1, 1);
+ cx23885_gpio_enable(dev, GPIO_0, 1);
+
+ switch (voltage) {
+ case SEC_VOLTAGE_13:
+ cx23885_gpio_set(dev, GPIO_1);
+ cx23885_gpio_clear(dev, GPIO_0);
+ break;
+ case SEC_VOLTAGE_18:
+ cx23885_gpio_set(dev, GPIO_1);
+ cx23885_gpio_set(dev, GPIO_0);
+ break;
+ case SEC_VOLTAGE_OFF:
+ cx23885_gpio_clear(dev, GPIO_1);
+ cx23885_gpio_clear(dev, GPIO_0);
+ break;
+ }
+
+
+ return 0;
+}
+
+int dvbsky_set_voltage_sec(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
+{
+ struct cx23885_tsport *port = fe->dvb->priv;
+ struct cx23885_dev *dev = port->dev;
+
+ cx23885_gpio_enable(dev, GPIO_12, 1);
+ cx23885_gpio_enable(dev, GPIO_13, 1);
+
+ switch (voltage) {
+ case SEC_VOLTAGE_13:
+ cx23885_gpio_set(dev, GPIO_13);
+ cx23885_gpio_clear(dev, GPIO_12);
+ break;
+ case SEC_VOLTAGE_18:
+ cx23885_gpio_set(dev, GPIO_13);
+ cx23885_gpio_set(dev, GPIO_12);
+ break;
+ case SEC_VOLTAGE_OFF:
+ cx23885_gpio_clear(dev, GPIO_13);
+ cx23885_gpio_clear(dev, GPIO_12);
+ break;
+ }
+
+
+ return 0;
+}
+
diff -uprN linux-3.2.10.orig/drivers/media/video/cx23885/cx23885-f300.h linux-3.2.10/drivers/media/video/cx23885/cx23885-f300.h
--- linux-3.2.10.orig/drivers/media/video/cx23885/cx23885-f300.h 2012-03-16 10:41:16.000000000 +0100
+++ linux-3.2.10/drivers/media/video/cx23885/cx23885-f300.h 2012-03-16 10:55:17.000000000 +0100
@@ -1,2 +1,8 @@
+extern int dvbsky_set_voltage_sec(struct dvb_frontend *fe,
+extern int dvbsky_set_voltage_sec(struct dvb_frontend *fe,
+ fe_sec_voltage_t voltage);
+
+extern int bst_set_voltage(struct dvb_frontend *fe,
+extern int bst_set_voltage(struct dvb_frontend *fe,
+ fe_sec_voltage_t voltage);
+
extern int f300_set_voltage(struct dvb_frontend *fe,
@@ -3945,7 +3945,7 @@ diff -uprN linux-3.2.10.orig/drivers/media/video/cx23885/cx23885.h linux-3.2.10/
#define CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF 30
#define CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000 31
#define CX23885_BOARD_MPX885 32
+#define CX23885_BOARD_BST_PS8512 (CX23885_BOARD_MPX885+1)
+#define CX23885_BOARD_BST_PS8512 (CX23885_BOARD_MPX885+1)
+#define CX23885_BOARD_DVBSKY_S952 (CX23885_BOARD_BST_PS8512+1)
+#define CX23885_BOARD_DVBSKY_S950 (CX23885_BOARD_DVBSKY_S952+1)

@@ -4008,17 +4008,17 @@ diff -uprN linux-3.2.10.orig/drivers/media/video/cx88/cx88-cards.c linux-3.2.10/
} },
.mpeg = CX88_MPEG_DVB,
},
+ [CX88_BOARD_BST_PS8312] = {
+ .name = "Bestunar PS8312 DVB-S/S2",
+ .tuner_type = UNSET,
+ .radio_type = UNSET,
+ .tuner_addr = ADDR_UNSET,
+ .radio_addr = ADDR_UNSET,
+ .input = {{
+ .type = CX88_VMUX_DVB,
+ .vmux = 0,
+ } },
+ .mpeg = CX88_MPEG_DVB,
+ [CX88_BOARD_BST_PS8312] = {
+ .name = "Bestunar PS8312 DVB-S/S2",
+ .tuner_type = UNSET,
+ .radio_type = UNSET,
+ .tuner_addr = ADDR_UNSET,
+ .radio_addr = ADDR_UNSET,
+ .input = {{
+ .type = CX88_VMUX_DVB,
+ .vmux = 0,
+ } },
+ .mpeg = CX88_MPEG_DVB,
+ },
};

@@ -4027,10 +4027,10 @@ diff -uprN linux-3.2.10.orig/drivers/media/video/cx88/cx88-cards.c linux-3.2.10/
.subvendor = 0x1822,
.subdevice = 0x0023,
.card = CX88_BOARD_TWINHAN_VP1027_DVBS,
+ }, {
+ .subvendor = 0x14f1,
+ .subdevice = 0x8312,
+ .card = CX88_BOARD_BST_PS8312,
+ }, {
+ .subvendor = 0x14f1,
+ .subdevice = 0x8312,
+ .card = CX88_BOARD_BST_PS8312,
},
};

@@ -4039,12 +4039,12 @@ diff -uprN linux-3.2.10.orig/drivers/media/video/cx88/cx88-cards.c linux-3.2.10/
cx_write(MO_SRST_IO, 1);
msleep(100);
- break;
+ break;
+ case CX88_BOARD_BST_PS8312:
+ cx_write(MO_GP1_IO, 0x808000);
+ msleep(100);
+ cx_write(MO_GP1_IO, 0x808080);
+ msleep(100);
+ break;
+ case CX88_BOARD_BST_PS8312:
+ cx_write(MO_GP1_IO, 0x808000);
+ msleep(100);
+ cx_write(MO_GP1_IO, 0x808080);
+ msleep(100);
+ break;
} /*end switch() */

@@ -4064,56 +4064,56 @@ diff -uprN linux-3.2.10.orig/drivers/media/video/cx88/cx88-dvb.c linux-3.2.10/dr
return core->prev_set_voltage(fe, voltage);
return 0;
}
+/*CX88_BOARD_BST_PS8312*/
+static int bst_dvbs_set_voltage(struct dvb_frontend *fe,
+ fe_sec_voltage_t voltage)
+{
+ struct cx8802_dev *dev= fe->dvb->priv;
+ struct cx88_core *core = dev->core;
+
+ cx_write(MO_GP1_IO, 0x111111);
+ switch (voltage) {
+ case SEC_VOLTAGE_13:
+ cx_write(MO_GP1_IO, 0x020200);
+ break;
+ case SEC_VOLTAGE_18:
+ cx_write(MO_GP1_IO, 0x020202);
+ break;
+ case SEC_VOLTAGE_OFF:
+ cx_write(MO_GP1_IO, 0x111100);
+ break;
+ }
+
+ if (core->prev_set_voltage)
+ return core->prev_set_voltage(fe, voltage);
+ return 0;
+}
+
+static int bst_dvbs_set_voltage_v2(struct dvb_frontend *fe,
+ fe_sec_voltage_t voltage)
+{
+ struct cx8802_dev *dev= fe->dvb->priv;
+ struct cx88_core *core = dev->core;
+
+ cx_write(MO_GP1_IO, 0x111101);
+ switch (voltage) {
+ case SEC_VOLTAGE_13:
+ cx_write(MO_GP1_IO, 0x020200);
+ break;
+ case SEC_VOLTAGE_18:
+
+ cx_write(MO_GP1_IO, 0x020202);
+ break;
+ case SEC_VOLTAGE_OFF:
+
+ cx_write(MO_GP1_IO, 0x111110);
+ break;
+ }
+
+ if (core->prev_set_voltage)
+ return core->prev_set_voltage(fe, voltage);
+ return 0;
+}
+/*CX88_BOARD_BST_PS8312*/
+static int bst_dvbs_set_voltage(struct dvb_frontend *fe,
+ fe_sec_voltage_t voltage)
+{
+ struct cx8802_dev *dev= fe->dvb->priv;
+ struct cx88_core *core = dev->core;
+
+ cx_write(MO_GP1_IO, 0x111111);
+ switch (voltage) {
+ case SEC_VOLTAGE_13:
+ cx_write(MO_GP1_IO, 0x020200);
+ break;
+ case SEC_VOLTAGE_18:
+ cx_write(MO_GP1_IO, 0x020202);
+ break;
+ case SEC_VOLTAGE_OFF:
+ cx_write(MO_GP1_IO, 0x111100);
+ break;
+ }
+
+ if (core->prev_set_voltage)
+ return core->prev_set_voltage(fe, voltage);
+ return 0;
+}
+
+static int bst_dvbs_set_voltage_v2(struct dvb_frontend *fe,
+ fe_sec_voltage_t voltage)
+{
+ struct cx8802_dev *dev= fe->dvb->priv;
+ struct cx88_core *core = dev->core;
+
+ cx_write(MO_GP1_IO, 0x111101);
+ switch (voltage) {
+ case SEC_VOLTAGE_13:
+ cx_write(MO_GP1_IO, 0x020200);
+ break;
+ case SEC_VOLTAGE_18:
+
+ cx_write(MO_GP1_IO, 0x020202);
+ break;
+ case SEC_VOLTAGE_OFF:
+
+ cx_write(MO_GP1_IO, 0x111110);
+ break;
+ }
+
+ if (core->prev_set_voltage)
+ return core->prev_set_voltage(fe, voltage);
+ return 0;
+}

static int vp1027_set_voltage(struct dvb_frontend *fe,
fe_sec_voltage_t voltage)
@@ -4133,36 +4133,36 @@ diff -uprN linux-3.2.10.orig/drivers/media/video/cx88/cx88-dvb.c linux-3.2.10/dr
if (fe0->dvb.frontend != NULL)
fe0->dvb.frontend->ops.set_voltage =
tevii_dvbs_set_voltage;
+ break;
+ case CX88_BOARD_BST_PS8312:
+ fe0->dvb.frontend = dvb_attach(m88ds3103_attach,
+ &dvbsky_ds3103_config,
+ &core->i2c_adap);
+ if (fe0->dvb.frontend != NULL)
+ {
+ int ret;
+ u8 b0[] = { 0x60 };
+ u8 b1[2] = { 0 };
+ struct i2c_msg msg[] = {
+ {
+ .addr = 0x50,
+ .flags = 0,
+ .buf = b0,
+ .len = 1
+ }, {
+ .addr = 0x50,
+ .flags = I2C_M_RD,
+ .buf = b1,
+ .len = 2
+ }
+ };
+ ret = i2c_transfer(&core->i2c_adap, msg, 2);
+ printk("PS8312: config = %02x, %02x", b1[0],b1[1]);
+ if(b1[0] == 0xaa)
+ fe0->dvb.frontend->ops.set_voltage = bst_dvbs_set_voltage_v2;
+ else
+ fe0->dvb.frontend->ops.set_voltage = bst_dvbs_set_voltage;
+ }
+ break;
+ case CX88_BOARD_BST_PS8312:
+ fe0->dvb.frontend = dvb_attach(m88ds3103_attach,
+ &dvbsky_ds3103_config,
+ &core->i2c_adap);
+ if (fe0->dvb.frontend != NULL)
+ {
+ int ret;
+ u8 b0[] = { 0x60 };
+ u8 b1[2] = { 0 };
+ struct i2c_msg msg[] = {
+ {
+ .addr = 0x50,
+ .flags = 0,
+ .buf = b0,
+ .len = 1
+ }, {
+ .addr = 0x50,
+ .flags = I2C_M_RD,
+ .buf = b1,
+ .len = 2
+ }
+ };
+ ret = i2c_transfer(&core->i2c_adap, msg, 2);
+ printk("PS8312: config = %02x, %02x", b1[0],b1[1]);
+ if(b1[0] == 0xaa)
+ fe0->dvb.frontend->ops.set_voltage = bst_dvbs_set_voltage_v2;
+ else
+ fe0->dvb.frontend->ops.set_voltage = bst_dvbs_set_voltage;
+ }
break;
case CX88_BOARD_OMICOM_SS4_PCI:
case CX88_BOARD_TBS_8920:
@@ -4184,9 +4184,9 @@ diff -uprN linux-3.2.10.orig/drivers/media/video/cx88/cx88-input.c linux-3.2.10/
rc_type = RC_TYPE_NEC;
ir->sampling = 0xff00; /* address */
break;
+ case CX88_BOARD_BST_PS8312:
+ case CX88_BOARD_BST_PS8312:
+ ir_codes = RC_MAP_DVBSKY;
+ ir->sampling = 0xff00; /* address */
+ ir->sampling = 0xff00; /* address */
+ break;
}