From patchwork Wed Sep 26 09:47:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martin X-Patchwork-Id: 1508751 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 6DBBDDF238 for ; Wed, 26 Sep 2012 09:48:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754445Ab2IZJsX (ORCPT ); Wed, 26 Sep 2012 05:48:23 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:53226 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754306Ab2IZJsV (ORCPT ); Wed, 26 Sep 2012 05:48:21 -0400 Received: by mail-wg0-f44.google.com with SMTP id dr13so357301wgb.1 for ; Wed, 26 Sep 2012 02:48:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=+s442azVv3RAWrw7VOk6ON9+v0ZkgPN7fo5m7KSeJOo=; b=ZOL1crwRGydEUXYjHJufwZcxD1TYT2s5ISTIgCNRYVsXwcWupsNdFJDhPigBZHPRzC PnHR9Y9kDQITBTUL+sgyTuzxKu255QrTnYHHcqRNeMmI2u2LmPnHN2AAA2qdliDkru9E MMxOsmdJkzcGUz/L1bS2MD+OoJZEfQSQ1WLZ3Ct9Ln8t0c31VCA4xTDpl9YU/y1SdKRk p82pI+6xeq4Jz0Q0YJk/pxbizqVR17Ci5nnqQulGg7bsX1Rw7yMMlhoWLeeY4jUOVcRb JSfSYjASCqyBGkm6OZ1hnDnJ20nSgfAt4NpDFcaC8jFEdpP6o6WmqMm3XSkeoOsI+Yzq LEzw== Received: by 10.180.8.41 with SMTP id o9mr129664wia.3.1348652900363; Wed, 26 Sep 2012 02:48:20 -0700 (PDT) Received: from piscis.vsilicon.net (122.251.106.212.dynamic.jazztel.es. [212.106.251.122]) by mx.google.com with ESMTPS id bn7sm5826230wib.8.2012.09.26.02.48.19 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 26 Sep 2012 02:48:19 -0700 (PDT) From: Javier Martin To: linux-media@vger.kernel.org Cc: corbet@lwn.net, mchehab@infradead.org, hverkuil@xs4all.nl, Javier Martin Subject: [PATCH 5/5] media: ov7670: Add possibility to disable pixclk during hblank. Date: Wed, 26 Sep 2012 11:47:57 +0200 Message-Id: <1348652877-25816-6-git-send-email-javier.martin@vista-silicon.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1348652877-25816-1-git-send-email-javier.martin@vista-silicon.com> References: <1348652877-25816-1-git-send-email-javier.martin@vista-silicon.com> X-Gm-Message-State: ALoCoQmylMBWRAe140marWZkjR4ofqH6MCtC0fA2LVm4AHp6/LkGstzjap4OY8BQIcu3wenUHMrJ Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Signed-off-by: Javier Martin Acked-by: Jonathan Corbet --- drivers/media/i2c/ov7670.c | 8 ++++++++ include/media/ov7670.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c index 54fb535..f7e4341 100644 --- a/drivers/media/i2c/ov7670.c +++ b/drivers/media/i2c/ov7670.c @@ -211,6 +211,7 @@ struct ov7670_info { u8 clkrc; /* Clock divider value */ bool use_smbus; /* Use smbus I/O instead of I2C */ bool pll_bypass; + bool pclk_hb_disable; enum ov7670_model model; }; @@ -1709,6 +1710,9 @@ static int ov7670_probe(struct i2c_client *client, if (config->pll_bypass && id->driver_data != MODEL_OV7670) info->pll_bypass = true; + + if (config->pclk_hb_disable) + info->pclk_hb_disable = true; } /* Make sure it's an ov7670 */ @@ -1735,6 +1739,10 @@ static int ov7670_probe(struct i2c_client *client, tpf.denominator = 30; ov7670_set_framerate(sd, &tpf); } + + if (info->pclk_hb_disable) + ov7670_write(sd, REG_COM10, COM10_PCLK_HB); + return 0; } diff --git a/include/media/ov7670.h b/include/media/ov7670.h index a68c8bb..1913d51 100644 --- a/include/media/ov7670.h +++ b/include/media/ov7670.h @@ -16,6 +16,7 @@ struct ov7670_config { int clock_speed; /* External clock speed (MHz) */ bool use_smbus; /* Use smbus I/O instead of I2C */ bool pll_bypass; /* Choose whether to bypass the PLL */ + bool pclk_hb_disable; /* Disable toggling pixclk during horizontal blanking */ }; #endif