[linux-dvb] [PATCH] Add support for DViCO FusionHDTV5 USB Gold

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 01, 2006, Michael Krufky wrote:
> Is it okay to use Patrick's second suggestion (use d->pll_init directly 
> without bpll), as illustrated in the patch attached?
> 
> I like this method best, as it does exactly as what I had originally 
> intended.

Assuming that d->pll_init is initialized to zero it's OK.
But I still like the simple  = { 0x00, 0x00, 0x18, 0x50 }
better, because a) it's simpler, b) someone who tries to understand
the code doesn't have to scratch their heads as to wtf you do a
&= ~0x20 and |= 0x18 on a value initialized to zero. If you would
comment what it does it would make sense, but so it is misleading
as people will assume pll_init[] was priviously initialized to something
else, then search the code just to find it wasn't.

my 2 ?
Johannes


> Signed-off-by:  Michael Krufky <mkrufky@xxxxxxx>

> Index: v4l-dvb/linux/drivers/media/dvb/dvb-usb/cxusb.c
> ===================================================================
> --- v4l-dvb.orig/linux/drivers/media/dvb/dvb-usb/cxusb.c	2006-01-01 12:04:50.000000000 -0500
> +++ v4l-dvb/linux/drivers/media/dvb/dvb-usb/cxusb.c	2006-01-01 13:19:51.000000000 -0500
> @@ -184,12 +184,10 @@
>  
>  static int cxusb_lgh064f_tuner_attach(struct dvb_usb_device *d)
>  {
> -	u8 bpll[4];
> -	bpll[2] &= ~0x20;
> -	bpll[2] |= 0x18;
> -	bpll[3] = 0x50; /* 0x50 - digital, 0x20 - analog */
> +	d->pll_init[2] &= ~0x20;
> +	d->pll_init[2] |= 0x18;
> +	d->pll_init[3] = 0x50; /* 0x50 - digital, 0x20 - analog */
>  	d->pll_addr = 0x61;
> -	memcpy(d->pll_init,bpll,4);
>  	d->pll_desc = &dvb_pll_tdvs_tua6034;
>  	return 0;
>  }



[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux