aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/dib0700_devices.c
diff options
context:
space:
mode:
authorDevin Heitmueller <dheitmueller@kernellabs.com>2009-06-23 23:07:01 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:52:26 -0400
commit01f16263ad8c53f368575db50ab72a287d7daa75 (patch)
treedb9727841c0e82f1ccb14a9b430959adf4f13563 /drivers/media/dvb/dvb-usb/dib0700_devices.c
parent33fb1681c61456898b986405a13222a913f10a4a (diff)
[media] dib0700: properly setup GPIOs for PCTV 340e
Provide a frontend setup routine for the PCTV 340e which takes into account the specific GPIO setup of the board. Note that this patch does *not* take into account the xc4000 reset pin, which is attached to the dib7000. 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.c64
1 files changed, 63 insertions, 1 deletions
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c
index 66c6de98c97b..5e3290739f12 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
@@ -2675,6 +2675,68 @@ static int dib0700_xc4000_tuner_callback(void *priv, int component,
2675 return 0; 2675 return 0;
2676} 2676}
2677 2677
2678/* FIXME: none of these inputs are validated yet */
2679static struct dib7000p_config pctv_340e_config = {
2680 .output_mpeg2_in_188_bytes = 1,
2681
2682 .agc_config_count = 1,
2683 .agc = &stk7700p_7000p_mt2060_agc_config,
2684 .bw = &stk7700p_pll_config,
2685
2686 /* FIXME: need to take xc4000 out of reset */
2687 .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS,
2688 .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES,
2689 .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS,
2690};
2691
2692/* PCTV 340e GPIOs map:
2693 dib0700:
2694 GPIO2 - CX25843 sleep
2695 GPIO3 - CS5340 reset
2696 GPIO5 - IRD
2697 GPIO6 - Power Supply
2698 GPIO8 - LNA (1=off 0=on)
2699 GPIO10 - CX25843 reset
2700 dib7000:
2701 GPIO8 - xc4000 reset
2702 */
2703static int pctv340e_frontend_attach(struct dvb_usb_adapter *adap)
2704{
2705 struct dib0700_state *st = adap->dev->priv;
2706
2707 /* Power Supply on */
2708 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0);
2709 msleep(50);
2710 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
2711 msleep(100); /* Allow power supply to settle before probing */
2712
2713 /* cx25843 reset */
2714 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
2715 msleep(1); /* cx25843 datasheet say 350us required */
2716 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
2717
2718 /* LNA off for now */
2719 dib0700_set_gpio(adap->dev, GPIO8, GPIO_OUT, 1);
2720
2721 /* Put the CX25843 to sleep for now since we're in digital mode */
2722 dib0700_set_gpio(adap->dev, GPIO2, GPIO_OUT, 1);
2723
2724 /* FIXME: not verified yet */
2725 dib0700_ctrl_clock(adap->dev, 72, 1);
2726
2727 if (dib7000pc_detection(&adap->dev->i2c_adap) == 0) {
2728 /* Demodulator not found for some reason? */
2729 return -ENODEV;
2730 }
2731
2732 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x12,
2733 &pctv_340e_config);
2734 st->is_dib7000pc = 1;
2735
2736 return adap->fe == NULL ? -ENODEV : 0;
2737}
2738
2739
2678static struct xc4000_config s5h1411_xc4000_tunerconfig = { 2740static struct xc4000_config s5h1411_xc4000_tunerconfig = {
2679 .i2c_address = 0x64, 2741 .i2c_address = 0x64,
2680 .if_khz = 5380, 2742 .if_khz = 5380,
@@ -3814,7 +3876,7 @@ struct dvb_usb_device_properties dib0700_devices[] = {
3814 .num_adapters = 1, 3876 .num_adapters = 1,
3815 .adapter = { 3877 .adapter = {
3816 { 3878 {
3817 .frontend_attach = stk7700ph_frontend_attach, 3879 .frontend_attach = pctv340e_frontend_attach,
3818 .tuner_attach = xc4000_tuner_attach, 3880 .tuner_attach = xc4000_tuner_attach,
3819 3881
3820 DIB0700_DEFAULT_STREAMING_CONFIG(0x02), 3882 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),