Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  *
0004  *  Copyright (C) 2005 Mike Isely <isely@pobox.com>
0005  */
0006 #ifndef __PVRUSB2_CTRL_H
0007 #define __PVRUSB2_CTRL_H
0008 
0009 struct pvr2_ctrl;
0010 
0011 enum pvr2_ctl_type {
0012     pvr2_ctl_int = 0,
0013     pvr2_ctl_enum = 1,
0014     pvr2_ctl_bitmask = 2,
0015     pvr2_ctl_bool = 3,
0016 };
0017 
0018 
0019 /* Set the given control. */
0020 int pvr2_ctrl_set_value(struct pvr2_ctrl *,int val);
0021 
0022 /* Set/clear specific bits of the given control. */
0023 int pvr2_ctrl_set_mask_value(struct pvr2_ctrl *,int mask,int val);
0024 
0025 /* Get the current value of the given control. */
0026 int pvr2_ctrl_get_value(struct pvr2_ctrl *,int *valptr);
0027 
0028 /* Retrieve control's type */
0029 enum pvr2_ctl_type pvr2_ctrl_get_type(struct pvr2_ctrl *);
0030 
0031 /* Retrieve control's maximum value (int type) */
0032 int pvr2_ctrl_get_max(struct pvr2_ctrl *);
0033 
0034 /* Retrieve control's minimum value (int type) */
0035 int pvr2_ctrl_get_min(struct pvr2_ctrl *);
0036 
0037 /* Retrieve control's default value (any type) */
0038 int pvr2_ctrl_get_def(struct pvr2_ctrl *, int *valptr);
0039 
0040 /* Retrieve control's enumeration count (enum only) */
0041 int pvr2_ctrl_get_cnt(struct pvr2_ctrl *);
0042 
0043 /* Retrieve control's valid mask bits (bit mask only) */
0044 int pvr2_ctrl_get_mask(struct pvr2_ctrl *);
0045 
0046 /* Retrieve the control's name */
0047 const char *pvr2_ctrl_get_name(struct pvr2_ctrl *);
0048 
0049 /* Retrieve the control's desc */
0050 const char *pvr2_ctrl_get_desc(struct pvr2_ctrl *);
0051 
0052 /* Retrieve a control enumeration or bit mask value */
0053 int pvr2_ctrl_get_valname(struct pvr2_ctrl *,int,char *,unsigned int,
0054               unsigned int *);
0055 
0056 /* Return true if control is writable */
0057 int pvr2_ctrl_is_writable(struct pvr2_ctrl *);
0058 
0059 /* Return V4L flags value for control (or zero if there is no v4l control
0060    actually under this control) */
0061 unsigned int pvr2_ctrl_get_v4lflags(struct pvr2_ctrl *);
0062 
0063 /* Return V4L ID for this control or zero if none */
0064 int pvr2_ctrl_get_v4lid(struct pvr2_ctrl *);
0065 
0066 /* Return true if control has custom symbolic representation */
0067 int pvr2_ctrl_has_custom_symbols(struct pvr2_ctrl *);
0068 
0069 /* Convert a given mask/val to a custom symbolic value */
0070 int pvr2_ctrl_custom_value_to_sym(struct pvr2_ctrl *,
0071                   int mask,int val,
0072                   char *buf,unsigned int maxlen,
0073                   unsigned int *len);
0074 
0075 /* Convert a symbolic value to a mask/value pair */
0076 int pvr2_ctrl_custom_sym_to_value(struct pvr2_ctrl *,
0077                   const char *buf,unsigned int len,
0078                   int *maskptr,int *valptr);
0079 
0080 /* Convert a given mask/val to a symbolic value */
0081 int pvr2_ctrl_value_to_sym(struct pvr2_ctrl *,
0082                int mask,int val,
0083                char *buf,unsigned int maxlen,
0084                unsigned int *len);
0085 
0086 /* Convert a symbolic value to a mask/value pair */
0087 int pvr2_ctrl_sym_to_value(struct pvr2_ctrl *,
0088                const char *buf,unsigned int len,
0089                int *maskptr,int *valptr);
0090 
0091 /* Convert a given mask/val to a symbolic value - must already be
0092    inside of critical region. */
0093 int pvr2_ctrl_value_to_sym_internal(struct pvr2_ctrl *,
0094                int mask,int val,
0095                char *buf,unsigned int maxlen,
0096                unsigned int *len);
0097 
0098 #endif /* __PVRUSB2_CTRL_H */