diff options
author | Andy Walls <awalls@radix.net> | 2009-02-14 15:08:37 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:43:01 -0400 |
commit | 5811cf99df2e3c102055be3ea77508e56c9f77c6 (patch) | |
tree | 75be74b5072280edadeee2c1f6c42f5e961c208c /drivers/media/video/cx18/cx18-driver.h | |
parent | 1a2670465ec94029e5df62e3decca9e2f7aea075 (diff) |
V4L/DVB (10756): cx18: Slim down instance handling, build names from v4l2_device.name
Convert card instance handling to a lighter weight mechanism like ivtv.
Also convert name strings and debug messages to use v4l2_device.name.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-driver.h')
-rw-r--r-- | drivers/media/video/cx18/cx18-driver.h | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/media/video/cx18/cx18-driver.h b/drivers/media/video/cx18/cx18-driver.h index 7fc914c521f..def82bd1078 100644 --- a/drivers/media/video/cx18/cx18-driver.h +++ b/drivers/media/video/cx18/cx18-driver.h | |||
@@ -144,12 +144,12 @@ | |||
144 | /* Flag to turn on high volume debugging */ | 144 | /* Flag to turn on high volume debugging */ |
145 | #define CX18_DBGFLG_HIGHVOL (1 << 8) | 145 | #define CX18_DBGFLG_HIGHVOL (1 << 8) |
146 | 146 | ||
147 | /* NOTE: extra space before comma in 'cx->num , ## args' is required for | 147 | /* NOTE: extra space before comma in 'fmt , ## args' is required for |
148 | gcc-2.95, otherwise it won't compile. */ | 148 | gcc-2.95, otherwise it won't compile. */ |
149 | #define CX18_DEBUG(x, type, fmt, args...) \ | 149 | #define CX18_DEBUG(x, type, fmt, args...) \ |
150 | do { \ | 150 | do { \ |
151 | if ((x) & cx18_debug) \ | 151 | if ((x) & cx18_debug) \ |
152 | printk(KERN_INFO "cx18-%d " type ": " fmt, cx->num , ## args); \ | 152 | v4l2_info(&cx->v4l2_dev, " " type ": " fmt , ## args); \ |
153 | } while (0) | 153 | } while (0) |
154 | #define CX18_DEBUG_WARN(fmt, args...) CX18_DEBUG(CX18_DBGFLG_WARN, "warning", fmt , ## args) | 154 | #define CX18_DEBUG_WARN(fmt, args...) CX18_DEBUG(CX18_DBGFLG_WARN, "warning", fmt , ## args) |
155 | #define CX18_DEBUG_INFO(fmt, args...) CX18_DEBUG(CX18_DBGFLG_INFO, "info", fmt , ## args) | 155 | #define CX18_DEBUG_INFO(fmt, args...) CX18_DEBUG(CX18_DBGFLG_INFO, "info", fmt , ## args) |
@@ -163,7 +163,7 @@ | |||
163 | #define CX18_DEBUG_HIGH_VOL(x, type, fmt, args...) \ | 163 | #define CX18_DEBUG_HIGH_VOL(x, type, fmt, args...) \ |
164 | do { \ | 164 | do { \ |
165 | if (((x) & cx18_debug) && (cx18_debug & CX18_DBGFLG_HIGHVOL)) \ | 165 | if (((x) & cx18_debug) && (cx18_debug & CX18_DBGFLG_HIGHVOL)) \ |
166 | printk(KERN_INFO "cx18%d " type ": " fmt, cx->num , ## args); \ | 166 | v4l2_info(&cx->v4l2_dev, " " type ": " fmt , ## args); \ |
167 | } while (0) | 167 | } while (0) |
168 | #define CX18_DEBUG_HI_WARN(fmt, args...) CX18_DEBUG_HIGH_VOL(CX18_DBGFLG_WARN, "warning", fmt , ## args) | 168 | #define CX18_DEBUG_HI_WARN(fmt, args...) CX18_DEBUG_HIGH_VOL(CX18_DBGFLG_WARN, "warning", fmt , ## args) |
169 | #define CX18_DEBUG_HI_INFO(fmt, args...) CX18_DEBUG_HIGH_VOL(CX18_DBGFLG_INFO, "info", fmt , ## args) | 169 | #define CX18_DEBUG_HI_INFO(fmt, args...) CX18_DEBUG_HIGH_VOL(CX18_DBGFLG_INFO, "info", fmt , ## args) |
@@ -175,9 +175,9 @@ | |||
175 | #define CX18_DEBUG_HI_IRQ(fmt, args...) CX18_DEBUG_HIGH_VOL(CX18_DBGFLG_IRQ, "irq", fmt , ## args) | 175 | #define CX18_DEBUG_HI_IRQ(fmt, args...) CX18_DEBUG_HIGH_VOL(CX18_DBGFLG_IRQ, "irq", fmt , ## args) |
176 | 176 | ||
177 | /* Standard kernel messages */ | 177 | /* Standard kernel messages */ |
178 | #define CX18_ERR(fmt, args...) printk(KERN_ERR "cx18-%d: " fmt, cx->num , ## args) | 178 | #define CX18_ERR(fmt, args...) v4l2_err(&cx->v4l2_dev, fmt , ## args) |
179 | #define CX18_WARN(fmt, args...) printk(KERN_WARNING "cx18-%d: " fmt, cx->num , ## args) | 179 | #define CX18_WARN(fmt, args...) v4l2_warn(&cx->v4l2_dev, fmt , ## args) |
180 | #define CX18_INFO(fmt, args...) printk(KERN_INFO "cx18-%d: " fmt, cx->num , ## args) | 180 | #define CX18_INFO(fmt, args...) v4l2_info(&cx->v4l2_dev, fmt , ## args) |
181 | 181 | ||
182 | /* Values for CX18_API_DEC_PLAYBACK_SPEED mpeg_frame_type_mask parameter: */ | 182 | /* Values for CX18_API_DEC_PLAYBACK_SPEED mpeg_frame_type_mask parameter: */ |
183 | #define MPEG_FRAME_TYPE_IFRAME 1 | 183 | #define MPEG_FRAME_TYPE_IFRAME 1 |
@@ -445,8 +445,7 @@ struct cx18_i2c_algo_callback_data { | |||
445 | 445 | ||
446 | /* Struct to hold info about cx18 cards */ | 446 | /* Struct to hold info about cx18 cards */ |
447 | struct cx18 { | 447 | struct cx18 { |
448 | int num; /* board number, -1 during init! */ | 448 | int instance; |
449 | char name[8]; /* board name for printk and interrupts (e.g. 'cx180') */ | ||
450 | struct pci_dev *pci_dev; | 449 | struct pci_dev *pci_dev; |
451 | struct v4l2_device v4l2_dev; | 450 | struct v4l2_device v4l2_dev; |
452 | 451 | ||
@@ -455,8 +454,8 @@ struct cx18 { | |||
455 | const struct cx18_card_tuner_i2c *card_i2c; /* i2c addresses to probe for tuner */ | 454 | const struct cx18_card_tuner_i2c *card_i2c; /* i2c addresses to probe for tuner */ |
456 | u8 is_50hz; | 455 | u8 is_50hz; |
457 | u8 is_60hz; | 456 | u8 is_60hz; |
458 | u8 is_out_50hz; | 457 | u8 is_out_50hz; /* FIXME - remove, we don't have an output decoder */ |
459 | u8 is_out_60hz; | 458 | u8 is_out_60hz; /* FIXME - remove, we don't have an output decoder */ |
460 | u8 nof_inputs; /* number of video inputs */ | 459 | u8 nof_inputs; /* number of video inputs */ |
461 | u8 nof_audio_inputs; /* number of audio inputs */ | 460 | u8 nof_audio_inputs; /* number of audio inputs */ |
462 | u16 buffer_id; /* buffer ID counter */ | 461 | u16 buffer_id; /* buffer ID counter */ |
@@ -547,11 +546,13 @@ struct cx18 { | |||
547 | v4l2_std_id tuner_std; /* The norm of the tuner (fixed) */ | 546 | v4l2_std_id tuner_std; /* The norm of the tuner (fixed) */ |
548 | }; | 547 | }; |
549 | 548 | ||
549 | static inline struct cx18 *to_cx18(struct v4l2_device *v4l2_dev) | ||
550 | { | ||
551 | return container_of(v4l2_dev, struct cx18, v4l2_dev); | ||
552 | } | ||
553 | |||
550 | /* Globals */ | 554 | /* Globals */ |
551 | extern struct cx18 *cx18_cards[]; | ||
552 | extern int cx18_cards_active; | ||
553 | extern int cx18_first_minor; | 555 | extern int cx18_first_minor; |
554 | extern spinlock_t cx18_cards_lock; | ||
555 | 556 | ||
556 | /*==============Prototypes==================*/ | 557 | /*==============Prototypes==================*/ |
557 | 558 | ||