diff options
Diffstat (limited to 'drivers/media/video/gspca/m5602/m5602_po1030.c')
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_po1030.c | 82 |
1 files changed, 81 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_po1030.c b/drivers/media/video/gspca/m5602/m5602_po1030.c index 716b359e7a9..eaddf488bad 100644 --- a/drivers/media/video/gspca/m5602/m5602_po1030.c +++ b/drivers/media/video/gspca/m5602/m5602_po1030.c | |||
@@ -31,6 +31,86 @@ static struct v4l2_pix_format po1030_modes[] = { | |||
31 | } | 31 | } |
32 | }; | 32 | }; |
33 | 33 | ||
34 | const static struct ctrl po1030_ctrls[] = { | ||
35 | { | ||
36 | { | ||
37 | .id = V4L2_CID_GAIN, | ||
38 | .type = V4L2_CTRL_TYPE_INTEGER, | ||
39 | .name = "gain", | ||
40 | .minimum = 0x00, | ||
41 | .maximum = 0x4f, | ||
42 | .step = 0x1, | ||
43 | .default_value = PO1030_GLOBAL_GAIN_DEFAULT, | ||
44 | .flags = V4L2_CTRL_FLAG_SLIDER | ||
45 | }, | ||
46 | .set = po1030_set_gain, | ||
47 | .get = po1030_get_gain | ||
48 | }, { | ||
49 | { | ||
50 | .id = V4L2_CID_EXPOSURE, | ||
51 | .type = V4L2_CTRL_TYPE_INTEGER, | ||
52 | .name = "exposure", | ||
53 | .minimum = 0x00, | ||
54 | .maximum = 0x02ff, | ||
55 | .step = 0x1, | ||
56 | .default_value = PO1030_EXPOSURE_DEFAULT, | ||
57 | .flags = V4L2_CTRL_FLAG_SLIDER | ||
58 | }, | ||
59 | .set = po1030_set_exposure, | ||
60 | .get = po1030_get_exposure | ||
61 | }, { | ||
62 | { | ||
63 | .id = V4L2_CID_RED_BALANCE, | ||
64 | .type = V4L2_CTRL_TYPE_INTEGER, | ||
65 | .name = "red balance", | ||
66 | .minimum = 0x00, | ||
67 | .maximum = 0xff, | ||
68 | .step = 0x1, | ||
69 | .default_value = PO1030_RED_GAIN_DEFAULT, | ||
70 | .flags = V4L2_CTRL_FLAG_SLIDER | ||
71 | }, | ||
72 | .set = po1030_set_red_balance, | ||
73 | .get = po1030_get_red_balance | ||
74 | }, { | ||
75 | { | ||
76 | .id = V4L2_CID_BLUE_BALANCE, | ||
77 | .type = V4L2_CTRL_TYPE_INTEGER, | ||
78 | .name = "blue balance", | ||
79 | .minimum = 0x00, | ||
80 | .maximum = 0xff, | ||
81 | .step = 0x1, | ||
82 | .default_value = PO1030_BLUE_GAIN_DEFAULT, | ||
83 | .flags = V4L2_CTRL_FLAG_SLIDER | ||
84 | }, | ||
85 | .set = po1030_set_blue_balance, | ||
86 | .get = po1030_get_blue_balance | ||
87 | }, { | ||
88 | { | ||
89 | .id = V4L2_CID_HFLIP, | ||
90 | .type = V4L2_CTRL_TYPE_BOOLEAN, | ||
91 | .name = "horizontal flip", | ||
92 | .minimum = 0, | ||
93 | .maximum = 1, | ||
94 | .step = 1, | ||
95 | .default_value = 0, | ||
96 | }, | ||
97 | .set = po1030_set_hflip, | ||
98 | .get = po1030_get_hflip | ||
99 | }, { | ||
100 | { | ||
101 | .id = V4L2_CID_VFLIP, | ||
102 | .type = V4L2_CTRL_TYPE_BOOLEAN, | ||
103 | .name = "vertical flip", | ||
104 | .minimum = 0, | ||
105 | .maximum = 1, | ||
106 | .step = 1, | ||
107 | .default_value = 0, | ||
108 | }, | ||
109 | .set = po1030_set_vflip, | ||
110 | .get = po1030_get_vflip | ||
111 | } | ||
112 | }; | ||
113 | |||
34 | static void po1030_dump_registers(struct sd *sd); | 114 | static void po1030_dump_registers(struct sd *sd); |
35 | 115 | ||
36 | int po1030_probe(struct sd *sd) | 116 | int po1030_probe(struct sd *sd) |
@@ -74,7 +154,7 @@ int po1030_probe(struct sd *sd) | |||
74 | sensor_found: | 154 | sensor_found: |
75 | sd->gspca_dev.cam.cam_mode = po1030_modes; | 155 | sd->gspca_dev.cam.cam_mode = po1030_modes; |
76 | sd->gspca_dev.cam.nmodes = ARRAY_SIZE(po1030_modes); | 156 | sd->gspca_dev.cam.nmodes = ARRAY_SIZE(po1030_modes); |
77 | sd->desc->ctrls = po1030.ctrls; | 157 | sd->desc->ctrls = po1030_ctrls; |
78 | sd->desc->nctrls = ARRAY_SIZE(po1030_ctrls); | 158 | sd->desc->nctrls = ARRAY_SIZE(po1030_ctrls); |
79 | return 0; | 159 | return 0; |
80 | } | 160 | } |