From: Andy Walls <awalls@md.metrocast.net>
To: linux-media@vger.kernel.org
Cc: Hans de Goede <hdegoede@redhat.com>,
Jean-Francois Moine <moinejf@free.fr>
Subject: [PATCH 2/3] gspca_cpia1: Disable illuminator controls if not an Intel Play QX3
Date: Sat, 11 Sep 2010 21:51:16 -0400 [thread overview]
Message-ID: <1284256276.2030.19.camel@morgan.silverblock.net> (raw)
gspca_cpia1: Disable illuminator controls if not an Intel Play QX3
The illuminator controls should only be available to the user for the Intel
Play QX3 microscope.
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
diff -r d165649ca8a0 -r 32d5c323c541 linux/drivers/media/video/gspca/cpia1.c
--- a/linux/drivers/media/video/gspca/cpia1.c Sat Sep 11 14:15:26 2010 -0400
+++ b/linux/drivers/media/video/gspca/cpia1.c Sat Sep 11 21:15:03 2010 -0400
@@ -1743,6 +1743,22 @@
do_command(gspca_dev, CPIA_COMMAND_GetCameraStatus, 0, 0, 0, 0);
}
+static void sd_disable_qx3_ctrls(struct gspca_dev *gspca_dev)
+{
+ int i, n;
+ __u32 id;
+
+ n = ARRAY_SIZE(sd_ctrls);
+ for (i = 0; i < n; i++) {
+ id = sd_ctrls[i].qctrl.id;
+
+ if (id == V4L2_CID_ILLUMINATORS_1 ||
+ id == V4L2_CID_ILLUMINATORS_2) {
+ gspca_dev->ctrl_dis |= (1 << i);
+ }
+ }
+}
+
/* this function is called at probe and resume time */
static int sd_init(struct gspca_dev *gspca_dev)
{
@@ -1758,6 +1774,9 @@
sd_stopN(gspca_dev);
+ if (!sd->params.qx3.qx3_detected)
+ sd_disable_qx3_ctrls(gspca_dev);
+
PDEBUG(D_PROBE, "CPIA Version: %d.%02d (%d.%d)",
sd->params.version.firmwareVersion,
sd->params.version.firmwareRevision,
next reply other threads:[~2010-09-12 1:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-12 1:51 Andy Walls [this message]
2010-09-12 7:26 ` [PATCH 2/3] gspca_cpia1: Disable illuminator controls if not an Intel Play QX3 Hans de Goede
2010-09-12 7:39 ` Hans Verkuil
-- strict thread matches above, loose matches on Subject: below --
2010-09-12 11:54 Andy Walls
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1284256276.2030.19.camel@morgan.silverblock.net \
--to=awalls@md.metrocast.net \
--cc=hdegoede@redhat.com \
--cc=linux-media@vger.kernel.org \
--cc=moinejf@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox