aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx/bttv.h
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2009-01-28 19:32:59 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:42:47 -0400
commit4c548d4b28c0c65938914b2790fd2ca2e9c61d63 (patch)
tree6ec0824e97063c13e7fa73f6d439aeba5e608d24 /drivers/media/video/bt8xx/bttv.h
parentabb0362f49c361f71b5aa6d244d4847145ed53c1 (diff)
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 861ff2f8f985..a2e140a25df6 100644
--- a/drivers/media/video/bt8xx/bttv.h
+++ b/drivers/media/video/bt8xx/bttv.h
@@ -192,10 +192,6 @@
192#define WINVIEW_PT2254_DATA 0x20 192#define WINVIEW_PT2254_DATA 0x20
193#define WINVIEW_PT2254_STROBE 0x80 193#define WINVIEW_PT2254_STROBE 0x80
194 194
195/* digital_mode */
196#define DIGITAL_MODE_VIDEO 1
197#define DIGITAL_MODE_CAMERA 2
198
199struct bttv_core { 195struct bttv_core {
200 /* device structs */ 196 /* device structs */
201 struct pci_dev *pci; 197 struct pci_dev *pci;
@@ -211,19 +207,24 @@ struct bttv_core {
211struct bttv; 207struct bttv;
212 208
213 209
214struct tvcard 210struct tvcard {
215{
216 char *name; 211 char *name;
217 unsigned int video_inputs; 212 void (*volume_gpio)(struct bttv *btv, __u16 volume);
218 unsigned int audio_inputs; 213 void (*audio_mode_gpio)(struct bttv *btv, struct v4l2_tuner *tuner, int set);
219 unsigned int svhs; 214 void (*muxsel_hook)(struct bttv *btv, unsigned int input);
220 unsigned int digital_mode; // DIGITAL_MODE_CAMERA or DIGITAL_MODE_VIDEO 215
221 u32 gpiomask; 216 u32 gpiomask;
222 u32 muxsel[16]; 217 u32 muxsel[16];
223 u32 gpiomux[4]; /* Tuner, Radio, external, internal */ 218 u32 gpiomux[4]; /* Tuner, Radio, external, internal */
224 u32 gpiomute; /* GPIO mute setting */ 219 u32 gpiomute; /* GPIO mute setting */
225 u32 gpiomask2; /* GPIO MUX mask */ 220 u32 gpiomask2; /* GPIO MUX mask */
226 221
222 unsigned int tuner_type;
223 u8 tuner_addr;
224 u8 video_inputs; /* Number of inputs */
225 unsigned int svhs:4; /* Which input is s-video */
226#define NO_SVHS 15
227
227 /* i2c audio flags */ 228 /* i2c audio flags */
228 unsigned int no_msp34xx:1; 229 unsigned int no_msp34xx:1;
229 unsigned int no_tda9875:1; 230 unsigned int no_tda9875:1;
@@ -231,28 +232,15 @@ struct tvcard
231 unsigned int needs_tvaudio:1; 232 unsigned int needs_tvaudio:1;
232 unsigned int msp34xx_alt:1; 233 unsigned int msp34xx_alt:1;
233 234
234 /* flag: video pci function is unused */ 235 unsigned int no_video:1; /* video pci function is unused */
235 unsigned int no_video:1;
236 unsigned int has_dvb:1; 236 unsigned int has_dvb:1;
237 unsigned int has_remote:1; 237 unsigned int has_remote:1;
238 unsigned int has_radio:1;
238 unsigned int no_gpioirq:1; 239 unsigned int no_gpioirq:1;
239 240 unsigned int pll:2;
240 /* other settings */
241 unsigned int pll;
242#define PLL_NONE 0 241#define PLL_NONE 0
243#define PLL_28 1 242#define PLL_28 1
244#define PLL_35 2 243#define PLL_35 2
245
246 unsigned int tuner_type;
247 unsigned int tuner_addr;
248 unsigned int radio_addr;
249
250 unsigned int has_radio;
251
252 void (*volume_gpio)(struct bttv *btv, __u16 volume);
253 void (*audio_mode_gpio)(struct bttv *btv, struct v4l2_tuner *tuner, int set);
254
255 void (*muxsel_hook)(struct bttv *btv, unsigned int input);
256}; 244};
257 245
258extern struct tvcard bttv_tvcards[]; 246extern struct tvcard bttv_tvcards[];