[linux-dvb] budget_av 'plus' cards saa7113 capture broken by CI code or incomplete

thomas schorpp thomas.schorpp at googlemail.com
Sun Dec 2 21:49:38 CET 2007


http://linuxtv.org/hg/v4l-dvb/rev/698119141230 and other CI-stuff seems to break saa7113 capture 
with xawtv (says driver refuses to capture) on at least KNC1 dvb-c plus, can anyone confirm this?

1. weird reset/Vcc control code:

/* GPIO Connections:
 * 0 - Vcc/(#)Reset(?) (Reset is controlled by capacitor). Resets the frontend (and the saa7113?) *AS WELL*!

static int ciintf_slot_reset(struct dvb_ca_en50221 *ca, int slot)
{
	struct budget_av *budget_av = (struct budget_av *) ca->data;
	struct saa7146_dev *saa = budget_av->budget.dev;

	if (slot != 0)
		return -EINVAL;

	dprintk(1, "ciintf_slot_reset\n");
	budget_av->slot_status = SLOTSTATUS_RESET;

	saa7146_setgpio(saa, 2, SAA7146_GPIO_OUTHI); /* disable card */

	saa7146_setgpio(saa, 0, SAA7146_GPIO_OUTHI); /* Vcc off */
	msleep(2);
	saa7146_setgpio(saa, 0, SAA7146_GPIO_OUTLO); /* Vcc on */
	msleep(20); /* 20 ms Vcc settling time */

	saa7146_setgpio(saa, 2, SAA7146_GPIO_OUTLO); /* enable card */
	ttpci_budget_set_video_port(saa, BUDGET_VIDEO_PORTB);
	msleep(20);


static int ciintf_slot_ts_enable(struct dvb_ca_en50221 *ca, int slot)
{
...
	ttpci_budget_set_video_port(saa, BUDGET_VIDEO_PORTA);

(Q: to what saa7146 video port is the saa7113 output connected?)

static int ciintf_init(struct budget_av *budget_av)
{
	struct saa7146_dev *saa = budget_av->budget.dev;
	int result;

	memset(&budget_av->ca, 0, sizeof(struct dvb_ca_en50221));

	saa7146_setgpio(saa, 0, SAA7146_GPIO_OUTLO);
	saa7146_setgpio(saa, 1, SAA7146_GPIO_OUTLO);
	saa7146_setgpio(saa, 2, SAA7146_GPIO_OUTLO);
	saa7146_setgpio(saa, 3, SAA7146_GPIO_OUTLO);

static void ciintf_deinit(struct budget_av *budget_av)
{
	struct saa7146_dev *saa = budget_av->budget.dev;

	saa7146_setgpio(saa, 0, SAA7146_GPIO_INPUT);
	saa7146_setgpio(saa, 1, SAA7146_GPIO_INPUT);
	saa7146_setgpio(saa, 2, SAA7146_GPIO_INPUT);
	saa7146_setgpio(saa, 3, SAA7146_GPIO_INPUT);

(Q: why is all that CI and tuner frontend (which budget card has got a analogtv demod?) 
code in the budget__AV__ module ?
pls move it to budget__CI__  and budget modules, and have the budget_av/_ci modules 
detected there and loaded and utilized *if* needed and clean up saa7113 
interfering detection code, thx)



will surely kill:

static int saa7113_init(struct budget_av *budget_av)
{
	struct budget *budget = &budget_av->budget;
	struct saa7146_dev *saa = budget->dev;
	const u8 *data = saa7113_tab;

	saa7146_setgpio(saa, 0, SAA7146_GPIO_OUTHI);
	msleep(200);

and further:

		if ((err = saa7146_register_device(&budget_av->vd, dev, "knc1", VFL_TYPE_GRABBER))) {

static struct v4l2_input knc1_inputs[KNC1_INPUTS] = {
	{0, "Composite", V4L2_INPUT_TYPE_TUNER, 1, 0, V4L2_STD_PAL_BG | V4L2_STD_NTSC_M, 0},
	{1, "S-Video", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG | V4L2_STD_NTSC_M, 0},
};

grabber device setup with no capture and format ioctls

static struct saa7146_extension_ioctls ioctls[] = {
	{VIDIOC_ENUMINPUT, SAA7146_EXCLUSIVE},
	{VIDIOC_G_INPUT, SAA7146_EXCLUSIVE},
	{VIDIOC_S_INPUT, SAA7146_EXCLUSIVE},
	{0, 0}
};

and no capture caps:

static struct saa7146_ext_vv vv_data = {
	.inputs = 2,
	.capabilities = 0,	// perhaps later: V4L2_CAP_VBI_CAPTURE, but that need tweaking with the saa7113

(Q: what tweaking? -> av7110_v4l.c...)

so no grabbing from the saa7113 at all? is this untried draft code? nobody using it?

then I will see if this proves saa7146 GPIO issues from CI code:

--- budget-av.c.org     2007-10-12 18:43:44.000000000 +0200
+++ budget-av.c 2007-12-02 21:35:05.000000000 +0100
@@ -1160,7 +1160,7 @@

        budget_av->budget.dvb_adapter.priv = budget_av;
        frontend_init(budget_av);
-       ciintf_init(budget_av);
+//     ciintf_init(budget_av);

        ttpci_budget_init_hooks(&budget_av->budget);







More information about the linux-dvb mailing list