aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/indycam.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/indycam.h')
-rw-r--r--drivers/media/video/indycam.h88
1 files changed, 42 insertions, 46 deletions
diff --git a/drivers/media/video/indycam.h b/drivers/media/video/indycam.h
index d9ddb6b79a03..e6ee82063ed8 100644
--- a/drivers/media/video/indycam.h
+++ b/drivers/media/video/indycam.h
@@ -22,21 +22,21 @@
22#define INDYCAM_VERSION_MINOR(x) ((x) & 0x0f) 22#define INDYCAM_VERSION_MINOR(x) ((x) & 0x0f)
23 23
24/* Register bus addresses */ 24/* Register bus addresses */
25#define INDYCAM_CONTROL 0x00 25#define INDYCAM_REG_CONTROL 0x00
26#define INDYCAM_SHUTTER 0x01 26#define INDYCAM_REG_SHUTTER 0x01
27#define INDYCAM_GAIN 0x02 27#define INDYCAM_REG_GAIN 0x02
28#define INDYCAM_BRIGHTNESS 0x03 /* read-only */ 28#define INDYCAM_REG_BRIGHTNESS 0x03 /* read-only */
29#define INDYCAM_RED_BALANCE 0x04 29#define INDYCAM_REG_RED_BALANCE 0x04
30#define INDYCAM_BLUE_BALANCE 0x05 30#define INDYCAM_REG_BLUE_BALANCE 0x05
31#define INDYCAM_RED_SATURATION 0x06 31#define INDYCAM_REG_RED_SATURATION 0x06
32#define INDYCAM_BLUE_SATURATION 0x07 32#define INDYCAM_REG_BLUE_SATURATION 0x07
33#define INDYCAM_GAMMA 0x08 33#define INDYCAM_REG_GAMMA 0x08
34#define INDYCAM_VERSION 0x0e /* read-only */ 34#define INDYCAM_REG_VERSION 0x0e /* read-only */
35#define INDYCAM_RESET 0x0f /* write-only */ 35#define INDYCAM_REG_RESET 0x0f /* write-only */
36 36
37#define INDYCAM_LED 0x46 37#define INDYCAM_REG_LED 0x46
38#define INDYCAM_ORIENTATION 0x47 38#define INDYCAM_REG_ORIENTATION 0x47
39#define INDYCAM_BUTTON 0x48 39#define INDYCAM_REG_BUTTON 0x48
40 40
41/* Field definitions of registers */ 41/* Field definitions of registers */
42#define INDYCAM_CONTROL_AGCENA (1<<0) /* automatic gain control */ 42#define INDYCAM_CONTROL_AGCENA (1<<0) /* automatic gain control */
@@ -59,13 +59,14 @@
59#define INDYCAM_ORIENTATION_BOTTOM_TO_TOP 0x40 59#define INDYCAM_ORIENTATION_BOTTOM_TO_TOP 0x40
60#define INDYCAM_BUTTON_RELEASED 0x10 60#define INDYCAM_BUTTON_RELEASED 0x10
61 61
62/* Values for controls */
62#define INDYCAM_SHUTTER_MIN 0x00 63#define INDYCAM_SHUTTER_MIN 0x00
63#define INDYCAM_SHUTTER_MAX 0xff 64#define INDYCAM_SHUTTER_MAX 0xff
64#define INDYCAM_GAIN_MIN 0x00 65#define INDYCAM_GAIN_MIN 0x00
65#define INDYCAM_GAIN_MAX 0xff 66#define INDYCAM_GAIN_MAX 0xff
66#define INDYCAM_RED_BALANCE_MIN 0x00 /* the effect is the opposite? */ 67#define INDYCAM_RED_BALANCE_MIN 0x00
67#define INDYCAM_RED_BALANCE_MAX 0xff 68#define INDYCAM_RED_BALANCE_MAX 0xff
68#define INDYCAM_BLUE_BALANCE_MIN 0x00 /* the effect is the opposite? */ 69#define INDYCAM_BLUE_BALANCE_MIN 0x00
69#define INDYCAM_BLUE_BALANCE_MAX 0xff 70#define INDYCAM_BLUE_BALANCE_MAX 0xff
70#define INDYCAM_RED_SATURATION_MIN 0x00 71#define INDYCAM_RED_SATURATION_MIN 0x00
71#define INDYCAM_RED_SATURATION_MAX 0xff 72#define INDYCAM_RED_SATURATION_MAX 0xff
@@ -74,34 +75,9 @@
74#define INDYCAM_GAMMA_MIN 0x00 75#define INDYCAM_GAMMA_MIN 0x00
75#define INDYCAM_GAMMA_MAX 0xff 76#define INDYCAM_GAMMA_MAX 0xff
76 77
77/* Driver interface definitions */ 78#define INDYCAM_AGC_DEFAULT 1
78 79#define INDYCAM_AWB_DEFAULT 0
79#define INDYCAM_VALUE_ENABLED 1 80#define INDYCAM_SHUTTER_DEFAULT 0xff
80#define INDYCAM_VALUE_DISABLED 0
81#define INDYCAM_VALUE_UNCHANGED -1
82
83/* When setting controls, a value of -1 leaves the control unchanged. */
84struct indycam_control {
85 int agc; /* boolean */
86 int awb; /* boolean */
87 int shutter;
88 int gain;
89 int red_balance;
90 int blue_balance;
91 int red_saturation;
92 int blue_saturation;
93 int gamma;
94};
95
96#define DECODER_INDYCAM_GET_CONTROLS _IOR('d', 193, struct indycam_control)
97#define DECODER_INDYCAM_SET_CONTROLS _IOW('d', 194, struct indycam_control)
98
99/* Default values for controls */
100
101#define INDYCAM_AGC_DEFAULT INDYCAM_VALUE_ENABLED
102#define INDYCAM_AWB_DEFAULT INDYCAM_VALUE_ENABLED
103
104#define INDYCAM_SHUTTER_DEFAULT INDYCAM_SHUTTER_60
105#define INDYCAM_GAIN_DEFAULT 0x80 81#define INDYCAM_GAIN_DEFAULT 0x80
106#define INDYCAM_RED_BALANCE_DEFAULT 0x18 82#define INDYCAM_RED_BALANCE_DEFAULT 0x18
107#define INDYCAM_BLUE_BALANCE_DEFAULT 0xa4 83#define INDYCAM_BLUE_BALANCE_DEFAULT 0xa4
@@ -109,4 +85,24 @@ struct indycam_control {
109#define INDYCAM_BLUE_SATURATION_DEFAULT 0xc0 85#define INDYCAM_BLUE_SATURATION_DEFAULT 0xc0
110#define INDYCAM_GAMMA_DEFAULT 0x80 86#define INDYCAM_GAMMA_DEFAULT 0x80
111 87
88/* Driver interface definitions */
89
90#define INDYCAM_CONTROL_AGC 0 /* boolean */
91#define INDYCAM_CONTROL_AWB 1 /* boolean */
92#define INDYCAM_CONTROL_SHUTTER 2
93#define INDYCAM_CONTROL_GAIN 3
94#define INDYCAM_CONTROL_RED_BALANCE 4
95#define INDYCAM_CONTROL_BLUE_BALANCE 5
96#define INDYCAM_CONTROL_RED_SATURATION 6
97#define INDYCAM_CONTROL_BLUE_SATURATION 7
98#define INDYCAM_CONTROL_GAMMA 8
99
100struct indycam_control {
101 u8 type;
102 s32 value;
103};
104
105#define DECODER_INDYCAM_GET_CONTROL _IOR('d', 193, struct indycam_control)
106#define DECODER_INDYCAM_SET_CONTROL _IOW('d', 194, struct indycam_control)
107
112#endif 108#endif