From patchwork Thu Sep 27 15:38:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martin X-Patchwork-Id: 14700 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1THGAx-0007R8-6D for patchwork@linuxtv.org; Thu, 27 Sep 2012 17:38:55 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-2) with esmtp for id 1THGAw-0004dS-I5; Thu, 27 Sep 2012 17:38:55 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755514Ab2I0Piw (ORCPT ); Thu, 27 Sep 2012 11:38:52 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:48302 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755182Ab2I0Pir (ORCPT ); Thu, 27 Sep 2012 11:38:47 -0400 Received: by mail-wg0-f44.google.com with SMTP id dr13so1519190wgb.1 for ; Thu, 27 Sep 2012 08:38:47 -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=535MT0lUsn/Ao5GZFu8Pfn3FN3rIEWbAaGd3pVYyn2c=; b=PtQwWtNOuL8VjcqKhyD19CKV6dqpVCJxgUQST7nVqieu+lzU0DTU3rw8z+jEWd0b0H ljhhpoYaJoM3FER1AUqdtIvMBxX54AsveqluT69wDIAq9aqpEHF2gI8pGn0/Wi+sBkSt F2dVKx2FsapXBwrdAR27VkHfuEcCyUSqbyRf5A6Nqek6u629cGgzChwX+qymu+eBAJ2Z X5JF625fg0CLCMzEAubdib201xwG+EAvQYh/2+6IbX0i9RxbOtdAxCA4V4+AbBFHWwLH JsQ3c5C6iKkopQGjZqAnuH7XCQJyjqdFCjGy35uRzG1pv4mFCOTvKDUzlOwRS/r20FER rfaA== Received: by 10.216.85.212 with SMTP id u62mr1732800wee.185.1348760326825; Thu, 27 Sep 2012 08:38:46 -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 eu4sm31740434wib.2.2012.09.27.08.38.44 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 08:38:46 -0700 (PDT) From: Javier Martin To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, hverkuil@xs4all.nl, rusty@rustcorp.com.au, dsd@laptop.org, mchehab@infradead.org, corbet@lwn.net, hdegoede@redhat.com, Javier Martin Subject: [PATCH v2 5/5] media: ov7670: Add possibility to disable pixclk during hblank. Date: Thu, 27 Sep 2012 17:38:25 +0200 Message-Id: <1348760305-7481-6-git-send-email-javier.martin@vista-silicon.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1348760305-7481-1-git-send-email-javier.martin@vista-silicon.com> References: <1348760305-7481-1-git-send-email-javier.martin@vista-silicon.com> X-Gm-Message-State: ALoCoQkW6YyRE5AaIyuoGeY0MpFQ2Wvp0QwE+VagbG3CuVcoVMMKIYqF0Hvuxo3EpyPzejgav7G1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.9.27.153028 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_POSSIBLE_EXPLOIT_SUBJ 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' Some bridge drivers captures pixels during blanking periods if pixclk is enabled. In order to avoid capturing bogus data we need to disable pixclk in the sensor during those blanking periods. Acked-by: Jonathan Corbet Signed-off-by: Javier Martin --- Changes since v1: - Added changelog. --- drivers/media/i2c/ov7670.c | 7 +++++++ include/media/ov7670.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c index 559c23e..9d7a92e 100644 --- a/drivers/media/i2c/ov7670.c +++ b/drivers/media/i2c/ov7670.c @@ -231,6 +231,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; const struct ov7670_devtype *devtype; /* Device specifics */ }; @@ -1712,6 +1713,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 */ @@ -1736,6 +1740,9 @@ static int ov7670_probe(struct i2c_client *client, tpf.denominator = 30; info->devtype->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