Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2230160imm; Mon, 28 May 2018 04:23:26 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrdpD4OkcuxwzBOeOS32cwV81TTga2kte4zyXRz5r1QlqdxaunnZcWpVkLyPY3zNkM1R6WE X-Received: by 2002:a63:7807:: with SMTP id t7-v6mr10291382pgc.125.1527506606033; Mon, 28 May 2018 04:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527506606; cv=none; d=google.com; s=arc-20160816; b=Go5ybMHQYi9ALoFb6kqLTJ/CtQlp4dVzYLvX1+15M+wSyrb3VaDCmPOhtBXMep7G3Q DHex1aWlNFxQi85ZKthEjhbQYR2ivxQAVxh/iVYUCx66U+KMe+sbxWwjI7vX6+Ic/URD i5aSbKWM2SFCOL2JGq9jJ56jRJ3b/AsWVDWpH0RiYxn88qH3pzqClycLqH95ovO6SYD5 bRhuuO+RlmCTykXMxQkyQ7M4NvnPkFM5h+BFRq7B1PdGtqRaSZkucfTqPws3lql3oU4C zqXTMSAwItd8OPWBDWuRAcCrz33nZwuTL+pzSXWgZ7uHMkSBXWEGj07bSlAqbfJdi2H8 tuhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=rHdJF0NxNO6cYVeGwzauW0atAof7sBWQ9aXxKfo5E2w=; b=tTSCq4w048ykXsmpwfDvPhJZgoh49zlx1p6QPI/+Sz69/gI6jKmj2+UJrCZD4yhvSb g+oQpSHzmMMI0AB1D7Z09Ga+OAu5OOjT/vLYyAh3gdiexR8ARVpVu3P0T+la1RyEULJ6 WaHGjq8a3u0Q3sc2IuhFW+DlPniqXSaninNh4Rhf2I34gwRR+DrQpPbpLWnmL4hJj8fk Hr2PykmgDtxYpOY/h/x86y2FVhDK0chRkNxzOUOMZlbHk43iC30SyynIoQkD3FkxP5zd YW8fyP0VR1jn/j8kTwdwG+Vox0VFrQdiNsz8aEIdl1rBwd8ujR5GfzaMVao7nqRAtKOf cq9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AEdiBh91; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j6-v6si30021997pfb.25.2018.05.28.04.23.10; Mon, 28 May 2018 04:23:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AEdiBh91; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424694AbeE1LWW (ORCPT + 99 others); Mon, 28 May 2018 07:22:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:34984 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423059AbeE1LPz (ORCPT ); Mon, 28 May 2018 07:15:55 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7D63F206B7; Mon, 28 May 2018 11:15:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527506155; bh=41rSt9ZditJIGQMgWLuH0sN6Ry+6JXOMu56hfsyDSxA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AEdiBh913GNruFgM9HiC2qQKEiCy0u5uM/Kml//Jtg2xBmpiESo30ICsI0M/2nE8M yd26Qx8CZOQl0dbpq6NB9TBX2327DCX+D+gsYQwESwj/CJw58EU3+RYjVeJEZ3Wd+8 X7Zh91BGVQcIbG+0Mk2lxFqn9s7VUJ1hG6iI3yr0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sergei Shtylyov , Laurent Pinchart , Sasha Levin Subject: [PATCH 4.16 259/272] drm: rcar-du: lvds: Fix LVDS startup on R-Car Gen2 Date: Mon, 28 May 2018 12:04:52 +0200 Message-Id: <20180528100301.948557042@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100240.256525891@linuxfoundation.org> References: <20180528100240.256525891@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sergei Shtylyov [ Upstream commit 8525d04ba8a6a9ecfa4bd619c988ca873a5fc2a4 ] According to the latest revision 2.00 of the R-Car Gen2 manual, the LVDS and the bias circuit must be enabled after the LVDS I/O pins are enabled, not before. Fix the Gen2 LVDS startup sequence accordingly. While at it, also fix the comment preceding the first LVDCR0 write that still talks about hardcoding the LVDS mode 0. Fixes: 90374b5c25c9 ("drm/rcar-du: Add internal LVDS encoder support") Signed-off-by: Sergei Shtylyov Reviewed-by: Laurent Pinchart Tested-by: Laurent Pinchart Signed-off-by: Laurent Pinchart Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) --- a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c +++ b/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); - /* - * Select the input, hardcode mode 0, 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); @@ -74,6 +71,10 @@ static void rcar_du_lvdsenc_start_gen2(s LVDCR1_CHSTBY_GEN2(1) | LVDCR1_CHSTBY_GEN2(0) | LVDCR1_CLKSTBY_GEN2); + /* 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.