aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88.h
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-08-15 13:41:57 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:05:16 -0400
commit6a59d64c5cc302e0139ddb1f5e57afceecb14368 (patch)
treee3a14e27b5aca04a4069797893d59df7bc0f8f65 /drivers/media/video/cx88/cx88.h
parentb09a79f5848f2143a8ffc724910743027d5a70e0 (diff)
V4L/DVB (6021): cx88: Copy board information into card state
The cx88 driver state stored the ID of the board type in core->board. Every time the driver need to get some information about the board configuration, it uses the board number as an index into board configuration array. This patch changes it so that the board number is in core->boardnr, and core->board is a copy of the board configuration information. This allows access to board information without the extra indirection. e.g. cx88_boards[core->board].mpeg becomes core->board.mpeg. This has a number of advantages: - The code is simpler to write. - It compiles to be smaller and faster, without needing the extra array lookup to get at the board information. - The cx88_boards array no longer needs to be exported to all cx88 modules. - The boards array can be made const - It should be possible to avoid keeping the (large) cx88_boards array around after the module is loaded. - If module parameters or eeprom info override some board configuration setting, it's not necessary to modify the boards array, which would affect all boards of the same type. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx88/cx88.h')
-rw-r--r--drivers/media/video/cx88/cx88.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index 78486f90327a..3636ec26de59 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -250,7 +250,7 @@ struct cx88_subid {
250 u32 card; 250 u32 card;
251}; 251};
252 252
253#define INPUT(nr) (&cx88_boards[core->board].input[nr]) 253#define INPUT(nr) (core->board.input[nr])
254 254
255/* ----------------------------------------------------------- */ 255/* ----------------------------------------------------------- */
256/* device / file handle status */ 256/* device / file handle status */
@@ -304,13 +304,8 @@ struct cx88_core {
304 u32 i2c_state, i2c_rc; 304 u32 i2c_state, i2c_rc;
305 305
306 /* config info -- analog */ 306 /* config info -- analog */
307 unsigned int board; 307 unsigned int boardnr;
308 unsigned int tuner_type; 308 struct cx88_board board;
309 unsigned int radio_type;
310 unsigned char tuner_addr;
311 unsigned char radio_addr;
312 unsigned int tda9887_conf;
313 unsigned int has_radio;
314 309
315 /* Supported V4L _STD_ tuner formats */ 310 /* Supported V4L _STD_ tuner formats */
316 unsigned int tuner_formats; 311 unsigned int tuner_formats;
@@ -585,7 +580,7 @@ extern void cx88_call_i2c_clients(struct cx88_core *core,
585/* ----------------------------------------------------------- */ 580/* ----------------------------------------------------------- */
586/* cx88-cards.c */ 581/* cx88-cards.c */
587 582
588extern struct cx88_board cx88_boards[]; 583extern const struct cx88_board cx88_boards[];
589extern const unsigned int cx88_bcount; 584extern const unsigned int cx88_bcount;
590 585
591extern struct cx88_subid cx88_subids[]; 586extern struct cx88_subid cx88_subids[];