diff options
Diffstat (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h | 123 |
1 files changed, 118 insertions, 5 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h index 25854375b..189075bbe 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h @@ -45,6 +45,83 @@ #include "pvrusb2-hdw.h" #include "pvrusb2-io.h" + +/* Definition of state variables that we can inspect & change. Numbers are + assigned from zero counting up with no gaps. */ +#define PVR2_CID_BRIGHTNESS 0 +#define PVR2_CID_CONTRAST 1 +#define PVR2_CID_SATURATION 2 +#define PVR2_CID_HUE 3 +#define PVR2_CID_VOLUME 4 +#define PVR2_CID_BALANCE 5 +#define PVR2_CID_BASS 6 +#define PVR2_CID_TREBLE 7 +#define PVR2_CID_MUTE 8 +#define PVR2_CID_SRATE 9 +#define PVR2_CID_AUDIOBITRATE 10 +#define PVR2_CID_AUDIOCRC 11 +#define PVR2_CID_AUDIOEMPHASIS 12 +#define PVR2_CID_VBR 13 +#define PVR2_CID_AVERAGEVIDEOBITRATE 14 +#define PVR2_CID_PEAKVIDEOBITRATE 15 +#define PVR2_CID_STDAVAIL 16 // V4L2 video standard bit mask +#define PVR2_CID_INPUT 17 +#define PVR2_CID_AUDIOMODE 18 // V4L2 standard audio mode enum +#define PVR2_CID_FREQUENCY 19 // Units of Hz +#define PVR2_CID_HRES 20 +#define PVR2_CID_VRES 21 +#define PVR2_CID_INTERLACE 22 +#define PVR2_CID_AUDIOLAYER 23 +#define PVR2_CID_CHANNEL 24 +#define PVR2_CID_CHANPROG_ID 25 +#define PVR2_CID_CHANPROG_FREQ 26 +#define PVR2_CID_SIGNAL_PRESENT 27 +#define PVR2_CID_STREAMING_ENABLED 28 +#define PVR2_CID_HSM 29 +#define PVR2_CID_SUBSYS_MASK 30 +#define PVR2_CID_SUBSYS_STREAM_MASK 31 +#define PVR2_CID_STDCUR 32 // V4L2 video standard bit mask +#define PVR2_CID_STDNAME 33 // Enumeration of available standards + +/* Legal values for the SRATE state variable */ +#define PVR2_CVAL_SRATE_48 0 +#define PVR2_CVAL_SRATE_44_1 1 +#define PVR2_CVAL_SRATE_MIN PVR2_CVAL_SRATE_48 +#define PVR2_CVAL_SRATE_MAX PVR2_CVAL_SRATE_44_1 + +/* Legal values for the AUDIOBITRATE state variable */ +#define PVR2_CVAL_AUDIOBITRATE_384 0 +#define PVR2_CVAL_AUDIOBITRATE_320 1 +#define PVR2_CVAL_AUDIOBITRATE_256 2 +#define PVR2_CVAL_AUDIOBITRATE_224 3 +#define PVR2_CVAL_AUDIOBITRATE_192 4 +#define PVR2_CVAL_AUDIOBITRATE_160 5 +#define PVR2_CVAL_AUDIOBITRATE_128 6 +#define PVR2_CVAL_AUDIOBITRATE_112 7 +#define PVR2_CVAL_AUDIOBITRATE_96 8 +#define PVR2_CVAL_AUDIOBITRATE_80 9 +#define PVR2_CVAL_AUDIOBITRATE_64 10 +#define PVR2_CVAL_AUDIOBITRATE_56 11 +#define PVR2_CVAL_AUDIOBITRATE_48 12 +#define PVR2_CVAL_AUDIOBITRATE_32 13 +#define PVR2_CVAL_AUDIOBITRATE_VBR 14 +#define PVR2_CVAL_AUDIOBITRATE_MIN PVR2_CVAL_AUDIOBITRATE_384 +#define PVR2_CVAL_AUDIOBITRATE_MAX PVR2_CVAL_AUDIOBITRATE_VBR + +/* Legal values for the AUDIOEMPHASIS state variable */ +#define PVR2_CVAL_AUDIOEMPHASIS_NONE 0 +#define PVR2_CVAL_AUDIOEMPHASIS_50_15 1 +#define PVR2_CVAL_AUDIOEMPHASIS_CCITT 2 +#define PVR2_CVAL_AUDIOEMPHASIS_MIN PVR2_CVAL_AUDIOEMPHASIS_NONE +#define PVR2_CVAL_AUDIOEMPHASIS_MAX PVR2_CVAL_AUDIOEMPHASIS_CCITT + +/* Legal values for PVR2_CID_HSM */ +#define PVR2_CVAL_HSM_FAIL 0 +#define PVR2_CVAL_HSM_FULL 1 +#define PVR2_CVAL_HSM_HIGH 2 +#define PVR2_CVAL_HSM_MIN PVR2_CVAL_HSM_FAIL +#define PVR2_CVAL_HSM_MAX PVR2_CVAL_HSM_HIGH + #define PVR2_VID_ENDPOINT 0x84 #define PVR2_UNK_ENDPOINT 0x86 /* maybe raw yuv ? */ #define PVR2_VBI_ENDPOINT 0x88 @@ -58,7 +135,33 @@ struct pvr2_decoder; -struct pvr2_ctl_state { +struct pvr2_ctl_def; +struct pvr2_ctrl; + +typedef int (*pvr2_ctl_set_func)(struct pvr2_ctrl *,int val); +typedef int (*pvr2_ctl_get_func)(struct pvr2_ctrl *); + +struct pvr2_ctl_def { + int id; + const char *name; + const char *desc; + pvr2_ctl_set_func set_func; + pvr2_ctl_get_func get_func; + int mask_value; + int max_value; + int min_value; + int skip_init; + int default_value; + int is_valid; + const char **value_defs_ptr; + unsigned int value_defs_count; +}; + + +struct pvr2_ctrl { + struct pvr2_hdw *hdw; + const struct pvr2_ctl_def *ctl_def; + int is_valid; int value; int dirty; }; @@ -191,7 +294,13 @@ struct pvr2_hdw { /* Tuner / frequency control stuff */ unsigned int tuner_type; int tuner_updated; - unsigned long video_standards; + v4l2_std_id video_std_avail; + v4l2_std_id video_std_cur; + struct pvr2_ctl_def video_std_enum; + struct v4l2_standard *std_defs; + const char **video_std_names; + unsigned int std_cnt; + int std_id; int unit_number; /* ID for driver instance */ unsigned long serial_number; /* ID for hardware itself */ @@ -211,13 +320,17 @@ struct pvr2_hdw { struct pvr2_audio_stat *audio_stat; /* Every last bit of controllable state */ - struct pvr2_ctl_state *controls; + struct pvr2_ctrl *controls; }; -int pvr2_hdw_set_ctl_value_internal(struct pvr2_hdw *hdw, - unsigned int ctl_id,int value); int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw); +int pvr2_ctrl_internal_set_value(struct pvr2_ctrl *cptr,int val); +int pvr2_ctrl_internal_get_value(struct pvr2_ctrl *cptr); + +int pvr2_hdw_internal_set_stdenum_cur(struct pvr2_hdw *hdw,int val); +void pvr2_hdw_internal_set_std_cur(struct pvr2_hdw *hdw,int msk); +void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw,int msk); #endif /* __PVRUSB2_HDW_INTERNAL_H */ |