From patchwork Sun Oct 17 11:08:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TsODwqltZXRoIE3Dg8KhcnRvbg==?= X-Patchwork-Id: 260021 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 o9HBiFR9001138 for ; Sun, 17 Oct 2010 11:44:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751472Ab0JQLoN (ORCPT ); Sun, 17 Oct 2010 07:44:13 -0400 Received: from relay02.digicable.hu ([92.249.128.188]:56117 "EHLO relay02.digicable.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750858Ab0JQLoN (ORCPT ); Sun, 17 Oct 2010 07:44:13 -0400 Received: from [94.21.49.156] by relay02.digicable.hu with esmtpa id 1P7R5v-0001eO-Ur ; Sun, 17 Oct 2010 13:08:04 +0200 Message-ID: <4CBAD911.9070800@freemail.hu> Date: Sun, 17 Oct 2010 13:08:01 +0200 From: =?UTF-8?B?TsOpbWV0aCBNw6FydG9u?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; hu-HU; rv:1.8.1.21) Gecko/20090402 SeaMonkey/1.1.16 MIME-Version: 1.0 To: Jean-Francois Moine CC: V4L Mailing List Subject: [PATCH 1/2] gspca_sonixj: add hardware vertical flip support for hama AC-150 X-Original: 94.21.49.156 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, 17 Oct 2010 11:44:16 +0000 (UTC) diff -upr b/drivers/media/video/gspca/sonixj.c c/drivers/media/video/gspca/sonixj.c --- b/drivers/media/video/gspca/sonixj.c 2010-10-17 11:22:33.000000000 +0200 +++ c/drivers/media/video/gspca/sonixj.c 2010-10-17 12:08:12.000000000 +0200 @@ -45,7 +45,7 @@ struct sd { u8 blue; u8 red; u8 gamma; - u8 vflip; /* ov7630/ov7648 only */ + u8 vflip; /* ov7630/ov7648/po2030n only */ u8 sharpness; u8 infrared; /* mt9v111 only */ u8 freq; /* ov76xx only */ @@ -219,7 +219,7 @@ static const struct ctrl sd_ctrls[] = { .set = sd_setautogain, .get = sd_getautogain, }, -/* ov7630/ov7648 only */ +/* ov7630/ov7648/po2030n only */ #define VFLIP_IDX 7 { { @@ -328,7 +328,6 @@ static const __u32 ctrl_dis[] = { [SENSOR_PO2030N] = (1 << AUTOGAIN_IDX) | (1 << INFRARED_IDX) | - (1 << VFLIP_IDX) | (1 << FREQ_IDX), [SENSOR_SOI768] = (1 << AUTOGAIN_IDX) | (1 << INFRARED_IDX) | @@ -2136,7 +2135,7 @@ static void setautogain(struct gspca_dev sd->ag_cnt = -1; } -/* hv7131r/ov7630/ov7648 only */ +/* hv7131r/ov7630/ov7648/po2030n only */ static void setvflip(struct sd *sd) { u8 comn; @@ -2156,6 +2155,20 @@ static void setvflip(struct sd *sd) comn |= 0x80; i2c_w1(&sd->gspca_dev, 0x75, comn); break; + case SENSOR_PO2030N: + /* Reg. 0x1E: Timing Generator Control Register 2 (Tgcontrol2) + * (reset value: 0x0A) + * bit7: HM: Horizontal Mirror: 0: disable, 1: enable + * bit6: VM: Vertical Mirror: 0: disable, 1: enable + * bit5: ST: Shutter Selection: 0: electrical, 1: mechanical + * bit4: FT: Single Frame Transfer: 0: disable, 1: enable + * bit3-0: X + */ + comn = 0x0A; + if (sd->vflip) + comn |= 0x40; + i2c_w1(&sd->gspca_dev, 0x1E, comn); + break; default: /* case SENSOR_OV7648: */ comn = 0x06;