From patchwork Sat Feb 11 17:44:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 9568683 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A49BE60578 for ; Mon, 13 Feb 2017 00:40:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96D0D2808F for ; Mon, 13 Feb 2017 00:40:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B6F228113; Mon, 13 Feb 2017 00:40:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 20F1D2808F for ; Mon, 13 Feb 2017 00:40:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4815A6E337; Mon, 13 Feb 2017 00:39:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 615 seconds by postgrey-1.35 at gabe; Sat, 11 Feb 2017 17:54:31 UTC Received: from plaes.org (plaes.org [188.166.43.21]) by gabe.freedesktop.org (Postfix) with ESMTP id B70246E2CF for ; Sat, 11 Feb 2017 17:54:31 +0000 (UTC) Received: from localhost (71-43-196-88.dyn.estpak.ee [88.196.43.71]) by plaes.org (Postfix) with ESMTPSA id 086C540A76; Sat, 11 Feb 2017 17:44:23 +0000 (UTC) From: Priit Laes To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, Jonathan Liu , Thierry Reding , Russell King , Chen-Yu Tsai , Mark Rutland , Rob Herring , David Airlie , Maxime Ripard Subject: [PATCH 5/8] drm/sun4i: Add encoder type argument to sun4i_tcon0_mode_set Date: Sat, 11 Feb 2017 19:44:02 +0200 Message-Id: <20170211174405.28395-6-plaes@plaes.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170211174405.28395-1-plaes@plaes.org> References: <20170211174405.28395-1-plaes@plaes.org> X-Mailman-Approved-At: Mon, 13 Feb 2017 00:39:43 +0000 Cc: Quentin Schulz , linux-sunxi@googlegroups.com, Priit Laes X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Depending on the output type, we have to enable/disable some bits conditionally. Signed-off-by: Priit Laes --- drivers/gpu/drm/sun4i/sun4i_rgb.c | 2 +- drivers/gpu/drm/sun4i/sun4i_tcon.c | 3 ++- drivers/gpu/drm/sun4i/sun4i_tcon.h | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c b/drivers/gpu/drm/sun4i/sun4i_rgb.c index f5e86fe..3d4eb05 100644 --- a/drivers/gpu/drm/sun4i/sun4i_rgb.c +++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c @@ -179,7 +179,7 @@ static void sun4i_rgb_encoder_mode_set(struct drm_encoder *encoder, struct sun4i_drv *drv = rgb->drv; struct sun4i_tcon *tcon = drv->tcon; - sun4i_tcon0_mode_set(tcon, mode); + sun4i_tcon0_mode_set(tcon, mode, DRM_MODE_ENCODER_DAC); clk_set_rate(tcon->dclk, mode->crtc_clock * 1000); diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index ea2906f..71d0087 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -124,7 +124,8 @@ static int sun4i_tcon_get_clk_delay(struct drm_display_mode *mode, } void sun4i_tcon0_mode_set(struct sun4i_tcon *tcon, - struct drm_display_mode *mode) + struct drm_display_mode *mode, + int type) { unsigned int bp, hsync, vsync; u8 clk_delay; diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.h b/drivers/gpu/drm/sun4i/sun4i_tcon.h index 166064b..b040e10 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.h +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.h @@ -188,7 +188,8 @@ void sun4i_tcon_enable_vblank(struct sun4i_tcon *tcon, bool enable); void sun4i_tcon_switch_interlace(struct sun4i_tcon *tcon, bool enable); void sun4i_tcon0_mode_set(struct sun4i_tcon *tcon, - struct drm_display_mode *mode); + struct drm_display_mode *mode, + int type); void sun4i_tcon1_mode_set(struct sun4i_tcon *tcon, struct drm_display_mode *mode);