From patchwork Thu Dec 21 20:23:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10128371 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 9BAB76056F for ; Thu, 21 Dec 2017 20:23:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E52B29E5C for ; Thu, 21 Dec 2017 20:23:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82B8E29E63; Thu, 21 Dec 2017 20:23:54 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 170CB29E5E for ; Thu, 21 Dec 2017 20:23:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 87B836E0EE; Thu, 21 Dec 2017 20:23:52 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x244.google.com (mail-lf0-x244.google.com [IPv6:2a00:1450:4010:c07::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id AE9826E0EE for ; Thu, 21 Dec 2017 20:23:50 +0000 (UTC) Received: by mail-lf0-x244.google.com with SMTP id f13so29246570lff.12 for ; Thu, 21 Dec 2017 12:23:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:user-agent:date:to:cc:subject:mime-version :content-disposition; bh=kPFDzvHzhbkkrBcc3UI4RHxa6ud3ceE9jEdKPYgM/HA=; b=QAX/XJPYS97wa1TMemW19O15yOX+JyS0OEbyoDX9aK3C9njmcwYRmHOWEGsrE803+X Rn4tTQkdO+BNmWNQut7UizBfpYQUs7kcLl6Orc7dyHhBMbpZPUF9qZikXXb6L0YLXBJX 7nazI9qJrk7z8PoLpzy0dLZYj43f2CJVsc0H/NFtiBXYvL9UWVGt0p29kwmsLT7t/hmV NQlSGqfCENvs0mu16I/ekQ6Dj11czkSaANW/jtEfDhVMyOAIU3Q9EPMhMB/GZbda2GaJ 3TWlUbxur49GrN1iHFgr8keqB1fEVpuZ35gt+ewFBKbWkRND64pzcSPeFYQw80kIaNEY oL8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:user-agent:date:to:cc:subject :mime-version:content-disposition; bh=kPFDzvHzhbkkrBcc3UI4RHxa6ud3ceE9jEdKPYgM/HA=; b=MDytCs8a7WCDWvr+NzrSb25pyH9AHAVSdvVlVi/cGRDHsbopLcxQal+UFvOnMPoOGF xpUQ5On9120+hgq5DKc+RpyUgr0fctUNiT0rMSEPuHj+W3+5qb5ur7DHmffyLazYUtRZ WW/mxljKwCjW5XDv7GQrR5cAropsHeh1fjlTDRA801iTXm4cPiRhVT2RNzqAMYMRJE9g BCkyEnmr3WO6EjxkiPL0AroaNBkhvftMf59hlF8vkGiuK1gFe485dw/KVkP8KcUKzMXK +GR2qIhjY1d2R2WRSpdeE/qJbNHau7QPsBPGg/dkwRCmfgxpXVa36IINaRiv5ZflsAVp 6ywg== X-Gm-Message-State: AKGB3mIJH+zPQYXOSW2TGutXbdms7BD7nEc5VsdGHWhRtm9G0wuWJ+9V Pbux59SwxCLi2FcWmoUBFv/B9A== X-Google-Smtp-Source: ACJfBourKzXrSlxEywbdhyn30bb7EuGXLVy63b9oXxjpp5/xS3Dtaw5ksHMMPCnxmMqREDn8PeqsPA== X-Received: by 10.25.222.18 with SMTP id v18mr7552724lfg.143.1513887828894; Thu, 21 Dec 2017 12:23:48 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.81.163]) by smtp.gmail.com with ESMTPSA id e23sm1078010lfi.92.2017.12.21.12.23.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Dec 2017 12:23:47 -0800 (PST) From: Sergei Shtylyov X-Google-Original-From: "Sergei Shtylyov" Received: by wasted.cogentembedded.com (sSMTP sendmail emulation); Thu, 21 Dec 2017 23:23:43 +0300 Message-Id: <20171221202343.596842084@cogentembedded.com> User-Agent: quilt/0.64 Date: Thu, 21 Dec 2017 23:23:30 +0300 To: Laurent Pinchart , David Airlie , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH] drm: rcar-du: lvds: fix LVDCR1 for R-Car gen3 MIME-Version: 1.0 Content-Disposition: inline; filename=drm-rcar-du-lvds-fix-LVDCR1-for-R-Car-gen3.patch Cc: Sergei Shtylyov 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The LVDCR1 register for the R-Car gen3 SoCs was documented as having the layout different from the gen2 SoCs in the early R-Car gen3 manuals but since v0.52 the LVDCR1 layout is described as being the same as on the gen2 SoCs; the old CHn control values are said to be prohibited now (and there seems to be no valid output signal when they are used). Fixes: 6bc2e15cf21c ("drm: rcar-du: lvds: Add R-Car Gen3 support") Signed-off-by: Sergei Shtylyov Reviewed-by: Laurent Pinchart Tested-by: Laurent Pinchart --- drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c | 10 ++++------ drivers/gpu/drm/rcar-du/rcar_lvds_regs.h | 6 ++---- 2 files changed, 6 insertions(+), 10 deletions(-) Index: linux/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c =================================================================== --- linux.orig/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c +++ linux/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c @@ -70,9 +70,8 @@ static void rcar_du_lvdsenc_start_gen2(s /* Turn all the channels on. */ rcar_lvds_write(lvds, LVDCR1, - LVDCR1_CHSTBY_GEN2(3) | LVDCR1_CHSTBY_GEN2(2) | - LVDCR1_CHSTBY_GEN2(1) | LVDCR1_CHSTBY_GEN2(0) | - LVDCR1_CLKSTBY_GEN2); + LVDCR1_CHSTBY(3) | LVDCR1_CHSTBY(2) | + LVDCR1_CHSTBY(1) | LVDCR1_CHSTBY(0) | LVDCR1_CLKSTBY); /* * Turn the PLL on, wait for the startup delay, and turn the output @@ -109,9 +108,8 @@ static void rcar_du_lvdsenc_start_gen3(s /* Turn all the channels on. */ rcar_lvds_write(lvds, LVDCR1, - LVDCR1_CHSTBY_GEN3(3) | LVDCR1_CHSTBY_GEN3(2) | - LVDCR1_CHSTBY_GEN3(1) | LVDCR1_CHSTBY_GEN3(0) | - LVDCR1_CLKSTBY_GEN3); + LVDCR1_CHSTBY(3) | LVDCR1_CHSTBY(2) | + LVDCR1_CHSTBY(1) | LVDCR1_CHSTBY(0) | LVDCR1_CLKSTBY); /* * Turn the PLL on, set it to LVDS normal mode, wait for the startup Index: linux/drivers/gpu/drm/rcar-du/rcar_lvds_regs.h =================================================================== --- linux.orig/drivers/gpu/drm/rcar-du/rcar_lvds_regs.h +++ linux/drivers/gpu/drm/rcar-du/rcar_lvds_regs.h @@ -26,10 +26,8 @@ #define LVDCR1 0x0004 #define LVDCR1_CKSEL (1 << 15) /* Gen2 only */ -#define LVDCR1_CHSTBY_GEN2(n) (3 << (2 + (n) * 2)) /* Gen2 only */ -#define LVDCR1_CHSTBY_GEN3(n) (1 << (2 + (n) * 2)) /* Gen3 only */ -#define LVDCR1_CLKSTBY_GEN2 (3 << 0) /* Gen2 only */ -#define LVDCR1_CLKSTBY_GEN3 (1 << 0) /* Gen3 only */ +#define LVDCR1_CHSTBY(n) (3 << (2 + (n) * 2)) +#define LVDCR1_CLKSTBY (3 << 0) #define LVDPLLCR 0x0008 #define LVDPLLCR_CEEN (1 << 14)