From patchwork Fri Jul 26 09:32:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Katsuya MATSUBARA X-Patchwork-Id: 19412 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.72) (envelope-from ) id 1V2eOn-0003GW-8z; Fri, 26 Jul 2013 11:33:21 +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.72/mailfrontend-5) with esmtp id 1V2eOl-0005j4-7F; Fri, 26 Jul 2013 11:33:21 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758452Ab3GZJdO (ORCPT + 1 other); Fri, 26 Jul 2013 05:33:14 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:42342 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753432Ab3GZJdK (ORCPT ); Fri, 26 Jul 2013 05:33:10 -0400 Received: by mail-pb0-f46.google.com with SMTP id rq8so1833626pbb.19 for ; Fri, 26 Jul 2013 02:33:09 -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=twpsTTY0aROVAmyvCVHo7q92AWRCeVzHiK8vnAL6gO0=; b=EHtLFdwOsH3hd1zl5AGNAetLZJ0EmMuIKHOHpmNLW+NAhBAPOENJwJWreSO1I+QRCI 2eZkq00aAp7pX8YZ3WcBKAJshayaAO8tG9SV6lwPokwUbude3ZPRPG6peGjsS4ZNj8tC Sbuvq8cvBbx9qH2e8gBMC5cTKTrFPq2O6HTaxYUN2Wb2t2fQ+2Wyx5hb5v+72ygCYWIQ wtaW5Ms7qh2S1qL1+h2nJBTIwWHY7MciQWJAUZfYYOAlZilvx/f2SDfAd1xc0UfmG9Gl 2Xmp8fDalBr6yJ4n85h8bhvubdPJ5MkfaJDlCquqbkfrWnMpyATc3S0Y6F0OLAA7CXI0 AtDg== X-Received: by 10.68.237.3 with SMTP id uy3mr13910911pbc.155.1374831189607; Fri, 26 Jul 2013 02:33:09 -0700 (PDT) Received: from kiefer.hq.igel.co.jp ([219.106.231.132]) by mx.google.com with ESMTPSA id ot4sm2578248pac.17.2013.07.26.02.33.07 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Jul 2013 02:33:08 -0700 (PDT) From: Katsuya Matsubara To: Laurent Pinchart Cc: linux-media@vger.kernel.org, linux-sh@vger.kernel.org, Hans Verkuil , Sakari Ailus , Sylwester Nawrocki , Katsuya Matsubara Subject: [PATCH 6/7] [media] vsp1: Move the DPR_WPF_FPORCH register settings into the device initialization Date: Fri, 26 Jul 2013 18:32:16 +0900 Message-Id: <1374831137-9219-7-git-send-email-matsu@igel.co.jp> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1374831137-9219-1-git-send-email-matsu@igel.co.jp> References: <1374831137-9219-1-git-send-email-matsu@igel.co.jp> X-Gm-Message-State: ALoCoQkIdN9CFGDUIBkhtjKNTJlRHzgbIBbzJCmrCngvnZmnDfEp3iuN5qJ9QWeBAc1hsWLdJGEj 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: 2013.7.26.92426 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_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __URI_NO_WWW 0, __URI_NS , __YOUTUBE_RCVD 0' The DPR_WPR_FPORCH registers must be set once with a constant value and they are never varied at runtime. So it can be moved into the vsp1_device_init function that will be invoked just one time. Signed-off-by: Katsuya Matsubara --- drivers/media/platform/vsp1/vsp1_drv.c | 9 +++++++++ drivers/media/platform/vsp1/vsp1_regs.h | 2 +- drivers/media/platform/vsp1/vsp1_wpf.c | 3 --- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/vsp1/vsp1_drv.c b/drivers/media/platform/vsp1/vsp1_drv.c index ca05431..c24f43f 100644 --- a/drivers/media/platform/vsp1/vsp1_drv.c +++ b/drivers/media/platform/vsp1/vsp1_drv.c @@ -241,6 +241,12 @@ static void vsp1_device_init(struct vsp1_device *vsp1) u32 status; u32 route_unused = vsp1->routes[VI6_DPR_NODE_UNUSED].id; u32 val; + const u32 fporch_fp[VPS1_MAX_WPF] = { + (VI6_DPR_WPF_FPORCH_FP_WPFN << 8), + (VI6_DPR_WPF_FPORCH_FP_WPFN << 8), + (VI6_DPR_WPF_FPORCH_FP_WPFN << 8), + (VI6_DPR_WPF_FPORCH_FP_WPFN << 8), + }; /* Reset any channel that might be running. */ status = vsp1_read(vsp1, VI6_STATUS); @@ -305,6 +311,9 @@ static void vsp1_device_init(struct vsp1_device *vsp1) val |= route_unused << vsp1->routes[VI6_DPR_NODE_BRU_OUT].shift; vsp1_write(vsp1, VI6_DPR_BRU_ROUTE, val); + for (i = 0; i < VPS1_MAX_WPF; ++i) + vsp1_write(vsp1, VI6_DPR_WPF_FPORCH0 + i, fporch_fp[i]); + vsp1_write(vsp1, VI6_DPR_HGO_SMPPT, (7 << VI6_DPR_SMPPT_TGW_SHIFT) | (route_unused << VI6_DPR_SMPPT_PT_SHIFT)); vsp1_write(vsp1, VI6_DPR_HGT_SMPPT, (7 << VI6_DPR_SMPPT_TGW_SHIFT) | diff --git a/drivers/media/platform/vsp1/vsp1_regs.h b/drivers/media/platform/vsp1/vsp1_regs.h index b201202..bd9f72e 100644 --- a/drivers/media/platform/vsp1/vsp1_regs.h +++ b/drivers/media/platform/vsp1/vsp1_regs.h @@ -507,7 +507,7 @@ enum { * Macros for DPR Control Registers */ -#define VI6_DPR_WPF_FPORCH_FP_WPFN (5 << 8) +#define VI6_DPR_WPF_FPORCH_FP_WPFN 5 #define VI6_DPR_ROUTE_FXA_MASK (0xff << 8) #define VI6_DPR_ROUTE_FXA_SHIFT 16 diff --git a/drivers/media/platform/vsp1/vsp1_wpf.c b/drivers/media/platform/vsp1/vsp1_wpf.c index 37779ef..af1f1b8 100644 --- a/drivers/media/platform/vsp1/vsp1_wpf.c +++ b/drivers/media/platform/vsp1/vsp1_wpf.c @@ -104,9 +104,6 @@ static int wpf_s_stream(struct v4l2_subdev *subdev, int enable) vsp1_wpf_write(wpf, VI6_WPF_OUTFMT, outfmt); - vsp1_write(vsp1, VI6_DPR_WPF_FPORCH0 + wpf->entity.index, - VI6_DPR_WPF_FPORCH_FP_WPFN); - vsp1_write(vsp1, VI6_WPF_WRBCK_CTRL, 0); /* Enable interrupts */