diff options
author | Jean-François Moine <moinejf@free.fr> | 2010-10-02 09:12:25 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-21 05:18:27 +0200 |
commit | 6a33091f13d840a2ba020605180a3e591be5c2cd (patch) | |
tree | d3df80f90749b57ff5f514baf6748c3842fd0c52 /drivers/media/video/gspca/gspca.h | |
parent | [media] uvcvideo: Fix uvc_query_v4l2_ctrl() and uvc_xu_ctrl_query() locking (diff) | |
download | linux-6a33091f13d840a2ba020605180a3e591be5c2cd.tar.xz linux-6a33091f13d840a2ba020605180a3e591be5c2cd.zip |
[media] gspca - main: New video control mechanism
The new control mechanism uses dynamic control values in the subdriver
descriptor. It simplifies standard control handling.
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/gspca.h')
-rw-r--r-- | drivers/media/video/gspca/gspca.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/gspca.h b/drivers/media/video/gspca/gspca.h index b749c36d9f7e..d4d210b56b49 100644 --- a/drivers/media/video/gspca/gspca.h +++ b/drivers/media/video/gspca/gspca.h @@ -52,11 +52,20 @@ struct framerates { int nrates; }; +/* control definition */ +struct gspca_ctrl { + s16 val; /* current value */ + s16 def; /* default value */ + s16 min, max; /* minimum and maximum values */ +}; + /* device information - set at probe time */ struct cam { const struct v4l2_pix_format *cam_mode; /* size nmodes */ const struct framerates *mode_framerates; /* must have size nmode, * just like cam_mode */ + struct gspca_ctrl *ctrls; /* control table - size nctrls */ + /* may be NULL */ u32 bulk_size; /* buffer size when image transfer by bulk */ u32 input_flags; /* value for ENUM_INPUT status flags */ u8 nmodes; /* size of cam_mode */ @@ -99,6 +108,7 @@ struct ctrl { struct v4l2_queryctrl qctrl; int (*set)(struct gspca_dev *, __s32); int (*get)(struct gspca_dev *, __s32 *); + cam_v_op set_control; }; /* subdriver description */ @@ -106,7 +116,7 @@ struct sd_desc { /* information */ const char *name; /* sub-driver name */ /* controls */ - const struct ctrl *ctrls; + const struct ctrl *ctrls; /* static control definition */ int nctrls; /* mandatory operations */ cam_cf_op config; /* called on probe */ |