diff options
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c | 10 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c | 6 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 49 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h | 20 |
4 files changed, 42 insertions, 43 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c b/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c index 16e6ea317..586900e36 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c @@ -32,11 +32,11 @@ struct debugifc_mask_item { }; static struct debugifc_mask_item mask_items[] = { - {"ENC_FIRMWARE",PVR2_SUBSYS_ENC_FIRMWARE}, - {"ENC_CFG",PVR2_SUBSYS_ENC_CFG}, - {"DIG_RUN",PVR2_SUBSYS_DIGITIZER_RUN}, - {"USB_RUN",PVR2_SUBSYS_USBSTREAM_RUN}, - {"ENC_RUN",PVR2_SUBSYS_ENC_RUN}, + {"ENC_FIRMWARE",(1<<PVR2_SUBSYS_B_ENC_FIRMWARE)}, + {"ENC_CFG",(1<<PVR2_SUBSYS_B_ENC_CFG)}, + {"DIG_RUN",(1<<PVR2_SUBSYS_B_DIGITIZER_RUN)}, + {"USB_RUN",(1<<PVR2_SUBSYS_B_USBSTREAM_RUN)}, + {"ENC_RUN",(1<<PVR2_SUBSYS_B_ENC_RUN)}, }; diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c b/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c index 962c88740..e0cded4be 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c @@ -414,7 +414,7 @@ int pvr2_encoder_configure(struct pvr2_hdw *hdw) ret |= pvr2_write_encoder_vcmd(hdw, CX2341X_ENC_INITIALIZE_INPUT, 0); if (!ret) { - hdw->subsys_enabled_mask |= PVR2_SUBSYS_ENC_CFG; + hdw->subsys_enabled_mask |= (1<<PVR2_SUBSYS_B_ENC_CFG); } return ret; @@ -442,7 +442,7 @@ int pvr2_encoder_start(struct pvr2_hdw *hdw) 0,0x13); } if (!status) { - hdw->subsys_enabled_mask |= PVR2_SUBSYS_ENC_RUN; + hdw->subsys_enabled_mask |= (1<<PVR2_SUBSYS_B_ENC_RUN); } return status; } @@ -472,7 +472,7 @@ int pvr2_encoder_stop(struct pvr2_hdw *hdw) pvr2_hdw_gpio_chg_out(hdw,0xffffffff,0x00000000); if (!status) { - hdw->subsys_enabled_mask &= ~PVR2_SUBSYS_ENC_RUN; + hdw->subsys_enabled_mask &= ~(1<<PVR2_SUBSYS_B_ENC_RUN); } return status; } diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 4843f2823..6538e886c 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -150,13 +150,12 @@ static const char *control_values_hsm[] = { }; -// ????? Need to tie these to bit positions static const char *control_values_subsystem[] = { - "enc_firmware", - "enc_config", - "digitizer_run", - "usbstream_run", - "enc_run", + [PVR2_SUBSYS_B_ENC_FIRMWARE] = "enc_firmware", + [PVR2_SUBSYS_B_ENC_CFG] = "enc_config", + [PVR2_SUBSYS_B_DIGITIZER_RUN] = "digitizer_run", + [PVR2_SUBSYS_B_USBSTREAM_RUN] = "usbstream_run", + [PVR2_SUBSYS_B_ENC_RUN] = "enc_run", }; @@ -1009,17 +1008,17 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) pvr2_trace(PVR2_TRACE_ERROR_LEGS, "firmware2 upload post-proc failure"); } else { - hdw->subsys_enabled_mask |= PVR2_SUBSYS_ENC_FIRMWARE; + hdw->subsys_enabled_mask |= (1<<PVR2_SUBSYS_B_ENC_FIRMWARE); } return ret; } #define FIRMWARE_RECOVERY_BITS \ - (PVR2_SUBSYS_ENC_CFG | \ - PVR2_SUBSYS_ENC_RUN | \ - PVR2_SUBSYS_ENC_FIRMWARE | \ - PVR2_SUBSYS_USBSTREAM_RUN) + ((1<<PVR2_SUBSYS_B_ENC_CFG) | \ + (1<<PVR2_SUBSYS_B_ENC_RUN) | \ + (1<<PVR2_SUBSYS_B_ENC_FIRMWARE) | \ + (1<<PVR2_SUBSYS_B_USBSTREAM_RUN)) /* @@ -1087,7 +1086,7 @@ void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, vmsk = (nmsk ^ hdw->subsys_enabled_mask) & hdw->subsys_enabled_mask; if (vmsk) { - if (vmsk & PVR2_SUBSYS_ENC_RUN) { + if (vmsk & (1<<PVR2_SUBSYS_B_ENC_RUN)) { pvr2_trace(PVR2_TRACE_CTL, "/*---TRACE_CTL----*/" " pvr2_encoder_stop"); @@ -1100,13 +1099,13 @@ void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, continue; } } - if (vmsk & PVR2_SUBSYS_USBSTREAM_RUN) { + if (vmsk & (1<<PVR2_SUBSYS_B_USBSTREAM_RUN)) { pvr2_trace(PVR2_TRACE_CTL, "/*---TRACE_CTL----*/" " pvr2_hdw_cmd_usbstream(0)"); pvr2_hdw_cmd_usbstream(hdw,0); } - if (vmsk & PVR2_SUBSYS_DIGITIZER_RUN) { + if (vmsk & (1<<PVR2_SUBSYS_B_DIGITIZER_RUN)) { pvr2_trace(PVR2_TRACE_CTL, "/*---TRACE_CTL----*/" " decoder disable"); @@ -1119,7 +1118,7 @@ void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, " No decoder present"); } hdw->subsys_enabled_mask &= - ~PVR2_SUBSYS_DIGITIZER_RUN; + ~(1<<PVR2_SUBSYS_B_DIGITIZER_RUN); } if (vmsk & PVR2_SUBSYS_CFG_ALL) { hdw->subsys_enabled_mask &= @@ -1128,7 +1127,7 @@ void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, } vmsk = (nmsk ^ hdw->subsys_enabled_mask) & nmsk; if (vmsk) { - if (vmsk & PVR2_SUBSYS_ENC_FIRMWARE) { + if (vmsk & (1<<PVR2_SUBSYS_B_ENC_FIRMWARE)) { pvr2_trace(PVR2_TRACE_CTL, "/*---TRACE_CTL----*/" " pvr2_upload_firmware2"); @@ -1141,7 +1140,7 @@ void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, break; } } - if (vmsk & PVR2_SUBSYS_ENC_CFG) { + if (vmsk & (1<<PVR2_SUBSYS_B_ENC_CFG)) { pvr2_trace(PVR2_TRACE_CTL, "/*---TRACE_CTL----*/" " pvr2_encoder_configure"); @@ -1154,7 +1153,7 @@ void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, continue; } } - if (vmsk & PVR2_SUBSYS_DIGITIZER_RUN) { + if (vmsk & (1<<PVR2_SUBSYS_B_DIGITIZER_RUN)) { pvr2_trace(PVR2_TRACE_CTL, "/*---TRACE_CTL----*/" " decoder enable"); @@ -1167,15 +1166,15 @@ void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, " No decoder present"); } hdw->subsys_enabled_mask |= - PVR2_SUBSYS_DIGITIZER_RUN; + (1<<PVR2_SUBSYS_B_DIGITIZER_RUN); } - if (vmsk & PVR2_SUBSYS_USBSTREAM_RUN) { + if (vmsk & (1<<PVR2_SUBSYS_B_USBSTREAM_RUN)) { pvr2_trace(PVR2_TRACE_CTL, "/*---TRACE_CTL----*/" " pvr2_hdw_cmd_usbstream(1)"); pvr2_hdw_cmd_usbstream(hdw,!0); } - if (vmsk & PVR2_SUBSYS_ENC_RUN) { + if (vmsk & (1<<PVR2_SUBSYS_B_ENC_RUN)) { pvr2_trace(PVR2_TRACE_CTL, "/*---TRACE_CTL----*/" " pvr2_encoder_start"); @@ -1724,7 +1723,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, /* Initialize the mask of subsystems that we will shut down when we stop streaming. */ hdw->subsys_stream_mask = PVR2_SUBSYS_RUN_ALL; - hdw->subsys_stream_mask |= PVR2_SUBSYS_ENC_CFG; + hdw->subsys_stream_mask |= (1<<PVR2_SUBSYS_B_ENC_CFG); pvr2_trace(PVR2_TRACE_INIT,"subsys_stream_mask: 0x%lx", hdw->subsys_stream_mask); @@ -2057,7 +2056,7 @@ int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw) hdw->audioemphasis_dirty) { /* If any of this changes, then the encoder needs to be reconfigured, and we need to reset the stream. */ - stale_subsys_mask |= PVR2_SUBSYS_ENC_CFG; + stale_subsys_mask |= (1<<PVR2_SUBSYS_B_ENC_CFG); stale_subsys_mask |= hdw->subsys_stream_mask; } @@ -2845,8 +2844,8 @@ int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl) if (!status) { hdw->subsys_enabled_mask = ((hdw->subsys_enabled_mask & - ~PVR2_SUBSYS_USBSTREAM_RUN) | - (runFl ? PVR2_SUBSYS_USBSTREAM_RUN : 0)); + ~(1<<PVR2_SUBSYS_B_USBSTREAM_RUN)) | + (runFl ? (1<<PVR2_SUBSYS_B_USBSTREAM_RUN) : 0)); } return status; } diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h index 51e896956..ba70f5d48 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h @@ -66,19 +66,19 @@ independently stopped / started. Usually you don't want to mess with this directly (let the driver handle things itself), but it is useful for debugging. */ -#define PVR2_SUBSYS_ENC_FIRMWARE (1 << 0) -#define PVR2_SUBSYS_ENC_CFG (1 << 1) -#define PVR2_SUBSYS_DIGITIZER_RUN (1 << 2) -#define PVR2_SUBSYS_USBSTREAM_RUN (1 << 3) -#define PVR2_SUBSYS_ENC_RUN (1 << 4) +#define PVR2_SUBSYS_B_ENC_FIRMWARE 0 +#define PVR2_SUBSYS_B_ENC_CFG 1 +#define PVR2_SUBSYS_B_DIGITIZER_RUN 2 +#define PVR2_SUBSYS_B_USBSTREAM_RUN 3 +#define PVR2_SUBSYS_B_ENC_RUN 4 #define PVR2_SUBSYS_CFG_ALL ( \ - PVR2_SUBSYS_ENC_FIRMWARE | \ - PVR2_SUBSYS_ENC_CFG ) + (1 << PVR2_SUBSYS_B_ENC_FIRMWARE) | \ + (1 << PVR2_SUBSYS_B_ENC_CFG) ) #define PVR2_SUBSYS_RUN_ALL ( \ - PVR2_SUBSYS_DIGITIZER_RUN | \ - PVR2_SUBSYS_USBSTREAM_RUN | \ - PVR2_SUBSYS_ENC_RUN ) + (1 << PVR2_SUBSYS_B_DIGITIZER_RUN) | \ + (1 << PVR2_SUBSYS_B_USBSTREAM_RUN) | \ + (1 << PVR2_SUBSYS_B_ENC_RUN) ) #define PVR2_SUBSYS_ALL ( \ PVR2_SUBSYS_CFG_ALL | \ PVR2_SUBSYS_RUN_ALL ) |