]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - drivers/media/usb/pvrusb2/pvrusb2-ctrl.h
Merge branches 'for-4.11/upstream-fixes', 'for-4.12/accutouch', 'for-4.12/cp2112...
[mirror_ubuntu-artful-kernel.git] / drivers / media / usb / pvrusb2 / pvrusb2-ctrl.h
CommitLineData
d855497e
MI
1/*
2 *
d855497e
MI
3 *
4 * Copyright (C) 2005 Mike Isely <isely@pobox.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
d855497e
MI
15 */
16#ifndef __PVRUSB2_CTRL_H
17#define __PVRUSB2_CTRL_H
18
19struct pvr2_ctrl;
20
21enum pvr2_ctl_type {
22 pvr2_ctl_int = 0,
23 pvr2_ctl_enum = 1,
24 pvr2_ctl_bitmask = 2,
33213963 25 pvr2_ctl_bool = 3,
d855497e
MI
26};
27
28
29/* Set the given control. */
30int pvr2_ctrl_set_value(struct pvr2_ctrl *,int val);
31
32/* Set/clear specific bits of the given control. */
33int pvr2_ctrl_set_mask_value(struct pvr2_ctrl *,int mask,int val);
34
35/* Get the current value of the given control. */
36int pvr2_ctrl_get_value(struct pvr2_ctrl *,int *valptr);
37
38/* Retrieve control's type */
39enum pvr2_ctl_type pvr2_ctrl_get_type(struct pvr2_ctrl *);
40
41/* Retrieve control's maximum value (int type) */
42int pvr2_ctrl_get_max(struct pvr2_ctrl *);
43
44/* Retrieve control's minimum value (int type) */
45int pvr2_ctrl_get_min(struct pvr2_ctrl *);
46
47/* Retrieve control's default value (any type) */
26dd1c57 48int pvr2_ctrl_get_def(struct pvr2_ctrl *, int *valptr);
d855497e
MI
49
50/* Retrieve control's enumeration count (enum only) */
51int pvr2_ctrl_get_cnt(struct pvr2_ctrl *);
52
53/* Retrieve control's valid mask bits (bit mask only) */
54int pvr2_ctrl_get_mask(struct pvr2_ctrl *);
55
56/* Retrieve the control's name */
57const char *pvr2_ctrl_get_name(struct pvr2_ctrl *);
58
59/* Retrieve the control's desc */
60const char *pvr2_ctrl_get_desc(struct pvr2_ctrl *);
61
62/* Retrieve a control enumeration or bit mask value */
63int pvr2_ctrl_get_valname(struct pvr2_ctrl *,int,char *,unsigned int,
64 unsigned int *);
65
66/* Return true if control is writable */
67int pvr2_ctrl_is_writable(struct pvr2_ctrl *);
68
a761f431
MI
69/* Return V4L flags value for control (or zero if there is no v4l control
70 actually under this control) */
71unsigned int pvr2_ctrl_get_v4lflags(struct pvr2_ctrl *);
72
73/* Return V4L ID for this control or zero if none */
74int pvr2_ctrl_get_v4lid(struct pvr2_ctrl *);
75
d855497e
MI
76/* Return true if control has custom symbolic representation */
77int pvr2_ctrl_has_custom_symbols(struct pvr2_ctrl *);
78
79/* Convert a given mask/val to a custom symbolic value */
80int pvr2_ctrl_custom_value_to_sym(struct pvr2_ctrl *,
81 int mask,int val,
82 char *buf,unsigned int maxlen,
83 unsigned int *len);
84
85/* Convert a symbolic value to a mask/value pair */
86int pvr2_ctrl_custom_sym_to_value(struct pvr2_ctrl *,
87 const char *buf,unsigned int len,
88 int *maskptr,int *valptr);
89
90/* Convert a given mask/val to a symbolic value */
91int pvr2_ctrl_value_to_sym(struct pvr2_ctrl *,
92 int mask,int val,
93 char *buf,unsigned int maxlen,
94 unsigned int *len);
95
96/* Convert a symbolic value to a mask/value pair */
97int pvr2_ctrl_sym_to_value(struct pvr2_ctrl *,
98 const char *buf,unsigned int len,
99 int *maskptr,int *valptr);
100
101/* Convert a given mask/val to a symbolic value - must already be
102 inside of critical region. */
103int pvr2_ctrl_value_to_sym_internal(struct pvr2_ctrl *,
104 int mask,int val,
105 char *buf,unsigned int maxlen,
106 unsigned int *len);
107
108#endif /* __PVRUSB2_CTRL_H */