diff options
author | Erik Andren <erik.andren@gmail.com> | 2008-12-31 12:33:53 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:42:29 -0400 |
commit | 766231ab859546edd459242c2dbd805bc7fd446e (patch) | |
tree | e37f6e7e8d45ec9ae12bb42ee1d7c0006b840589 /drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c | |
parent | 50e06dee958bdb81229cb42486f7fdc4917fa4da (diff) |
V4L/DVB (10334): gspca - stv06xx: Rework control description.
Signed-off-by: Erik Andren <erik.andren@gmail.com>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c')
-rw-r--r-- | drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c | 76 |
1 files changed, 68 insertions, 8 deletions
diff --git a/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c b/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c index 14335a9e4bb5..b16903814203 100644 --- a/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c +++ b/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c | |||
@@ -30,6 +30,66 @@ | |||
30 | 30 | ||
31 | #include "stv06xx_hdcs.h" | 31 | #include "stv06xx_hdcs.h" |
32 | 32 | ||
33 | static const struct ctrl hdcs1x00_ctrl[] = { | ||
34 | { | ||
35 | { | ||
36 | .id = V4L2_CID_EXPOSURE, | ||
37 | .type = V4L2_CTRL_TYPE_INTEGER, | ||
38 | .name = "exposure", | ||
39 | .minimum = 0x00, | ||
40 | .maximum = 0xffff, | ||
41 | .step = 0x1, | ||
42 | .default_value = HDCS_DEFAULT_EXPOSURE, | ||
43 | .flags = V4L2_CTRL_FLAG_SLIDER | ||
44 | }, | ||
45 | .set = hdcs_set_exposure, | ||
46 | .get = hdcs_get_exposure | ||
47 | }, { | ||
48 | { | ||
49 | .id = V4L2_CID_GAIN, | ||
50 | .type = V4L2_CTRL_TYPE_INTEGER, | ||
51 | .name = "gain", | ||
52 | .minimum = 0x00, | ||
53 | .maximum = 0xff, | ||
54 | .step = 0x1, | ||
55 | .default_value = HDCS_DEFAULT_GAIN, | ||
56 | .flags = V4L2_CTRL_FLAG_SLIDER | ||
57 | }, | ||
58 | .set = hdcs_set_gain, | ||
59 | .get = hdcs_get_gain | ||
60 | } | ||
61 | }; | ||
62 | |||
63 | static struct v4l2_pix_format hdcs1x00_mode[] = { | ||
64 | { | ||
65 | HDCS_1X00_DEF_WIDTH, | ||
66 | HDCS_1X00_DEF_HEIGHT, | ||
67 | V4L2_PIX_FMT_SBGGR8, | ||
68 | V4L2_FIELD_NONE, | ||
69 | .sizeimage = | ||
70 | HDCS_1X00_DEF_WIDTH * HDCS_1X00_DEF_HEIGHT, | ||
71 | .bytesperline = HDCS_1X00_DEF_WIDTH, | ||
72 | .colorspace = V4L2_COLORSPACE_SRGB, | ||
73 | .priv = 1 | ||
74 | } | ||
75 | }; | ||
76 | |||
77 | static const struct ctrl hdcs1020_ctrl[] = {}; | ||
78 | |||
79 | static struct v4l2_pix_format hdcs1020_mode[] = { | ||
80 | { | ||
81 | HDCS_1020_DEF_WIDTH, | ||
82 | HDCS_1020_DEF_HEIGHT, | ||
83 | V4L2_PIX_FMT_SBGGR8, | ||
84 | V4L2_FIELD_NONE, | ||
85 | .sizeimage = | ||
86 | HDCS_1020_DEF_WIDTH * HDCS_1020_DEF_HEIGHT, | ||
87 | .bytesperline = HDCS_1020_DEF_WIDTH, | ||
88 | .colorspace = V4L2_COLORSPACE_SRGB, | ||
89 | .priv = 1 | ||
90 | } | ||
91 | }; | ||
92 | |||
33 | enum hdcs_power_state { | 93 | enum hdcs_power_state { |
34 | HDCS_STATE_SLEEP, | 94 | HDCS_STATE_SLEEP, |
35 | HDCS_STATE_IDLE, | 95 | HDCS_STATE_IDLE, |
@@ -353,10 +413,10 @@ static int hdcs_probe_1x00(struct sd *sd) | |||
353 | 413 | ||
354 | info("HDCS-1000/1100 sensor detected"); | 414 | info("HDCS-1000/1100 sensor detected"); |
355 | 415 | ||
356 | sd->gspca_dev.cam.cam_mode = stv06xx_sensor_hdcs1x00.modes; | 416 | sd->gspca_dev.cam.cam_mode = hdcs1x00_mode; |
357 | sd->gspca_dev.cam.nmodes = stv06xx_sensor_hdcs1x00.nmodes; | 417 | sd->gspca_dev.cam.nmodes = ARRAY_SIZE(hdcs1x00_mode); |
358 | sd->desc.ctrls = stv06xx_sensor_hdcs1x00.ctrls; | 418 | sd->desc.ctrls = hdcs1x00_ctrl; |
359 | sd->desc.nctrls = stv06xx_sensor_hdcs1x00.nctrls; | 419 | sd->desc.nctrls = ARRAY_SIZE(hdcs1x00_ctrl); |
360 | 420 | ||
361 | hdcs = kmalloc(sizeof(struct hdcs), GFP_KERNEL); | 421 | hdcs = kmalloc(sizeof(struct hdcs), GFP_KERNEL); |
362 | if (!hdcs) | 422 | if (!hdcs) |
@@ -412,10 +472,10 @@ static int hdcs_probe_1020(struct sd *sd) | |||
412 | 472 | ||
413 | info("HDCS-1020 sensor detected"); | 473 | info("HDCS-1020 sensor detected"); |
414 | 474 | ||
415 | sd->gspca_dev.cam.cam_mode = stv06xx_sensor_hdcs1020.modes; | 475 | sd->gspca_dev.cam.cam_mode = hdcs1020_mode; |
416 | sd->gspca_dev.cam.nmodes = stv06xx_sensor_hdcs1020.nmodes; | 476 | sd->gspca_dev.cam.nmodes = ARRAY_SIZE(hdcs1020_mode); |
417 | sd->desc.ctrls = stv06xx_sensor_hdcs1020.ctrls; | 477 | sd->desc.ctrls = hdcs1020_ctrl; |
418 | sd->desc.nctrls = stv06xx_sensor_hdcs1020.nctrls; | 478 | sd->desc.nctrls = ARRAY_SIZE(hdcs1020_ctrl); |
419 | 479 | ||
420 | hdcs = kmalloc(sizeof(struct hdcs), GFP_KERNEL); | 480 | hdcs = kmalloc(sizeof(struct hdcs), GFP_KERNEL); |
421 | if (!hdcs) | 481 | if (!hdcs) |