From patchwork Sun Sep 12 17:45:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Walls X-Patchwork-Id: 173362 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 o8CHjhes026450 for ; Sun, 12 Sep 2010 17:45:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753599Ab0ILRpm (ORCPT ); Sun, 12 Sep 2010 13:45:42 -0400 Received: from proofpoint-cluster.metrocast.net ([65.175.128.136]:29967 "EHLO proofpoint-cluster.metrocast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753581Ab0ILRpl (ORCPT ); Sun, 12 Sep 2010 13:45:41 -0400 Received: from [192.168.1.7] (d-216-36-24-245.cpe.metrocast.net [216.36.24.245]) (authenticated bits=0) by pear.metrocast.net (8.13.8/8.13.8) with ESMTP id o8CHjR12002623; Sun, 12 Sep 2010 17:45:27 GMT Subject: [PATCH v2 3/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: Sun, 12 Sep 2010 13:45:21 -0400 Message-ID: <1284313521.2027.32.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-1009120054 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 17:45:44 +0000 (UTC) diff -r 5e576066eeaf -r 8a9732bd1548 linux/drivers/media/video/gspca/cpia1.c --- a/linux/drivers/media/video/gspca/cpia1.c Sun Sep 12 12:47:00 2010 -0400 +++ b/linux/drivers/media/video/gspca/cpia1.c Sun Sep 12 13:13:33 2010 -0400 @@ -380,6 +380,7 @@ static const struct ctrl sd_ctrls[] = { { +#define BRIGHTNESS_IDX 0 { .id = V4L2_CID_BRIGHTNESS, .type = V4L2_CTRL_TYPE_INTEGER, @@ -394,6 +395,7 @@ .set = sd_setbrightness, .get = sd_getbrightness, }, +#define CONTRAST_IDX 1 { { .id = V4L2_CID_CONTRAST, @@ -408,6 +410,7 @@ .set = sd_setcontrast, .get = sd_getcontrast, }, +#define SATURATION_IDX 2 { { .id = V4L2_CID_SATURATION, @@ -422,6 +425,7 @@ .set = sd_setsaturation, .get = sd_getsaturation, }, +#define POWER_LINE_FREQUENCY_IDX 3 { { .id = V4L2_CID_POWER_LINE_FREQUENCY, @@ -436,6 +440,7 @@ .set = sd_setfreq, .get = sd_getfreq, }, +#define ILLUMINATORS_1_IDX 4 { { .id = V4L2_CID_ILLUMINATORS_1, @@ -450,6 +455,7 @@ .set = sd_setilluminator1, .get = sd_getilluminator1, }, +#define ILLUMINATORS_2_IDX 5 { { .id = V4L2_CID_ILLUMINATORS_2, @@ -464,6 +470,7 @@ .set = sd_setilluminator2, .get = sd_getilluminator2, }, +#define COMP_TARGET_IDX 6 { { #define V4L2_CID_COMP_TARGET V4L2_CID_PRIVATE_BASE @@ -1756,9 +1763,13 @@ if (ret) return ret; - /* Ensure the QX3 illuminators' states are restored upon resume */ + /* Ensure the QX3 illuminators' states are restored upon resume, + or disable the illuminator controls, if this isn't a QX3 */ if (sd->params.qx3.qx3_detected) command_setlights(gspca_dev); + else + gspca_dev->ctrl_dis |= + ((1 << ILLUMINATORS_1_IDX) | (1 << ILLUMINATORS_2_IDX)); sd_stopN(gspca_dev);