From patchwork Sun Apr 24 21:08:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Dimitrov X-Patchwork-Id: 8921641 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1F197BF29F for ; Sun, 24 Apr 2016 21:10:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 28B1C20219 for ; Sun, 24 Apr 2016 21:10:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4C7D0201E4 for ; Sun, 24 Apr 2016 21:10:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753355AbcDXVKk (ORCPT ); Sun, 24 Apr 2016 17:10:40 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33263 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753259AbcDXVKg (ORCPT ); Sun, 24 Apr 2016 17:10:36 -0400 Received: by mail-wm0-f65.google.com with SMTP id r12so17689283wme.0 for ; Sun, 24 Apr 2016 14:10:36 -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=7oCzSnCVNebeDTwwdIS6Je9HfZvjQCymQXxBLhxCX2w=; b=lBsFNlYfZTYUycvb9jRlFXfDOGLFY2rskg5yZkD67cwx8596jN6aNfqeo9LPGfMIeH 92HGKDrIck0UlJdHf4ShHl+h+LM099KM4pDGQu7UiMStvIAIwRSCAe+xh1vrameajkoA EXm1rxeFiiBf8ikUrnhUFCUFnJXO+IUfNbj7tghyvTjXPZOnEzkgNRRxVkD1Yx6HgWtU 0QKUGCAE1By3meZhNyNLrdDq5yY74I8R6Xbv2ZAdNvc0XstaCEsXQU/++Q1yixGTUN7u m+zQwzTuNF31JbYMSE/ABl7yWohNC/BMy76xoocn4pVYWtaTo8/z6SSGj2TFciQHOBqI 7A0A== 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=7oCzSnCVNebeDTwwdIS6Je9HfZvjQCymQXxBLhxCX2w=; b=lhtU+9sbAQ4hr85Jpwz42VwHMVKJbHUBTICCnFju13yGoDnKTnBPbR2RH4o9Er4JtH bm0McyUSu9q0jhOPWEEiiMKsCzv8A0aOkyB0cW1Vbiurv3Mjpnn7zDoK6aZ3BUpzcULt 9EU3uWFQjJpDMx3KicCZ2e09UoB/BmA5a3fHXtmXzTx2FLHpdayyMogie44/mzA0aIzp GEUvrMG5yRUfdlEyqm5jt+PAqIsHz3XiM/YnUUkIvY01wOAV1W+T5/bScJVQNvYVpz6W ZYKo2ni30V8ktHzMrQaFgj8ReVWyzP3AyWVJgpNKz7zZqufc4YHRjOJpxMUvA/BKEWmF SXHA== X-Gm-Message-State: AOPr4FUWFsMwaJlLm+YlIE6CdaiJI8bvluTEFKjq5iZCQ0Sx9p8ndsqcb7wp251vinLkpw== X-Received: by 10.194.92.132 with SMTP id cm4mr30594199wjb.25.1461532235662; Sun, 24 Apr 2016 14:10:35 -0700 (PDT) Received: from localhost.localdomain ([46.249.74.23]) by smtp.gmail.com with ESMTPSA id b2sm15440182wmb.9.2016.04.24.14.10.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 24 Apr 2016 14:10:35 -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 23/24] [media] omap3isp: Make sure CSI1 interface is enabled in CPP2 mode Date: Mon, 25 Apr 2016 00:08:23 +0300 Message-Id: <1461532104-24032-24-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 OMAP3430 needs various syscon CONTROL_CSIRXFE bits set in order to operate. Implement the missing functionality. Signed-off-by: Ivaylo Dimitrov --- drivers/media/platform/omap3isp/ispccp2.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/media/platform/omap3isp/ispccp2.c b/drivers/media/platform/omap3isp/ispccp2.c index 7bb7feb..833eed4 100644 --- a/drivers/media/platform/omap3isp/ispccp2.c +++ b/drivers/media/platform/omap3isp/ispccp2.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "isp.h" #include "ispreg.h" @@ -160,6 +161,32 @@ static int ccp2_if_enable(struct isp_ccp2_device *ccp2, u8 enable) return ret; } + if (isp->revision == ISP_REVISION_2_0) { + struct media_pad *pad; + struct v4l2_subdev *sensor; + const struct isp_ccp2_cfg *buscfg; + u32 csirxfe; + + pad = media_entity_remote_pad(&ccp2->pads[CCP2_PAD_SINK]); + sensor = media_entity_to_v4l2_subdev(pad->entity); + buscfg = &((struct isp_bus_cfg *)sensor->host_priv)->bus.ccp2; + + + if (enable) { + csirxfe = OMAP343X_CONTROL_CSIRXFE_PWRDNZ | + OMAP343X_CONTROL_CSIRXFE_RESET; + + if (buscfg->phy_layer) + csirxfe |= OMAP343X_CONTROL_CSIRXFE_SELFORM; + + if (buscfg->strobe_clk_pol) + csirxfe |= OMAP343X_CONTROL_CSIRXFE_CSIB_INV; + } else + csirxfe = 0; + + regmap_write(isp->syscon, isp->syscon_offset, csirxfe); + } + /* Enable/Disable all the LCx channels */ for (i = 0; i < CCP2_LCx_CHANS_NUM; i++) isp_reg_clr_set(isp, OMAP3_ISP_IOMEM_CCP2, ISPCCP2_LCx_CTRL(i),