diff options
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h | 64 |
1 files changed, 50 insertions, 14 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h index f873994b088c..8ee4549b7a9f 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h | |||
@@ -35,6 +35,7 @@ | |||
35 | 35 | ||
36 | #include <linux/videodev2.h> | 36 | #include <linux/videodev2.h> |
37 | #include <linux/i2c.h> | 37 | #include <linux/i2c.h> |
38 | #include <linux/workqueue.h> | ||
38 | #include <linux/mutex.h> | 39 | #include <linux/mutex.h> |
39 | #include "pvrusb2-hdw.h" | 40 | #include "pvrusb2-hdw.h" |
40 | #include "pvrusb2-io.h" | 41 | #include "pvrusb2-io.h" |
@@ -179,6 +180,12 @@ struct pvr2_hdw { | |||
179 | /* Device type, one of PVR2_HDW_TYPE_xxxxx */ | 180 | /* Device type, one of PVR2_HDW_TYPE_xxxxx */ |
180 | unsigned int hdw_type; | 181 | unsigned int hdw_type; |
181 | 182 | ||
183 | /* Kernel worker thread handling */ | ||
184 | struct workqueue_struct *workqueue; | ||
185 | struct work_struct workpoll; /* Update driver state */ | ||
186 | struct work_struct worki2csync; /* Update i2c clients */ | ||
187 | struct work_struct workinit; /* Driver initialization sequence */ | ||
188 | |||
182 | /* Video spigot */ | 189 | /* Video spigot */ |
183 | struct pvr2_stream *vid_stream; | 190 | struct pvr2_stream *vid_stream; |
184 | 191 | ||
@@ -186,9 +193,6 @@ struct pvr2_hdw { | |||
186 | struct mutex big_lock_mutex; | 193 | struct mutex big_lock_mutex; |
187 | int big_lock_held; /* For debugging */ | 194 | int big_lock_held; /* For debugging */ |
188 | 195 | ||
189 | void (*poll_trigger_func)(void *); | ||
190 | void *poll_trigger_data; | ||
191 | |||
192 | char name[32]; | 196 | char name[32]; |
193 | 197 | ||
194 | /* I2C stuff */ | 198 | /* I2C stuff */ |
@@ -225,14 +229,48 @@ struct pvr2_hdw { | |||
225 | unsigned int cmd_debug_write_len; // | 229 | unsigned int cmd_debug_write_len; // |
226 | unsigned int cmd_debug_read_len; // | 230 | unsigned int cmd_debug_read_len; // |
227 | 231 | ||
232 | /* Bits of state that describe what is going on with various parts | ||
233 | of the driver. */ | ||
234 | volatile int state_encoder_ok; /* Encoder is operational */ | ||
235 | volatile int state_encoder_run; /* Encoder is running */ | ||
236 | volatile int state_encoder_config; /* Encoder is configured */ | ||
237 | volatile int state_encoder_waitok; /* Encoder pre-wait done */ | ||
238 | volatile int state_decoder_run; /* Decoder is running */ | ||
239 | volatile int state_usbstream_run; /* FX2 is streaming */ | ||
240 | volatile int state_decoder_quiescent; /* Decoder idle for > 50msec */ | ||
241 | volatile int state_pipeline_config; /* Pipeline is configured */ | ||
242 | int state_pipeline_req; /* Somebody wants to stream */ | ||
243 | int state_pipeline_pause; /* Pipeline must be paused */ | ||
244 | int state_pipeline_idle; /* Pipeline not running */ | ||
245 | |||
246 | /* This is the master state of the driver. It is the combined | ||
247 | result of other bits of state. Examining this will indicate the | ||
248 | overall state of the driver. Values here are one of | ||
249 | PVR2_STATE_xxxx */ | ||
250 | unsigned int master_state; | ||
251 | |||
252 | /* True if states must be re-evaluated */ | ||
253 | int state_stale; | ||
254 | |||
255 | void (*state_func)(void *); | ||
256 | void *state_data; | ||
257 | |||
258 | /* Timer for measuring decoder settling time */ | ||
259 | struct timer_list quiescent_timer; | ||
260 | |||
261 | /* Timer for measuring encoder pre-wait time */ | ||
262 | struct timer_list encoder_wait_timer; | ||
263 | |||
264 | /* Place to block while waiting for state changes */ | ||
265 | wait_queue_head_t state_wait_data; | ||
266 | |||
267 | |||
228 | int flag_ok; /* device in known good state */ | 268 | int flag_ok; /* device in known good state */ |
229 | int flag_disconnected; /* flag_ok == 0 due to disconnect */ | 269 | int flag_disconnected; /* flag_ok == 0 due to disconnect */ |
230 | int flag_init_ok; /* true if structure is fully initialized */ | 270 | int flag_init_ok; /* true if structure is fully initialized */ |
231 | int flag_streaming_enabled; /* true if streaming should be on */ | ||
232 | int fw1_state; /* current situation with fw1 */ | 271 | int fw1_state; /* current situation with fw1 */ |
233 | int flag_encoder_ok; /* True if encoder is healthy */ | 272 | int flag_decoder_missed;/* We've noticed missing decoder */ |
234 | 273 | int flag_tripped; /* Indicates overall failure to start */ | |
235 | int flag_decoder_is_tuned; | ||
236 | 274 | ||
237 | struct pvr2_decoder_ctrl *decoder_ctrl; | 275 | struct pvr2_decoder_ctrl *decoder_ctrl; |
238 | 276 | ||
@@ -241,12 +279,6 @@ struct pvr2_hdw { | |||
241 | unsigned int fw_size; | 279 | unsigned int fw_size; |
242 | int fw_cpu_flag; /* True if we are dealing with the CPU */ | 280 | int fw_cpu_flag; /* True if we are dealing with the CPU */ |
243 | 281 | ||
244 | // Which subsystem pieces have been enabled / configured | ||
245 | unsigned long subsys_enabled_mask; | ||
246 | |||
247 | // Which subsystems are manipulated to enable streaming | ||
248 | unsigned long subsys_stream_mask; | ||
249 | |||
250 | // True if there is a request to trigger logging of state in each | 282 | // True if there is a request to trigger logging of state in each |
251 | // module. | 283 | // module. |
252 | int log_requested; | 284 | int log_requested; |
@@ -296,13 +328,16 @@ struct pvr2_hdw { | |||
296 | /* Location of eeprom or a negative number if none */ | 328 | /* Location of eeprom or a negative number if none */ |
297 | int eeprom_addr; | 329 | int eeprom_addr; |
298 | 330 | ||
299 | enum pvr2_config config; | 331 | enum pvr2_config active_stream_type; |
332 | enum pvr2_config desired_stream_type; | ||
300 | 333 | ||
301 | /* Control state needed for cx2341x module */ | 334 | /* Control state needed for cx2341x module */ |
302 | struct cx2341x_mpeg_params enc_cur_state; | 335 | struct cx2341x_mpeg_params enc_cur_state; |
303 | struct cx2341x_mpeg_params enc_ctl_state; | 336 | struct cx2341x_mpeg_params enc_ctl_state; |
304 | /* True if an encoder attribute has changed */ | 337 | /* True if an encoder attribute has changed */ |
305 | int enc_stale; | 338 | int enc_stale; |
339 | /* True if an unsafe encoder attribute has changed */ | ||
340 | int enc_unsafe_stale; | ||
306 | /* True if enc_cur_state is valid */ | 341 | /* True if enc_cur_state is valid */ |
307 | int enc_cur_valid; | 342 | int enc_cur_valid; |
308 | 343 | ||
@@ -332,6 +367,7 @@ struct pvr2_hdw { | |||
332 | 367 | ||
333 | /* This function gets the current frequency */ | 368 | /* This function gets the current frequency */ |
334 | unsigned long pvr2_hdw_get_cur_freq(struct pvr2_hdw *); | 369 | unsigned long pvr2_hdw_get_cur_freq(struct pvr2_hdw *); |
370 | void pvr2_hdw_set_decoder(struct pvr2_hdw *,struct pvr2_decoder_ctrl *); | ||
335 | 371 | ||
336 | #endif /* __PVRUSB2_HDW_INTERNAL_H */ | 372 | #endif /* __PVRUSB2_HDW_INTERNAL_H */ |
337 | 373 | ||