From patchwork Wed Apr 6 14:01:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Teresa_G=C3=A1mez?= X-Patchwork-Id: 689891 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 p36E6Dv8004576 for ; Wed, 6 Apr 2011 14:06:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756073Ab1DFOGK (ORCPT ); Wed, 6 Apr 2011 10:06:10 -0400 Received: from mail.visioncatalog.de ([217.6.246.34]:45627 "EHLO root.phytec.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755952Ab1DFOGJ convert rfc822-to-8bit (ORCPT ); Wed, 6 Apr 2011 10:06:09 -0400 Received: from idefix.phytec.de (idefix.phytec.de [172.16.0.10]) by root.phytec.de (Postfix) with ESMTP id CB076BF08A for ; Wed, 6 Apr 2011 16:08:06 +0200 (CEST) Received: from numalfix.phytec.de ([127.0.0.1]) by idefix.phytec.de (Lotus Domino Release 8.5.2 HF194) with ESMTP id 2011040616060767-149888 ; Wed, 6 Apr 2011 16:06:07 +0200 Received: by numalfix.phytec.de (Postfix, from userid 1010) id CCB071A17E5; Wed, 6 Apr 2011 16:02:12 +0200 (CEST) From: =?UTF-8?q?Teresa=20G=C3=A1mez?= To: linux-media@vger.kernel.org Cc: =?UTF-8?q?Teresa=20G=C3=A1mez?= Subject: [PATCH 2/2] mt9m111: fix pixel clock Date: Wed, 6 Apr 2011 16:01:55 +0200 Message-Id: <1302098515-12176-2-git-send-email-t.gamez@phytec.de> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1302098515-12176-1-git-send-email-t.gamez@phytec.de> References: <1302098515-12176-1-git-send-email-t.gamez@phytec.de> MIME-Version: 1.0 X-MIMETrack: Itemize by SMTP Server on Idefix/Phytec(Release 8.5.2 HF194|November 09, 2010) at 06.04.2011 16:06:07, Serialize by Router on Idefix/Phytec(Release 8.5.2 HF194|November 09, 2010) at 06.04.2011 16:06:08, Serialize complete at 06.04.2011 16:06:08 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.6 (demeter1.kernel.org [140.211.167.41]); Wed, 06 Apr 2011 14:06:13 +0000 (UTC) This camera driver supports only rising edge, which is the default setting of the device. The function mt9m111_setup_pixfmt() overwrites this setting. So the driver actually uses falling edge. This patch corrects that. Signed-off-by: Teresa Gámez --- drivers/media/video/mt9m111.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/media/video/mt9m111.c b/drivers/media/video/mt9m111.c index 53fa2a7..4040a96 100644 --- a/drivers/media/video/mt9m111.c +++ b/drivers/media/video/mt9m111.c @@ -315,10 +315,20 @@ static int mt9m111_setup_rect(struct i2c_client *client, static int mt9m111_setup_pixfmt(struct i2c_client *client, u16 outfmt) { int ret; + u16 mask = MT9M111_OUTFMT_PROCESSED_BAYER | MT9M111_OUTFMT_RGB | + MT9M111_OUTFMT_BYPASS_IFP | MT9M111_OUTFMT_SWAP_RGB_EVEN | + MT9M111_OUTFMT_RGB565 | MT9M111_OUTFMT_RGB555 | + MT9M111_OUTFMT_SWAP_YCbCr_Cb_Cr | + MT9M111_OUTFMT_SWAP_YCbCr_C_Y; - ret = reg_write(OUTPUT_FORMAT_CTRL2_A, outfmt); + ret = reg_clear(OUTPUT_FORMAT_CTRL2_A, mask); if (!ret) - ret = reg_write(OUTPUT_FORMAT_CTRL2_B, outfmt); + ret = reg_set(OUTPUT_FORMAT_CTRL2_A, outfmt); + if (!ret) + ret = reg_clear(OUTPUT_FORMAT_CTRL2_B, mask); + if (!ret) + ret = reg_set(OUTPUT_FORMAT_CTRL2_B, outfmt); + return ret; }