From patchwork Sun Sep 12 01:51:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Walls X-Patchwork-Id: 172752 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8C1pkmo026380 for ; Sun, 12 Sep 2010 01:51:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753451Ab0ILBvj (ORCPT ); Sat, 11 Sep 2010 21:51:39 -0400 Received: from proofpoint-cluster.metrocast.net ([65.175.128.136]:41438 "EHLO proofpoint-cluster.metrocast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753420Ab0ILBvb (ORCPT ); Sat, 11 Sep 2010 21:51:31 -0400 Received: from [192.168.1.7] (d-216-36-24-245.cpe.metrocast.net [216.36.24.245]) (authenticated bits=0) by mango.metrocast.net (8.13.8/8.13.8) with ESMTP id o8C1pIbn013831; Sun, 12 Sep 2010 01:51:18 GMT Subject: [PATCH 2/3] gspca_cpia1: Disable illuminator controls if not an Intel Play QX3 From: Andy Walls To: linux-media@vger.kernel.org Cc: Hans de Goede , Jean-Francois Moine Date: Sat, 11 Sep 2010 21:51:16 -0400 Message-ID: <1284256276.2030.19.camel@morgan.silverblock.net> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 (2.28.3-1.fc12) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.0.10011, 1.0.148, 0.0.0000 definitions=2010-09-11_07:2010-09-10, 2010-09-11, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-1005130000 definitions=main-1009110140 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 12 Sep 2010 01:51:46 +0000 (UTC) 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,