From patchwork Wed Nov 18 16:55:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 7651031 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0D4849F731 for ; Wed, 18 Nov 2015 16:55:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 69B0720303 for ; Wed, 18 Nov 2015 16:55:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8072E205F7 for ; Wed, 18 Nov 2015 16:55:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933235AbbKRQzd (ORCPT ); Wed, 18 Nov 2015 11:55:33 -0500 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:33249 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933222AbbKRQza (ORCPT ); Wed, 18 Nov 2015 11:55:30 -0500 Received: from dude.hi.4.pengutronix.de ([10.1.0.7] helo=dude.pengutronix.de.) by metis.ext.pengutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1Zz612-0007Sk-Pv; Wed, 18 Nov 2015 17:55:28 +0100 From: Lucas Stach To: Mauro Carvalho Chehab , linux-media@vger.kernel.org Cc: kernel@pengutronix.de, patchwork-lst@pengutronix.de Subject: [PATCH 7/9] [media] tvp5150: remove pin configuration from initialization tables Date: Wed, 18 Nov 2015 17:55:26 +0100 Message-Id: <1447865728-5726-7-git-send-email-l.stach@pengutronix.de> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1447865728-5726-1-git-send-email-l.stach@pengutronix.de> References: <1447865728-5726-1-git-send-email-l.stach@pengutronix.de> X-SA-Exim-Connect-IP: 10.1.0.7 X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Philipp Zabel To allow optional interrupt support, we want to configure the pin settings dynamically. Move those register accesses out of the static initialization tables. Signed-off-by: Philipp Zabel Signed-off-by: Lucas Stach --- drivers/media/i2c/tvp5150.c | 19 +++++++------------ drivers/media/i2c/tvp5150_reg.h | 1 + 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c index 791572737ee3..abea26eb6fe0 100644 --- a/drivers/media/i2c/tvp5150.c +++ b/drivers/media/i2c/tvp5150.c @@ -323,9 +323,6 @@ static const struct i2c_reg_value tvp5150_init_default[] = { { /* 0x0e */ TVP5150_LUMA_PROC_CTL_3,0x00 }, - { /* 0x0f */ - TVP5150_CONF_SHARED_PIN,0x08 - }, { /* 0x11 */ TVP5150_ACT_VD_CROP_ST_MSB,0x00 }, @@ -362,9 +359,6 @@ static const struct i2c_reg_value tvp5150_init_default[] = { { /* 0x1d */ TVP5150_INT_ENABLE_REG_B,0x00 }, - { /* 0x1e */ - TVP5150_INTT_CONFIG_REG_B,0x00 - }, { /* 0x28 */ TVP5150_VIDEO_STD,0x00 }, @@ -383,9 +377,6 @@ static const struct i2c_reg_value tvp5150_init_default[] = { { /* 0xc1 */ TVP5150_INT_ENABLE_REG_A,0x00 }, - { /* 0xc2 */ - TVP5150_INT_CONF,0x04 - }, { /* 0xc8 */ TVP5150_FIFO_INT_THRESHOLD,0x80 }, @@ -420,9 +411,7 @@ static const struct i2c_reg_value tvp5150_init_default[] = { /* Default values as sugested at TVP5150AM1 datasheet */ static const struct i2c_reg_value tvp5150_init_enable[] = { - { - TVP5150_CONF_SHARED_PIN, 2 - },{ /* Automatic offset and AGC enabled */ + { /* Automatic offset and AGC enabled */ TVP5150_ANAL_CHL_CTL, 0x15 },{ /* Activate YCrCb output 0x9 or 0xd ? */ TVP5150_MISC_CTL, 0x6f @@ -772,6 +761,12 @@ static int tvp5150_reset(struct v4l2_subdev *sd, u32 val) /* Initializes TVP5150 to its default values */ tvp5150_write_inittab(sd, tvp5150_init_default); + /* Configure pins: FID, VSYNC, GPCL/VBLK, SCLK */ + regmap_write(map, TVP5150_CONF_SHARED_PIN, 0x2); + /* Keep interrupt polarity active low */ + regmap_write(map, TVP5150_INT_CONF, TVP5150_VDPOE); + regmap_write(map, TVP5150_INTT_CONFIG_REG_B, 0x0); + /* Initializes VDP registers */ tvp5150_vdp_init(sd, vbi_ram_default); diff --git a/drivers/media/i2c/tvp5150_reg.h b/drivers/media/i2c/tvp5150_reg.h index 25a994944918..fc3bcb26413a 100644 --- a/drivers/media/i2c/tvp5150_reg.h +++ b/drivers/media/i2c/tvp5150_reg.h @@ -117,6 +117,7 @@ #define TVP5150_INT_STATUS_REG_A 0xc0 /* Interrupt status register A */ #define TVP5150_INT_ENABLE_REG_A 0xc1 /* Interrupt enable register A */ #define TVP5150_INT_CONF 0xc2 /* Interrupt configuration */ +#define TVP5150_VDPOE BIT(2) #define TVP5150_VDP_CONF_RAM_DATA 0xc3 /* VDP configuration RAM data */ #define TVP5150_CONF_RAM_ADDR_LOW 0xc4 /* Configuration RAM address low byte */ #define TVP5150_CONF_RAM_ADDR_HIGH 0xc5 /* Configuration RAM address high byte */