From patchwork Sun Apr 24 21:08:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Dimitrov X-Patchwork-Id: 34030 X-Patchwork-Delegate: laurent.pinchart@ideasonboard.com Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from ) id 1auRIt-0007DF-06; Sun, 24 Apr 2016 21:10:55 +0000 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.76/mailfrontend-7) with esmtp id 1auRIq-0000Ec-3B; Sun, 24 Apr 2016 23:10:54 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753259AbcDXVKo (ORCPT + 1 other); Sun, 24 Apr 2016 17:10:44 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36660 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753338AbcDXVKg (ORCPT ); Sun, 24 Apr 2016 17:10:36 -0400 Received: by mail-wm0-f68.google.com with SMTP id w143so16620920wmw.3 for ; Sun, 24 Apr 2016 14:10:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=G3EX4sCUdif6fAjund+zsunGEZSHZHLdOuMt8nwG0Lo=; b=ipdgI+Dq6ZXkx54gkfrA4TvEAlzrIVpemtMUS0InkQ/MaCD83JF1EuH0IQTfVcms3y XNRHe1UZ6g6uYg6lqgkyv+hPmcj6Ej6rnKU0dgdzGcYZNvqLKVl87EFrxp19MSlcfo6Z AIz0SJNpMp9UsNoQZAbOYHx1Gz8lTqNHafbkCN0d5BTavp4N2PMx3uK9okK9bX8swJW3 HOYKwwJXTsuMbtEF3CoXzQJmSV/RKcObsQix1yPul1I7YXeo8jZ3DyexNtEtLmHVO+aC +kQfQv7u3s9A6CjVy5sQ6k9dLap8b2Li9iIwiCQ4H9i37U7NLtQcFG0UvH09I5FaZb1s FCxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=G3EX4sCUdif6fAjund+zsunGEZSHZHLdOuMt8nwG0Lo=; b=iYEreZf5DM9aUg9pbOcyJSF3l4tlv7LBfDovS5VOS0sHK+kfdlYZgAErwCmEmN3nnx p4386ol+LqDd/8VE2PiDt1Av4S4ZRuZbE13+CO9+CLfXAWHRwNbO6iPhyFLDK/pdQ6b5 6zbiF5yuM8QifwaCvywgoeN27m8E/kB5SNFA//VEIabk604t4GQZbkkRbjUQBTVV1jCd 10YaGJYV9V1wzzxx4t+kqI4h9C/oBVC0DB4Nw004PnzgbM2SWSIFofDTAXL2/wm34cnH V3rZmvaMlIKqnt43xfguce60uZZzZzvfoF3CWGqJxk0NJYcm/8yv1QZLjNgWTALm6HYz 28mA== X-Gm-Message-State: AOPr4FWwob/VkONyxf5wvODMZUKgzdL51/7rljISqQLqp82+4b6nxKEPaJzQ7yOiY4LUsw== X-Received: by 10.194.201.37 with SMTP id jx5mr5888931wjc.60.1461532234679; Sun, 24 Apr 2016 14:10:34 -0700 (PDT) Received: from localhost.localdomain ([46.249.74.23]) by smtp.gmail.com with ESMTPSA id b2sm15440182wmb.9.2016.04.24.14.10.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 24 Apr 2016 14:10:34 -0700 (PDT) From: Ivaylo Dimitrov To: sakari.ailus@iki.fi Cc: sre@kernel.org, pali.rohar@gmail.com, pavel@ucw.cz, linux-media@vger.kernel.org, Ivaylo Dimitrov Subject: [RFC PATCH 22/24] [media] omap3isp: Correctly set IO_OUT_SEL and VP_CLK_POL for CCP2 mode Date: Mon, 25 Apr 2016 00:08:22 +0300 Message-Id: <1461532104-24032-23-git-send-email-ivo.g.dimitrov.75@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461532104-24032-1-git-send-email-ivo.g.dimitrov.75@gmail.com> References: <20160420081427.GZ32125@valkosipuli.retiisi.org.uk> <1461532104-24032-1-git-send-email-ivo.g.dimitrov.75@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2016.4.24.210315 X-PMX-Spam: Gauge=XI, Probability=11%, Report=' HASHBUSTER_BLOCK_V2 0.5, FORGED_FROM_GMAIL 0.1, MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODY_SIZE_3000_3999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DKIM_SIGNATURE 0, NO_URI_HTTPS 0, REFERENCES 0, SINGLE_URI_IN_BODY 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __DATE_TZ_RU 0, __FRAUD_BODY_WEBMAIL 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __FROM_GMAIL 0, __HASHBUSTER_BLOCK_V2_1 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __LINES_OF_YELLING 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __PHISH_SPEAR_STRUCTURE_1 0, __REFERENCES 0, __SANE_MSGID 0, __SINGLE_URI_TEXT 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_IN_BODY 0, __URI_NO_WWW 0, __URI_NS , __URI_WITH_PATH 0, __YOUTUBE_RCVD 0' ISP CSI1 module needs all the bits correctly set to work. Signed-off-by: Ivaylo Dimitrov --- drivers/media/platform/omap3isp/isp.c | 2 ++ drivers/media/platform/omap3isp/ispccp2.c | 7 +++++-- drivers/media/platform/omap3isp/ispreg.h | 4 ++++ drivers/media/platform/omap3isp/omap3isp.h | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c index e51a1f9..6361fde 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c @@ -2056,6 +2056,8 @@ static void isp_of_parse_node_csi1(struct device *dev, * sensor. Frame descriptors, perhaps? */ buscfg->bus.ccp2.crc = 1; + + buscfg->bus.ccp2.vp_clk_pol = 1; } static void isp_of_parse_node_csi2(struct device *dev, diff --git a/drivers/media/platform/omap3isp/ispccp2.c b/drivers/media/platform/omap3isp/ispccp2.c index ca09523..7bb7feb 100644 --- a/drivers/media/platform/omap3isp/ispccp2.c +++ b/drivers/media/platform/omap3isp/ispccp2.c @@ -213,14 +213,17 @@ static int ccp2_phyif_config(struct isp_ccp2_device *ccp2, struct isp_device *isp = to_isp_device(ccp2); u32 val; - /* CCP2B mode */ val = isp_reg_readl(isp, OMAP3_ISP_IOMEM_CCP2, ISPCCP2_CTRL) | - ISPCCP2_CTRL_IO_OUT_SEL | ISPCCP2_CTRL_MODE; + ISPCCP2_CTRL_MODE; /* Data/strobe physical layer */ BIT_SET(val, ISPCCP2_CTRL_PHY_SEL_SHIFT, ISPCCP2_CTRL_PHY_SEL_MASK, buscfg->phy_layer); + BIT_SET(val, ISPCCP2_CTRL_IO_OUT_SEL_SHIFT, + ISPCCP2_CTRL_IO_OUT_SEL_MASK, buscfg->ccp2_mode); BIT_SET(val, ISPCCP2_CTRL_INV_SHIFT, ISPCCP2_CTRL_INV_MASK, buscfg->strobe_clk_pol); + BIT_SET(val, ISPCCP2_CTRL_VP_CLK_POL_SHIFT, + ISPCCP2_CTRL_VP_CLK_POL_MASK, buscfg->vp_clk_pol); isp_reg_writel(isp, val, OMAP3_ISP_IOMEM_CCP2, ISPCCP2_CTRL); val = isp_reg_readl(isp, OMAP3_ISP_IOMEM_CCP2, ISPCCP2_CTRL); diff --git a/drivers/media/platform/omap3isp/ispreg.h b/drivers/media/platform/omap3isp/ispreg.h index b5ea8da..d084839 100644 --- a/drivers/media/platform/omap3isp/ispreg.h +++ b/drivers/media/platform/omap3isp/ispreg.h @@ -87,6 +87,8 @@ #define ISPCCP2_CTRL_PHY_SEL_MASK 0x1 #define ISPCCP2_CTRL_PHY_SEL_SHIFT 1 #define ISPCCP2_CTRL_IO_OUT_SEL (1 << 2) +#define ISPCCP2_CTRL_IO_OUT_SEL_MASK 0x1 +#define ISPCCP2_CTRL_IO_OUT_SEL_SHIFT 2 #define ISPCCP2_CTRL_MODE (1 << 4) #define ISPCCP2_CTRL_VP_CLK_FORCE_ON (1 << 9) #define ISPCCP2_CTRL_INV (1 << 10) @@ -94,6 +96,8 @@ #define ISPCCP2_CTRL_INV_SHIFT 10 #define ISPCCP2_CTRL_VP_ONLY_EN (1 << 11) #define ISPCCP2_CTRL_VP_CLK_POL (1 << 12) +#define ISPCCP2_CTRL_VP_CLK_POL_MASK 0x1 +#define ISPCCP2_CTRL_VP_CLK_POL_SHIFT 12 #define ISPCCP2_CTRL_VPCLK_DIV_SHIFT 15 #define ISPCCP2_CTRL_VPCLK_DIV_MASK 0x1ffff /* [31:15] */ #define ISPCCP2_CTRL_VP_OUT_CTRL_SHIFT 8 /* 3430 bits */ diff --git a/drivers/media/platform/omap3isp/omap3isp.h b/drivers/media/platform/omap3isp/omap3isp.h index 443e8f7..f6d1d0d 100644 --- a/drivers/media/platform/omap3isp/omap3isp.h +++ b/drivers/media/platform/omap3isp/omap3isp.h @@ -108,6 +108,7 @@ struct isp_ccp2_cfg { unsigned int ccp2_mode:1; unsigned int phy_layer:1; unsigned int vpclk_div:2; + unsigned int vp_clk_pol:1; struct isp_csiphy_lanes_cfg lanecfg; };