Commit Graph

8 Commits

Author SHA1 Message Date
Trent Piepho c682b3a7fb V4L/DVB (5517): Usbvision: store the device database more efficiently
One bit wide bitfields need to declared unsigned to have the range 0 to
1, or they have the range -1 to 0.

A few techniques to reduce the driver's size by about 1700 bytes on ia32,
probably more on x86-64.

Put the biggest fields first, less padding is necessary that way.

Put fields with a limited range into a smaller type.  For example
VideoChannels will fit in 3 bits, and TunerType can use 8 bits.

Vin_Reg1, Vin_Reg2, and Dvi_yuv define values for 8-bit registers, but
they can't just go into an 8-bit field with no changes, since -1 was used
as a flag to indicate a value was not present.  So what we do is create a
one-bit flag for each one to indicate if a value is or is not present.

This only takes 9 bits and has the added advantage that when the register
isn't overridden (Vin_Reg[12] never are) it doesn't need to appear in the
structure definition since the default value for the flag will be zero.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Acked-by: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 15:45:34 -03:00
Mauro Carvalho Chehab f7ca6256bc V4L/DVB (5516): Reduce usbvision data size
This patch reduces usbvision driver on about 1Kb on i386 over the
original version with the old struct:
   text    data     bss     dec     hex filename
  52312   11848      60   64220    fadc old/usbvision.ko
  52474   10708      60   63242    f70a new/usbvision.ko

Acked-by: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 15:45:33 -03:00
Mauro Carvalho Chehab 659ae56dcd V4L/DVB (5515): Use a better format to represent usbvision supported boards
Changed usbvision cards table to allow:
	1) Not repeat USB ID on two structs;
	2) Not need to specify both usb and card description tables at
	   the same order, removing some magic;
Some cards had duplicated names. Fixed.
A test for an specific board were doing by using a string comparation.
The comparation were wrong. Also, it is not a good practice to recognize
a board based on his string name.
Acked-by: Thierry MERLE <thierry.merle@free.fr>

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 15:45:32 -03:00
Dwaine P. Garden e6c1df5581 V4L/DVB (5386): Add some missing Hauppauge and Belkin devices to the driver
-Add some missing Hauppauge and Belkin devices to the driver.
-Fixed up some device descriptions.

Signed-off-by: Dwaine P. Garden <DwaineGarden@rogers.com>
Signed-off-by: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 15:44:16 -03:00
Dwaine Garden ed00b41dc8 V4L/DVB (4979): Fixes compilation when CONFIG_V4L1_COMPAT is not selected
- SYSFS: Replaced all to_video_device(cd), video_device_create_file,
  video_device_remove_file and add the proper checks at create_file
- Converted old norm values to V4L2 ones.
- Robustness on sysfs hue/contrast/saturation queries.
  Additional check in order to return 0 if the driver is not opened.
- Whitespace cleanups in usbvision-cards.c

This patch merges two fixes by Thierry MERLE and Mauro Chehab, and adds
additional checks.

Signed-off-by: Dwaine Garden<DwaineGarden@rogers.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-12-27 14:19:21 -02:00
Mauro Carvalho Chehab 7ca659e3c1 V4L/DVB (4942): Whitespace cleanups
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-12-10 09:22:53 -02:00
Thierry MERLE 483dfdb64f V4L/DVB (4937): Usbvision cleanup and code reorganization
- removal of overlay stuff
- reorganization of functions in 3 files:
    * usbvision-i2c for I2C-related stuff
    * usbvision-video for v4l2 entry points
    * usbvision-core for all peripheral controls and utilities

Signed-off-by: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-12-10 09:22:49 -02:00
Mauro Carvalho Chehab 6714b01263 V4L/DVB (4923): Splitted usbvision cards from usbvison.h
Having the cards description into a separated file makes
easier to maintain and follows the same standard as other
drivers.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-12-10 09:05:41 -02:00