aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/dib0700_devices.c
diff options
context:
space:
mode:
authorDevin Heitmueller <dheitmueller@kernellabs.com>2009-06-29 20:11:02 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:52:26 -0400
commit59d0c37baadaba10a3966ad28bbf1663d850adf1 (patch)
tree6d47ae6b69329463d6c9f59ec5432fb07b76d053 /drivers/media/dvb/dvb-usb/dib0700_devices.c
parent01f16263ad8c53f368575db50ab72a287d7daa75 (diff)
[media] dib0700: successfully connect to xc4000 over i2c for PCTV 340e
Use the correct i2c bus to communicate with the tuner, and properly setup the reset GPIO and i2c address. Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Cc: Patrick Boettcher <pboettcher@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dib0700_devices.c')
-rw-r--r--drivers/media/dvb/dvb-usb/dib0700_devices.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c
index 5e3290739f1..e9311041a55 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
@@ -2663,10 +2663,9 @@ static int dib0700_xc4000_tuner_callback(void *priv, int component,
2663 2663
2664 if (command == XC4000_TUNER_RESET) { 2664 if (command == XC4000_TUNER_RESET) {
2665 /* Reset the tuner */ 2665 /* Reset the tuner */
2666 dib0700_set_gpio(adap->dev, GPIO1, GPIO_OUT, 0); 2666 dib7000p_set_gpio(adap->fe, 8, 0, 0);
2667 msleep(10);
2668 dib0700_set_gpio(adap->dev, GPIO1, GPIO_OUT, 1);
2669 msleep(10); 2667 msleep(10);
2668 dib7000p_set_gpio(adap->fe, 8, 0, 1);
2670 } else { 2669 } else {
2671 err("xc4000: unknown tuner callback command: %d\n", command); 2670 err("xc4000: unknown tuner callback command: %d\n", command);
2672 return -EINVAL; 2671 return -EINVAL;
@@ -2683,7 +2682,6 @@ static struct dib7000p_config pctv_340e_config = {
2683 .agc = &stk7700p_7000p_mt2060_agc_config, 2682 .agc = &stk7700p_7000p_mt2060_agc_config,
2684 .bw = &stk7700p_pll_config, 2683 .bw = &stk7700p_pll_config,
2685 2684
2686 /* FIXME: need to take xc4000 out of reset */
2687 .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS, 2685 .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS,
2688 .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES, 2686 .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES,
2689 .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS, 2687 .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS,
@@ -2738,17 +2736,26 @@ static int pctv340e_frontend_attach(struct dvb_usb_adapter *adap)
2738 2736
2739 2737
2740static struct xc4000_config s5h1411_xc4000_tunerconfig = { 2738static struct xc4000_config s5h1411_xc4000_tunerconfig = {
2741 .i2c_address = 0x64, 2739 .i2c_address = 0x61,
2742 .if_khz = 5380, 2740 .if_khz = 5380,
2743}; 2741};
2744 2742
2745static int xc4000_tuner_attach(struct dvb_usb_adapter *adap) 2743static int xc4000_tuner_attach(struct dvb_usb_adapter *adap)
2746{ 2744{
2747 err("xc4000: xc4000_tuner_attach"); 2745 struct i2c_adapter *tun_i2c;
2748 /* FIXME: generalize & move to common area */ 2746
2747 /* The xc4000 is not on the main i2c bus */
2748 tun_i2c = dib7000p_get_i2c_master(adap->fe,
2749 DIBX000_I2C_INTERFACE_TUNER, 1);
2750 if (tun_i2c == NULL) {
2751 printk("Could not reach tuner i2c bus\n");
2752 return 0;
2753 }
2754
2755 /* Setup the reset callback */
2749 adap->fe->callback = dib0700_xc4000_tuner_callback; 2756 adap->fe->callback = dib0700_xc4000_tuner_callback;
2750 2757
2751 return dvb_attach(xc4000_attach, adap->fe, &adap->dev->i2c_adap, 2758 return dvb_attach(xc4000_attach, adap->fe, tun_i2c,
2752 &s5h1411_xc4000_tunerconfig) 2759 &s5h1411_xc4000_tunerconfig)
2753 == NULL ? -ENODEV : 0; 2760 == NULL ? -ENODEV : 0;
2754} 2761}