summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx/bttv.h
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2009-01-28 21:32:59 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 12:42:47 -0300
commit4c548d4b28c0c65938914b2790fd2ca2e9c61d63 (patch)
tree6ec0824e97063c13e7fa73f6d439aeba5e608d24 /drivers/media/video/bt8xx/bttv.h
parentabb0362f49c361f71b5aa6d244d4847145ed53c1 (diff)
downloadop-kernel-dev-4c548d4b28c0c65938914b2790fd2ca2e9c61d63.zip
op-kernel-dev-4c548d4b28c0c65938914b2790fd2ca2e9c61d63.tar.gz
V4L/DVB (10561): bttv: store card database more efficiently
The bttv card database is quite large and the data structure used to store it wasn't very efficient. Most of the field are only used at card initialization time so it doesn't matter if they aren't efficient to access. Overall the changes reduce code size by 60 bytes in ia32. The data size is decreased by 5024 byes. It is probably even more for 64-bit kernels. Move the fields in the struct around to be sorted from largest to smallest. This saves on padding space used for alignment. Get rid of the unused digital_mode field. Leave the setting as a comment in the few cards entries that set it, in case someone ever writes the code. Get rid of the unused audio_inputs field. Leave the values in the card entries in case someone ever writes code that might use it. Get ride of the unused radio_addr field. No card entries even set it to anything interesting so it's not left as comments. All the code that used it was removed in commit v2.6.14-3466-g291d1d7 from Nov 8th 2005. Reduce video_inputs to u8 as no card has more than 255 inputs (the most is 16). Change tuner_addr to u8. I2C addresses are only seven bits and 255 means ADDR_UNSET, so everything fits. Make has_radio a one bit flag. Make the pll setting a two bit field. Reduce svhs to four bits as no card has an s-video input above 9. Change the value for no s-video input from UNSET (which is -1U and out of range of four bits) to NO_SVHS (which is now 15). Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/bt8xx/bttv.h')
-rw-r--r--drivers/media/video/bt8xx/bttv.h40
1 files changed, 14 insertions, 26 deletions
diff --git a/drivers/media/video/bt8xx/bttv.h b/drivers/media/video/bt8xx/bttv.h
index 861ff2f..a2e140a 100644
--- a/drivers/media/video/bt8xx/bttv.h
+++ b/drivers/media/video/bt8xx/bttv.h
@@ -192,10 +192,6 @@
#define WINVIEW_PT2254_DATA 0x20
#define WINVIEW_PT2254_STROBE 0x80
-/* digital_mode */
-#define DIGITAL_MODE_VIDEO 1
-#define DIGITAL_MODE_CAMERA 2
-
struct bttv_core {
/* device structs */
struct pci_dev *pci;
@@ -211,19 +207,24 @@ struct bttv_core {
struct bttv;
-struct tvcard
-{
+struct tvcard {
char *name;
- unsigned int video_inputs;
- unsigned int audio_inputs;
- unsigned int svhs;
- unsigned int digital_mode; // DIGITAL_MODE_CAMERA or DIGITAL_MODE_VIDEO
+ void (*volume_gpio)(struct bttv *btv, __u16 volume);
+ void (*audio_mode_gpio)(struct bttv *btv, struct v4l2_tuner *tuner, int set);
+ void (*muxsel_hook)(struct bttv *btv, unsigned int input);
+
u32 gpiomask;
u32 muxsel[16];
u32 gpiomux[4]; /* Tuner, Radio, external, internal */
u32 gpiomute; /* GPIO mute setting */
u32 gpiomask2; /* GPIO MUX mask */
+ unsigned int tuner_type;
+ u8 tuner_addr;
+ u8 video_inputs; /* Number of inputs */
+ unsigned int svhs:4; /* Which input is s-video */
+#define NO_SVHS 15
+
/* i2c audio flags */
unsigned int no_msp34xx:1;
unsigned int no_tda9875:1;
@@ -231,28 +232,15 @@ struct tvcard
unsigned int needs_tvaudio:1;
unsigned int msp34xx_alt:1;
- /* flag: video pci function is unused */
- unsigned int no_video:1;
+ unsigned int no_video:1; /* video pci function is unused */
unsigned int has_dvb:1;
unsigned int has_remote:1;
+ unsigned int has_radio:1;
unsigned int no_gpioirq:1;
-
- /* other settings */
- unsigned int pll;
+ unsigned int pll:2;
#define PLL_NONE 0
#define PLL_28 1
#define PLL_35 2
-
- unsigned int tuner_type;
- unsigned int tuner_addr;
- unsigned int radio_addr;
-
- unsigned int has_radio;
-
- void (*volume_gpio)(struct bttv *btv, __u16 volume);
- void (*audio_mode_gpio)(struct bttv *btv, struct v4l2_tuner *tuner, int set);
-
- void (*muxsel_hook)(struct bttv *btv, unsigned int input);
};
extern struct tvcard bttv_tvcards[];
OpenPOWER on IntegriCloud