From 622df4dae93e7e20554e124c68bc40b48d696fb8 Mon Sep 17 00:00:00 2001 From: Devin Heitmueller Date: Mon, 29 Jun 2009 21:11:02 -0300 Subject: [PATCH] --- yaml --- r: 261219 b: refs/heads/master c: 59d0c37baadaba10a3966ad28bbf1663d850adf1 h: refs/heads/master i: 261217: 35246c00583d791a16d8fb4b1f3d8ff4a2f767a8 261215: 2017c600fbca790b35e65da4e5e349d0dcf568a0 v: v3 --- [refs] | 2 +- .../media/dvb/dvb-usb/dib0700_devices.c | 23 ++++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 619e22a71f59..289b9a4c5e26 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 01f16263ad8c53f368575db50ab72a287d7daa75 +refs/heads/master: 59d0c37baadaba10a3966ad28bbf1663d850adf1 diff --git a/trunk/drivers/media/dvb/dvb-usb/dib0700_devices.c b/trunk/drivers/media/dvb/dvb-usb/dib0700_devices.c index 5e3290739f12..e9311041a556 100644 --- a/trunk/drivers/media/dvb/dvb-usb/dib0700_devices.c +++ b/trunk/drivers/media/dvb/dvb-usb/dib0700_devices.c @@ -2663,10 +2663,9 @@ static int dib0700_xc4000_tuner_callback(void *priv, int component, if (command == XC4000_TUNER_RESET) { /* Reset the tuner */ - dib0700_set_gpio(adap->dev, GPIO1, GPIO_OUT, 0); - msleep(10); - dib0700_set_gpio(adap->dev, GPIO1, GPIO_OUT, 1); + dib7000p_set_gpio(adap->fe, 8, 0, 0); msleep(10); + dib7000p_set_gpio(adap->fe, 8, 0, 1); } else { err("xc4000: unknown tuner callback command: %d\n", command); return -EINVAL; @@ -2683,7 +2682,6 @@ static struct dib7000p_config pctv_340e_config = { .agc = &stk7700p_7000p_mt2060_agc_config, .bw = &stk7700p_pll_config, - /* FIXME: need to take xc4000 out of reset */ .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS, .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES, .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS, @@ -2738,17 +2736,26 @@ static int pctv340e_frontend_attach(struct dvb_usb_adapter *adap) static struct xc4000_config s5h1411_xc4000_tunerconfig = { - .i2c_address = 0x64, + .i2c_address = 0x61, .if_khz = 5380, }; static int xc4000_tuner_attach(struct dvb_usb_adapter *adap) { - err("xc4000: xc4000_tuner_attach"); - /* FIXME: generalize & move to common area */ + struct i2c_adapter *tun_i2c; + + /* The xc4000 is not on the main i2c bus */ + tun_i2c = dib7000p_get_i2c_master(adap->fe, + DIBX000_I2C_INTERFACE_TUNER, 1); + if (tun_i2c == NULL) { + printk("Could not reach tuner i2c bus\n"); + return 0; + } + + /* Setup the reset callback */ adap->fe->callback = dib0700_xc4000_tuner_callback; - return dvb_attach(xc4000_attach, adap->fe, &adap->dev->i2c_adap, + return dvb_attach(xc4000_attach, adap->fe, tun_i2c, &s5h1411_xc4000_tunerconfig) == NULL ? -ENODEV : 0; }