treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / media / usb / pvrusb2 / pvrusb2-ctrl.h
blob7dd4b73f783c332c35ea18324970bda31873442f
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
4 * Copyright (C) 2005 Mike Isely <isely@pobox.com>
5 */
6 #ifndef __PVRUSB2_CTRL_H
7 #define __PVRUSB2_CTRL_H
9 struct pvr2_ctrl;
11 enum pvr2_ctl_type {
12 pvr2_ctl_int = 0,
13 pvr2_ctl_enum = 1,
14 pvr2_ctl_bitmask = 2,
15 pvr2_ctl_bool = 3,
19 /* Set the given control. */
20 int pvr2_ctrl_set_value(struct pvr2_ctrl *,int val);
22 /* Set/clear specific bits of the given control. */
23 int pvr2_ctrl_set_mask_value(struct pvr2_ctrl *,int mask,int val);
25 /* Get the current value of the given control. */
26 int pvr2_ctrl_get_value(struct pvr2_ctrl *,int *valptr);
28 /* Retrieve control's type */
29 enum pvr2_ctl_type pvr2_ctrl_get_type(struct pvr2_ctrl *);
31 /* Retrieve control's maximum value (int type) */
32 int pvr2_ctrl_get_max(struct pvr2_ctrl *);
34 /* Retrieve control's minimum value (int type) */
35 int pvr2_ctrl_get_min(struct pvr2_ctrl *);
37 /* Retrieve control's default value (any type) */
38 int pvr2_ctrl_get_def(struct pvr2_ctrl *, int *valptr);
40 /* Retrieve control's enumeration count (enum only) */
41 int pvr2_ctrl_get_cnt(struct pvr2_ctrl *);
43 /* Retrieve control's valid mask bits (bit mask only) */
44 int pvr2_ctrl_get_mask(struct pvr2_ctrl *);
46 /* Retrieve the control's name */
47 const char *pvr2_ctrl_get_name(struct pvr2_ctrl *);
49 /* Retrieve the control's desc */
50 const char *pvr2_ctrl_get_desc(struct pvr2_ctrl *);
52 /* Retrieve a control enumeration or bit mask value */
53 int pvr2_ctrl_get_valname(struct pvr2_ctrl *,int,char *,unsigned int,
54 unsigned int *);
56 /* Return true if control is writable */
57 int pvr2_ctrl_is_writable(struct pvr2_ctrl *);
59 /* Return V4L flags value for control (or zero if there is no v4l control
60 actually under this control) */
61 unsigned int pvr2_ctrl_get_v4lflags(struct pvr2_ctrl *);
63 /* Return V4L ID for this control or zero if none */
64 int pvr2_ctrl_get_v4lid(struct pvr2_ctrl *);
66 /* Return true if control has custom symbolic representation */
67 int pvr2_ctrl_has_custom_symbols(struct pvr2_ctrl *);
69 /* Convert a given mask/val to a custom symbolic value */
70 int pvr2_ctrl_custom_value_to_sym(struct pvr2_ctrl *,
71 int mask,int val,
72 char *buf,unsigned int maxlen,
73 unsigned int *len);
75 /* Convert a symbolic value to a mask/value pair */
76 int pvr2_ctrl_custom_sym_to_value(struct pvr2_ctrl *,
77 const char *buf,unsigned int len,
78 int *maskptr,int *valptr);
80 /* Convert a given mask/val to a symbolic value */
81 int pvr2_ctrl_value_to_sym(struct pvr2_ctrl *,
82 int mask,int val,
83 char *buf,unsigned int maxlen,
84 unsigned int *len);
86 /* Convert a symbolic value to a mask/value pair */
87 int pvr2_ctrl_sym_to_value(struct pvr2_ctrl *,
88 const char *buf,unsigned int len,
89 int *maskptr,int *valptr);
91 /* Convert a given mask/val to a symbolic value - must already be
92 inside of critical region. */
93 int pvr2_ctrl_value_to_sym_internal(struct pvr2_ctrl *,
94 int mask,int val,
95 char *buf,unsigned int maxlen,
96 unsigned int *len);
98 #endif /* __PVRUSB2_CTRL_H */