V4L/DVB (6006): tuner: move last_div to tuner-simple private data
[wrt350n-kernel.git] / drivers / media / video / pvrusb2 / pvrusb2-ctrl.h
blobc1680053cd644f10c7b2c1c0540640583e8c9302
1 /*
3 * $Id$
5 * Copyright (C) 2005 Mike Isely <isely@pobox.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __PVRUSB2_CTRL_H
22 #define __PVRUSB2_CTRL_H
24 struct pvr2_ctrl;
26 enum pvr2_ctl_type {
27 pvr2_ctl_int = 0,
28 pvr2_ctl_enum = 1,
29 pvr2_ctl_bitmask = 2,
30 pvr2_ctl_bool = 3,
34 /* Set the given control. */
35 int pvr2_ctrl_set_value(struct pvr2_ctrl *,int val);
37 /* Set/clear specific bits of the given control. */
38 int pvr2_ctrl_set_mask_value(struct pvr2_ctrl *,int mask,int val);
40 /* Get the current value of the given control. */
41 int pvr2_ctrl_get_value(struct pvr2_ctrl *,int *valptr);
43 /* Retrieve control's type */
44 enum pvr2_ctl_type pvr2_ctrl_get_type(struct pvr2_ctrl *);
46 /* Retrieve control's maximum value (int type) */
47 int pvr2_ctrl_get_max(struct pvr2_ctrl *);
49 /* Retrieve control's minimum value (int type) */
50 int pvr2_ctrl_get_min(struct pvr2_ctrl *);
52 /* Retrieve control's default value (any type) */
53 int pvr2_ctrl_get_def(struct pvr2_ctrl *);
55 /* Retrieve control's enumeration count (enum only) */
56 int pvr2_ctrl_get_cnt(struct pvr2_ctrl *);
58 /* Retrieve control's valid mask bits (bit mask only) */
59 int pvr2_ctrl_get_mask(struct pvr2_ctrl *);
61 /* Retrieve the control's name */
62 const char *pvr2_ctrl_get_name(struct pvr2_ctrl *);
64 /* Retrieve the control's desc */
65 const char *pvr2_ctrl_get_desc(struct pvr2_ctrl *);
67 /* Retrieve a control enumeration or bit mask value */
68 int pvr2_ctrl_get_valname(struct pvr2_ctrl *,int,char *,unsigned int,
69 unsigned int *);
71 /* Return true if control is writable */
72 int pvr2_ctrl_is_writable(struct pvr2_ctrl *);
74 /* Return V4L flags value for control (or zero if there is no v4l control
75 actually under this control) */
76 unsigned int pvr2_ctrl_get_v4lflags(struct pvr2_ctrl *);
78 /* Return V4L ID for this control or zero if none */
79 int pvr2_ctrl_get_v4lid(struct pvr2_ctrl *);
81 /* Return true if control has custom symbolic representation */
82 int pvr2_ctrl_has_custom_symbols(struct pvr2_ctrl *);
84 /* Convert a given mask/val to a custom symbolic value */
85 int pvr2_ctrl_custom_value_to_sym(struct pvr2_ctrl *,
86 int mask,int val,
87 char *buf,unsigned int maxlen,
88 unsigned int *len);
90 /* Convert a symbolic value to a mask/value pair */
91 int pvr2_ctrl_custom_sym_to_value(struct pvr2_ctrl *,
92 const char *buf,unsigned int len,
93 int *maskptr,int *valptr);
95 /* Convert a given mask/val to a symbolic value */
96 int pvr2_ctrl_value_to_sym(struct pvr2_ctrl *,
97 int mask,int val,
98 char *buf,unsigned int maxlen,
99 unsigned int *len);
101 /* Convert a symbolic value to a mask/value pair */
102 int pvr2_ctrl_sym_to_value(struct pvr2_ctrl *,
103 const char *buf,unsigned int len,
104 int *maskptr,int *valptr);
106 /* Convert a given mask/val to a symbolic value - must already be
107 inside of critical region. */
108 int pvr2_ctrl_value_to_sym_internal(struct pvr2_ctrl *,
109 int mask,int val,
110 char *buf,unsigned int maxlen,
111 unsigned int *len);
113 #endif /* __PVRUSB2_CTRL_H */
116 Stuff for Emacs to see, in order to encourage consistent editing style:
117 *** Local Variables: ***
118 *** mode: c ***
119 *** fill-column: 75 ***
120 *** tab-width: 8 ***
121 *** c-basic-offset: 8 ***
122 *** End: ***