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: 10128369 X-Patchwork-Delegate: geert@linux-m68k.org 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 AF7C060318 for ; Thu, 21 Dec 2017 20:23:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F6FF29E5C for ; Thu, 21 Dec 2017 20:23:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9241829E5F; Thu, 21 Dec 2017 20:23:52 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CBA029E5C for ; Thu, 21 Dec 2017 20:23:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753985AbdLUUXv (ORCPT ); Thu, 21 Dec 2017 15:23:51 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:39105 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753633AbdLUUXu (ORCPT ); Thu, 21 Dec 2017 15:23:50 -0500 Received: by mail-lf0-f65.google.com with SMTP id m20so16142002lfi.6 for ; Thu, 21 Dec 2017 12:23:49 -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=mP1e/UTradV0mafJnQek/dvK6m0EsueAVnYhVYQhPNdI/Yrx5b27BhH4oRtQSTli4E NWMWEG8nz3pCIPZEwNPZacssO/knWc0PWB82lWDant8Kcshgl2NRNmu/sccBtBZh+/Mj LCzZsf6OkSri6wlFWxllAxYon3yHlb6D88tg0nRXymaWRRyqm+HxSV6qaZMhxJoDawmu uYyu1Rwv/r6D9UAcoNC51mG0q4RZdFHpNQTETL5szllAmm8jD0oh1hz2bjTStiaLuY/t /pMo6kun8xhljgkrXTHA6rxRwoO6lBLL13b3Pe3aY9Eku3H87tDgAI1Y8Jmcw8r0BcHn M71w== X-Gm-Message-State: AKGB3mLfHtvy3QUc1Hqp8MI33MLfmXFtLYGTEzZP/8d/7BrZx4qWAcuQ Wh4ITBwLpqh1Rtx3d424iL5d+g== 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 Cc: Sergei Shtylyov 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 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org 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)