From patchwork Fri Jan 12 20:12:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10161609 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 A252E602D8 for ; Fri, 12 Jan 2018 20:16:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9370C28A1E for ; Fri, 12 Jan 2018 20:16:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8811128A8F; Fri, 12 Jan 2018 20:16:01 +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 47A3828A1E for ; Fri, 12 Jan 2018 20:16:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2FF0D6E967; Fri, 12 Jan 2018 20:16:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x241.google.com (mail-lf0-x241.google.com [IPv6:2a00:1450:4010:c07::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8675E6E967 for ; Fri, 12 Jan 2018 20:15:58 +0000 (UTC) Received: by mail-lf0-x241.google.com with SMTP id h140so7203324lfg.1 for ; Fri, 12 Jan 2018 12:15:58 -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=hRAgrVpdIERAEjKzUUH66XJLn/VkB7IxaSn08FXSRYA=; b=Rv2ONEwWR3VkbfzqviUwGGVDQ0LUD+DSMoGhGN0hvjSqEpw/Pk6gQJFBzlMU30cqCd +ZfLWxVI0bsDAyB+PyNdaFJbpGo8bli7Wq+cxYPToX7KmXzYLieJ+UxnSpPXZsOrzEqS XZ0cd5s4wtrIc+SQ6xYcbqw/aDkqxCfjsCL2W1igkh+f5Qtsv0yfWJBTyaJWZ6Ih4E8p ftmM5EkTfSS6Is2czMLhy1i9ZGBvZnHHkHORNs6ngyqJ/7YGPzzVtaDRslZoh7+Jc7hi mLFT2VWCANb+ivixYv+LcLMSR1iV59dO/65TvQ6qu2nst611nLX03QwCfleRUb66EEzp scyw== 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=hRAgrVpdIERAEjKzUUH66XJLn/VkB7IxaSn08FXSRYA=; b=Vn8RqvDHJ493yvPc1INO/B/m3zhD4MZKzB+7nZ7DesnQqBipf2BlxIUDiGLY2oiqJc dmRP5vQc6f5AS0unNDoeRhLQ45kbg9rVVM5IMd8BYbudpHC71k8ebkD/gWtKE3cCyIMS 6i7rYqkD2PhspWTZWGL0FDs9x8FQIoxF7goBSzyKr/3CUiDfuMYXOV3btlLsY3m3uHKX 3k2BxHqIzRusFaPjpv1EqXUNg6f+CnRxbI0/GAXS5mRttzmN4B8M5GA67E8/nJYqp1QC ee7P9afjeX8xrvsAaKBuWbBIPfvhvOBu+W6cgBbZGgy4HJPzs2GxNH0YmAEwk5SzROdp HRWQ== X-Gm-Message-State: AKGB3mIdgdu6AxVxz6he9/r5Gsg53mpHnkKa3iaWO+W7mW3cJUYzQOBQ CuJAhDStHhwfZPMqrn1YzD+VJA== X-Google-Smtp-Source: ACJfBouomz7lZTc93ViNLQKPdDlLDsG1c5FiY3x+LEj5k3csevFOxhFbUnDf9coenKRBxgInW3LxiQ== X-Received: by 10.46.29.215 with SMTP id w84mr15274018lje.78.1515788157016; Fri, 12 Jan 2018 12:15:57 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.80.187]) by smtp.gmail.com with ESMTPSA id g192sm3875917lfg.69.2018.01.12.12.15.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jan 2018 12:15:56 -0800 (PST) From: Sergei Shtylyov X-Google-Original-From: "Sergei Shtylyov" Received: by wasted.cogentembedded.com (sSMTP sendmail emulation); Fri, 12 Jan 2018 23:15:53 +0300 Message-Id: <20180112201553.683979009@cogentembedded.com> User-Agent: quilt/0.64 Date: Fri, 12 Jan 2018 23:12:05 +0300 To: Laurent Pinchart , David Airlie , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH 2/2] drm: rcar-du: lvds: fix LVDS startup on R-Car gen2 MIME-Version: 1.0 Content-Disposition: inline; filename=drm-rcar-du-lvds-fix-LVDS-startup-on-R-Car-gen2.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 According to the latest revision 2.00 of the R-Car gen2 manual, the LVDS must be enabled and the bias crcuit enabled after the LVDS I/O pins are enabled, not before -- fix the gen2 LVDS startup sequence accordingly. Fixes: 90374b5c25c9 ("drm/rcar-du: Add internal LVDS encoder support") Signed-off-by: Sergei Shtylyov --- drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 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 @@ -59,11 +59,8 @@ static void rcar_du_lvdsenc_start_gen2(s rcar_lvds_write(lvds, LVDPLLCR, pllcr); - /* - * Set the LVDS mode, select the input, enable LVDS operation, - * and turn bias circuitry on. - */ - lvdcr0 = (lvds->mode << LVDCR0_LVMD_SHIFT) | LVDCR0_BEN | LVDCR0_LVEN; + /* Select the input and set the LVDS mode. */ + lvdcr0 = lvds->mode << LVDCR0_LVMD_SHIFT; if (rcrtc->index == 2) lvdcr0 |= LVDCR0_DUSEL; rcar_lvds_write(lvds, LVDCR0, lvdcr0); @@ -73,6 +70,10 @@ static void rcar_du_lvdsenc_start_gen2(s LVDCR1_CHSTBY(3) | LVDCR1_CHSTBY(2) | LVDCR1_CHSTBY(1) | LVDCR1_CHSTBY(0) | LVDCR1_CLKSTBY); + /* Enable LVDS operation and turn bias circuitry on. */ + lvdcr0 |= LVDCR0_BEN | LVDCR0_LVEN; + rcar_lvds_write(lvds, LVDCR0, lvdcr0); + /* * Turn the PLL on, wait for the startup delay, and turn the output * on.