aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
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
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')
-rw-r--r--drivers/media/dvb/dvb-usb/dib0700_devices.c53
-rw-r--r--drivers/media/dvb/frontends/dib7000p.c2
-rw-r--r--drivers/media/dvb/frontends/dib7000p.h3
3 files changed, 57 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),
diff --git a/drivers/media/dvb/frontends/dib7000p.c b/drivers/media/dvb/frontends/dib7000p.c
index 2e28b973dfd3..73f59ab06c86 100644
--- a/drivers/media/dvb/frontends/dib7000p.c
+++ b/drivers/media/dvb/frontends/dib7000p.c
@@ -260,6 +260,8 @@ static void dib7000p_set_adc_state(struct dib7000p_state *state, enum dibx000_ad
260 260
261// dprintk( "908: %x, 909: %x\n", reg_908, reg_909); 261// dprintk( "908: %x, 909: %x\n", reg_908, reg_909);
262 262
263 reg_908 |= (state->cfg.enable_current_mirror & 1) << 7;
264
263 dib7000p_write_word(state, 908, reg_908); 265 dib7000p_write_word(state, 908, reg_908);
264 dib7000p_write_word(state, 909, reg_909); 266 dib7000p_write_word(state, 909, reg_909);
265} 267}
diff --git a/drivers/media/dvb/frontends/dib7000p.h b/drivers/media/dvb/frontends/dib7000p.h
index 805dd13a97ee..04a744938cca 100644
--- a/drivers/media/dvb/frontends/dib7000p.h
+++ b/drivers/media/dvb/frontends/dib7000p.h
@@ -33,6 +33,9 @@ struct dib7000p_config {
33 int (*agc_control) (struct dvb_frontend *, u8 before); 33 int (*agc_control) (struct dvb_frontend *, u8 before);
34 34
35 u8 output_mode; 35 u8 output_mode;
36
37 u8 enable_current_mirror : 1;
38
36}; 39};
37 40
38#define DEFAULT_DIB7000P_I2C_ADDRESS 18 41#define DEFAULT_DIB7000P_I2C_ADDRESS 18