diff options
author | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2005-06-23 22:04:58 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-24 00:06:38 -0700 |
commit | 2d03e289ea4b13d78ce55f1ea0b0d45b8f1b34c3 (patch) | |
tree | ca3aa14521fa75fd435e1d37ba0b06322a39244b /drivers/media/video/bttv-cards.c | |
parent | 3c1d0185db6a44b6304c404f4da1a1a98746ca46 (diff) | |
download | linux-2d03e289ea4b13d78ce55f1ea0b0d45b8f1b34c3.tar.bz2 |
[PATCH] bttv update
This patch synchronizes current bttv support on V4L with linux kernel and
adds support to Adlink RTV24 card.
It is asked that *every* patch to V4L stuff to be first submitted to
video4linux-list@redhat.com.
From: "J.A. Magallon" <jamagallon@able.es>
struct bttv defined after usage.
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Peter Skipworth <pskipworth@clarityvi.com>
Signed-off-by: Nickolay V Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video/bttv-cards.c')
-rw-r--r-- | drivers/media/video/bttv-cards.c | 99 |
1 files changed, 55 insertions, 44 deletions
diff --git a/drivers/media/video/bttv-cards.c b/drivers/media/video/bttv-cards.c index ca7c993fecb7..251092e7f19f 100644 --- a/drivers/media/video/bttv-cards.c +++ b/drivers/media/video/bttv-cards.c @@ -1,5 +1,5 @@ /* - $Id: bttv-cards.c,v 1.47 2005/02/22 14:06:32 kraxel Exp $ + $Id: bttv-cards.c,v 1.49 2005/06/10 17:20:24 mchehab Exp $ bttv-cards.c @@ -2254,17 +2254,18 @@ struct tvcard bttv_tvcards[] = { .muxsel_hook = kodicom4400r_muxsel, }, { - /* ---- card 0x86---------------------------------- */ - /* Michael Henson <mhenson@clarityvi.com> */ - /* Adlink RTV24 with special unlock codes */ - .name = "Adlink RTV24", - .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, - .svhs = 2, - .muxsel = { 2, 3, 1, 0}, - .tuner_type = -1, - .pll = PLL_28, + /* ---- card 0x85---------------------------------- */ + /* Michael Henson <mhenson@clarityvi.com> */ + /* Adlink RTV24 with special unlock codes */ + .name = "Adlink RTV24", + .video_inputs = 4, + .audio_inputs = 1, + .tuner = 0, + .svhs = 2, + .muxsel = { 2, 3, 1, 0}, + .tuner_type = -1, + .pll = PLL_28, + }}; static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards); @@ -2650,6 +2651,10 @@ void __devinit bttv_init_card1(struct bttv *btv) case BTTV_AVDVBT_771: btv->use_i2c_hw = 1; break; + case BTTV_ADLINK_RTV24: + init_RTV24( btv ); + break; + } if (!bttv_tvcards[btv->c.type].has_dvb) bttv_reset_audio(btv); @@ -2762,9 +2767,6 @@ void __devinit bttv_init_card2(struct bttv *btv) case BTTV_KODICOM_4400R: kodicom4400r_init(btv); break; - case BTTV_ADLINK_RTV24: - init_RTV24(btv); - break; } /* pll configuration */ @@ -2801,6 +2803,8 @@ void __devinit bttv_init_card2(struct bttv *btv) } btv->pll.pll_current = -1; + bttv_reset_audio(btv); + /* tuner configuration (from card list / autodetect / insmod option) */ if (UNSET != bttv_tvcards[btv->c.type].tuner_type) if(UNSET == btv->tuner_type) @@ -3320,6 +3324,8 @@ static void __devinit init_PXC200(struct bttv *btv) printk(KERN_INFO "PXC200 Initialised.\n"); } + + /* ----------------------------------------------------------------------- */ /* * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock @@ -3348,49 +3354,54 @@ static void __devinit init_PXC200(struct bttv *btv) * error. ERROR_CPLD_Check_Failed. */ /* ----------------------------------------------------------------------- */ -void init_RTV24(struct bttv *btv) +void +init_RTV24 (struct bttv *btv) { - u32 dataread; - const long watchdog_value = 0x0E; + uint32_t dataRead = 0; + long watchdog_value = 0x0E; - printk(KERN_INFO "bttv%d: Adlink RTV-24 initialisation in progress\n", + printk (KERN_INFO + "bttv%d: Adlink RTV-24 initialisation in progress ...\n", btv->c.nr); - btwrite(0x00c3feff, BT848_GPIO_OUT_EN); + btwrite (0x00c3feff, BT848_GPIO_OUT_EN); - btwrite(0 + watchdog_value, BT848_GPIO_DATA); - msleep(1); - btwrite(0x10 + watchdog_value, BT848_GPIO_DATA); - msleep( 10 ); - btwrite(0 + watchdog_value, BT848_GPIO_DATA); + btwrite (0 + watchdog_value, BT848_GPIO_DATA); + msleep (1); + btwrite (0x10 + watchdog_value, BT848_GPIO_DATA); + msleep (10); + btwrite (0 + watchdog_value, BT848_GPIO_DATA); - dataread = btread(BT848_GPIO_DATA); + dataRead = btread (BT848_GPIO_DATA); - if (((dataread >> 18) & 0x01) != 0 || ((dataread >> 19) & 0x01) != 1) { - printk(KERN_INFO "bttv%d: Adlink RTV-24 initialisation(1) " - "ERROR_CPLD_Check_Failed (read %d)\n", - btv->c.nr, dataread); + if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) { + printk (KERN_INFO + "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n", + btv->c.nr, dataRead); } - btwrite(0x4400 + watchdog_value, BT848_GPIO_DATA); - msleep(10); - btwrite(0x4410 + watchdog_value, BT848_GPIO_DATA); - msleep(1); - btwrite(watchdog_value, BT848_GPIO_DATA); - msleep(1); - dataread = btread(BT848_GPIO_DATA); - - if (((dataread >> 18) & 0x01) != 0 || ((dataread >> 19) & 0x01) != 0) { - printk(KERN_INFO "bttv%d: Adlink RTV-24 initialisation(2) " - "ERROR_CPLD_Check_Failed (read %d)\n", - btv->c.nr, dataread); + btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA); + msleep (10); + btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA); + msleep (1); + btwrite (watchdog_value, BT848_GPIO_DATA); + msleep (1); + dataRead = btread (BT848_GPIO_DATA); + + if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) { + printk (KERN_INFO + "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n", + btv->c.nr, dataRead); + return; } - printk(KERN_INFO "bttv%d: Adlink RTV-24 initialisation complete.\n", - btv->c.nr); + printk (KERN_INFO + "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr); } + + /* ----------------------------------------------------------------------- */ /* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */ /* |