aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb
diff options
context:
space:
mode:
authorOlivier Grenie <olivier.grenie@dibcom.fr>2010-09-07 11:50:45 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-09-27 21:21:57 -0400
commit90e12cec707204930934acdb5efce5f94a163a5f (patch)
tree94e0b455d55d65cb0d90f5822f48a128bbda6c85 /drivers/media/dvb/dvb-usb
parent00a220aa98133dc43c6f7016c218aaf3afd66e11 (diff)
V4L/DVB: dib7770: enable the current mirror
To improve performance on DiB7770-devices enabling the current mirror is needed. This patch adds an option to the dib7000p-driver to do that and it creates a separate device-entry in dib0700-device to use those changes on hardware which is using the DiB7770. Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr> Signed-off-by: Patrick Boettcher <patrick.boettcher@dibcom.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb')
-rw-r--r--drivers/media/dvb/dvb-usb/dib0700_devices.c53
1 files changed, 52 insertions, 1 deletions
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c
index ce66c5a96ba8..385ce1c0a934 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
@@ -940,6 +940,57 @@ static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap)
940 return adap->fe == NULL ? -ENODEV : 0; 940 return adap->fe == NULL ? -ENODEV : 0;
941} 941}
942 942
943/* STK7770P */
944static struct dib7000p_config dib7770p_dib7000p_config = {
945 .output_mpeg2_in_188_bytes = 1,
946
947 .agc_config_count = 1,
948 .agc = &dib7070_agc_config,
949 .bw = &dib7070_bw_config_12_mhz,
950 .tuner_is_baseband = 1,
951 .spur_protect = 1,
952
953 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
954 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
955 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
956
957 .hostbus_diversity = 1,
958 .enable_current_mirror = 1,
959};
960
961static int stk7770p_frontend_attach(struct dvb_usb_adapter *adap)
962{
963 struct usb_device_descriptor *p = &adap->dev->udev->descriptor;
964 if (p->idVendor == cpu_to_le16(USB_VID_PINNACLE) &&
965 p->idProduct == cpu_to_le16(USB_PID_PINNACLE_PCTV72E))
966 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0);
967 else
968 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
969 msleep(10);
970 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
971 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
972 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
973 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
974
975 dib0700_ctrl_clock(adap->dev, 72, 1);
976
977 msleep(10);
978 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
979 msleep(10);
980 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
981
982 if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18,
983 &dib7770p_dib7000p_config) != 0) {
984 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n",
985 __func__);
986 return -ENODEV;
987 }
988
989 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80,
990 &dib7770p_dib7000p_config);
991 return adap->fe == NULL ? -ENODEV : 0;
992}
993
943/* DIB807x generic */ 994/* DIB807x generic */
944static struct dibx000_agc_config dib807x_agc_config[2] = { 995static struct dibx000_agc_config dib807x_agc_config[2] = {
945 { 996 {
@@ -2406,7 +2457,7 @@ struct dvb_usb_device_properties dib0700_devices[] = {
2406 .pid_filter_count = 32, 2457 .pid_filter_count = 32,
2407 .pid_filter = stk70x0p_pid_filter, 2458 .pid_filter = stk70x0p_pid_filter,
2408 .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, 2459 .pid_filter_ctrl = stk70x0p_pid_filter_ctrl,
2409 .frontend_attach = stk7070p_frontend_attach, 2460 .frontend_attach = stk7770p_frontend_attach,
2410 .tuner_attach = dib7770p_tuner_attach, 2461 .tuner_attach = dib7770p_tuner_attach,
2411 2462
2412 DIB0700_DEFAULT_STREAMING_CONFIG(0x02), 2463 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),