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: 8921671 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 3C00B9F1C1 for ; Sun, 24 Apr 2016 21:10:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4B46E2022D for ; Sun, 24 Apr 2016 21:10:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 51665201C7 for ; Sun, 24 Apr 2016 21:10:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753259AbcDXVKo (ORCPT ); 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-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 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; };