Commit 2d03e289 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Linus Torvalds
Browse files

[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: default avatarMauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: default avatarPeter Skipworth <pskipworth@clarityvi.com>
Signed-off-by: default avatarNickolay V Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3c1d0185
Loading
Loading
Loading
Loading
+55 −44
Original line number Original line Diff line number Diff line
/*
/*
    $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
    bttv-cards.c


@@ -2254,7 +2254,7 @@ struct tvcard bttv_tvcards[] = {
	.muxsel_hook	= kodicom4400r_muxsel,
	.muxsel_hook	= kodicom4400r_muxsel,
},
},
{
{
	/* ---- card 0x86---------------------------------- */
        /* ---- card 0x85---------------------------------- */
        /* Michael Henson <mhenson@clarityvi.com> */
        /* Michael Henson <mhenson@clarityvi.com> */
        /* Adlink RTV24 with special unlock codes */
        /* Adlink RTV24 with special unlock codes */
        .name           = "Adlink RTV24",
        .name           = "Adlink RTV24",
@@ -2265,6 +2265,7 @@ struct tvcard bttv_tvcards[] = {
        .muxsel         = { 2, 3, 1, 0},
        .muxsel         = { 2, 3, 1, 0},
        .tuner_type     = -1,
        .tuner_type     = -1,
        .pll            = PLL_28,
        .pll            = PLL_28,

}};
}};


static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
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:
	case BTTV_AVDVBT_771:
		btv->use_i2c_hw = 1;
		btv->use_i2c_hw = 1;
		break;
		break;
        case BTTV_ADLINK_RTV24:
                init_RTV24( btv );
                break;

	}
	}
	if (!bttv_tvcards[btv->c.type].has_dvb)
	if (!bttv_tvcards[btv->c.type].has_dvb)
		bttv_reset_audio(btv);
		bttv_reset_audio(btv);
@@ -2762,9 +2767,6 @@ void __devinit bttv_init_card2(struct bttv *btv)
	case BTTV_KODICOM_4400R:
	case BTTV_KODICOM_4400R:
		kodicom4400r_init(btv);
		kodicom4400r_init(btv);
		break;
		break;
        case BTTV_ADLINK_RTV24:
                init_RTV24(btv);
                break;
	}
	}


	/* pll configuration */
	/* pll configuration */
@@ -2801,6 +2803,8 @@ void __devinit bttv_init_card2(struct bttv *btv)
        }
        }
	btv->pll.pll_current = -1;
	btv->pll.pll_current = -1;


	bttv_reset_audio(btv);

	/* tuner configuration (from card list / autodetect / insmod option) */
	/* tuner configuration (from card list / autodetect / insmod option) */
 	if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
 	if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
		if(UNSET == btv->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");
	printk(KERN_INFO "PXC200 Initialised.\n");
}
}




/* ----------------------------------------------------------------------- */
/* ----------------------------------------------------------------------- */
/*
/*
 *  The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
 *  The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
@@ -3348,12 +3354,14 @@ static void __devinit init_PXC200(struct bttv *btv)
 *                error. ERROR_CPLD_Check_Failed.
 *                error. ERROR_CPLD_Check_Failed.
 */
 */
/* ----------------------------------------------------------------------- */
/* ----------------------------------------------------------------------- */
void init_RTV24(struct bttv *btv)
void
init_RTV24 (struct bttv *btv)
{
{
	u32 dataread;
	uint32_t dataRead = 0;
	const long watchdog_value = 0x0E;
	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);
		btv->c.nr);


	btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
	btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
@@ -3364,12 +3372,12 @@ void init_RTV24(struct bttv *btv)
	msleep (10);
	msleep (10);
	btwrite (0 + watchdog_value, BT848_GPIO_DATA);
	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) {
	if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
		printk(KERN_INFO "bttv%d: Adlink RTV-24 initialisation(1) "
		printk (KERN_INFO
				"ERROR_CPLD_Check_Failed (read %d)\n",
			"bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
				btv->c.nr, dataread);
			btv->c.nr, dataRead);
	}
	}


	btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
	btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
@@ -3378,19 +3386,22 @@ void init_RTV24(struct bttv *btv)
	msleep (1);
	msleep (1);
	btwrite (watchdog_value, BT848_GPIO_DATA);
	btwrite (watchdog_value, BT848_GPIO_DATA);
	msleep (1);
	msleep (1);
	dataread = btread(BT848_GPIO_DATA);
	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);


	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;
		return;
	}
	}


	printk(KERN_INFO "bttv%d: Adlink RTV-24 initialisation complete.\n",
	printk (KERN_INFO
			btv->c.nr);
		"bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
}
}




/* ----------------------------------------------------------------------- */
/* ----------------------------------------------------------------------- */
/* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports     */
/* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports     */
/*
/*
+1 −1
Original line number Original line Diff line number Diff line
/*
/*
    $Id: bttv-driver.c,v 1.37 2005/02/21 13:57:59 kraxel Exp $
    $Id: bttv-driver.c,v 1.38 2005/06/10 17:20:24 mchehab Exp $


    bttv - Bt848 frame grabber driver
    bttv - Bt848 frame grabber driver


+1 −1
Original line number Original line Diff line number Diff line
/*
/*
    $Id: bttv-i2c.c,v 1.18 2005/02/16 12:14:10 kraxel Exp $
    $Id: bttv-i2c.c,v 1.21 2005/06/10 17:20:24 mchehab Exp $


    bttv-i2c.c  --  all the i2c code is here
    bttv-i2c.c  --  all the i2c code is here


+2 −2
Original line number Original line Diff line number Diff line
/*
/*
 * $Id: bttv.h,v 1.17 2005/02/22 14:06:32 kraxel Exp $
 * $Id: bttv.h,v 1.18 2005/05/24 23:41:42 nsh Exp $
 *
 *
 *  bttv - Bt848 frame grabber driver
 *  bttv - Bt848 frame grabber driver
 *
 *
@@ -135,7 +135,7 @@
#define BTTV_DVICO_DVBT_LITE  0x80
#define BTTV_DVICO_DVBT_LITE  0x80
#define BTTV_TIBET_CS16  0x83
#define BTTV_TIBET_CS16  0x83
#define BTTV_KODICOM_4400R  0x84
#define BTTV_KODICOM_4400R  0x84
#define BTTV_ADLINK_RTV24   0x86
#define BTTV_ADLINK_RTV24   0x85


/* i2c address list */
/* i2c address list */
#define I2C_TSA5522        0xc2
#define I2C_TSA5522        0xc2
+4 −4
Original line number Original line Diff line number Diff line
@@ -226,10 +226,6 @@ extern int fini_bttv_i2c(struct bttv *btv);
#define dprintk  if (bttv_debug >= 1) printk
#define dprintk  if (bttv_debug >= 1) printk
#define d2printk if (bttv_debug >= 2) printk
#define d2printk if (bttv_debug >= 2) printk


/* our devices */
#define BTTV_MAX 16
extern unsigned int bttv_num;

#define BTTV_MAX_FBUF   0x208000
#define BTTV_MAX_FBUF   0x208000
#define VBIBUF_SIZE     (2048*VBI_MAXLINES*2)
#define VBIBUF_SIZE     (2048*VBI_MAXLINES*2)
#define BTTV_TIMEOUT    (HZ/2) /* 0.5 seconds */
#define BTTV_TIMEOUT    (HZ/2) /* 0.5 seconds */
@@ -375,6 +371,10 @@ struct bttv {
	unsigned int users;
	unsigned int users;
	struct bttv_fh init;
	struct bttv_fh init;
};
};

/* our devices */
#define BTTV_MAX 16
extern unsigned int bttv_num;
extern struct bttv bttvs[BTTV_MAX];
extern struct bttv bttvs[BTTV_MAX];


/* private ioctls */
/* private ioctls */