Received: by 2002:a05:6622:f08:0:0:0:0 with SMTP id l8csp4488028ivc; Tue, 3 Nov 2020 13:21:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxa7k7iTles/8HYe40/znrsNzAFxcBmG5CeEY6Xs7hWCE4QrmhDe/Yq0aD225MvDCGtEUG6 X-Received: by 2002:a05:6402:a57:: with SMTP id bt23mr12509535edb.62.1604438479925; Tue, 03 Nov 2020 13:21:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604438479; cv=none; d=google.com; s=arc-20160816; b=htuT30Ux5dUNObx8Ij5khN1vVrx67Sm6HBVlXJsrJYjtcUkuWtBxN7XAXd2KfZ0698 8A6v4JG9rgPUKrzLMUPmmSt6LQIfrBiV1ZkszLzhDa7oXXnDCXdypDhPRnoQJFfFvtXo pyM4iOT2ZNGwjJ3dUlnqBgBl1vsSlwKnqKDSMVD3Z+jThf7EU6GWJ8xj9ohGLb9KJS8/ +hzoqyBly1o2uaWw35FUeHeLvasJaXClQei+WRMjPZqMT+OPl/5lZlTmMVY6dAGPa8i2 MQO96oZlZhG4H74ESvcuyAetwDtBALDOf9Zq1bPhE0S30cNRBpTk0sQ6WwRF3lclHj4U UPNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=I1qeQ/b0wEUKtu3cDGgmQhicmtQDhnzftrDr8WPOjFM=; b=EO/TQiPeEowuv19lGQAM8nD7zTQaj5hDbk+Br7nnI3TXKH5NBEEx72M77fVIzDThm5 4AJ7Ecw2b8giZPPPNhylr+8b3udXXqtDREWtA0IP6TJwCTB6fH2cqBwjJzjKAuDhIm9t x2ANFh9GN6KPZ/gwBf0Wu4at43hSu662wWcVhjUtH+aXHbicSIUByPoXf5NKSC2q/ZmB Jb7CoSzwHedtinvo9v/YnD5EtExLV1xm7Xj2/GGDptGgPJMzRv5d0j25A4Y20fAcNrVG A4Y1KkGGwmMDy/IgdohanLLx2kh2tPKpUhJmhdn2e5m6Tnd7ktIKuOlSNRksCXJEOSiy WBSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fri9Awkw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qk6si11268ejb.434.2020.11.03.13.20.27; Tue, 03 Nov 2020 13:21:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fri9Awkw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389054AbgKCVRr (ORCPT + 99 others); Tue, 3 Nov 2020 16:17:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:50150 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388570AbgKCVJu (ORCPT ); Tue, 3 Nov 2020 16:09:50 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 79F5A205ED; Tue, 3 Nov 2020 21:09:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437790; bh=EqpoSY+0nIOrkRInuI/MEOI+lSxb6GgoPW5b9GgvjLI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fri9AwkwLcl1kJtIzKg2ktmw4VCjoBHhStZAPrhSdJJ2ECy8/uOan5nl63RhxGKsC 3pnvZ5ExT1xRpDMxsHkuqGDpMukPsHkQAkgQ0jiP5VewRk7FgvExT2gj2Nr9LeP8vs arcMBivusvRA6UgCHFqqLtbikj0ih8pkcn521U7U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Antonio Borneo , Philippe Cornu , Neil Armstrong , Sasha Levin Subject: [PATCH 4.14 034/125] drm/bridge/synopsys: dsi: add support for non-continuous HS clock Date: Tue, 3 Nov 2020 21:36:51 +0100 Message-Id: <20201103203201.982946815@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203156.372184213@linuxfoundation.org> References: <20201103203156.372184213@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Antonio Borneo [ Upstream commit c6d94e37bdbb6dfe7e581e937a915ab58399b8a5 ] Current code enables the HS clock when video mode is started or to send out a HS command, and disables the HS clock to send out a LP command. This is not what DSI spec specify. Enable HS clock either in command and in video mode. Set automatic HS clock management for panels and devices that support non-continuous HS clock. Signed-off-by: Antonio Borneo Tested-by: Philippe Cornu Reviewed-by: Philippe Cornu Acked-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20200701194234.18123-1-yannick.fertre@st.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index 63c7a01b7053e..d95b0703d0255 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -311,7 +311,6 @@ static void dw_mipi_message_config(struct dw_mipi_dsi *dsi, if (lpm) val |= CMD_MODE_ALL_LP; - dsi_write(dsi, DSI_LPCLK_CTRL, lpm ? 0 : PHY_TXREQUESTCLKHS); dsi_write(dsi, DSI_CMD_MODE_CFG, val); } @@ -468,16 +467,22 @@ static void dw_mipi_dsi_video_mode_config(struct dw_mipi_dsi *dsi) static void dw_mipi_dsi_set_mode(struct dw_mipi_dsi *dsi, unsigned long mode_flags) { + u32 val; + dsi_write(dsi, DSI_PWR_UP, RESET); if (mode_flags & MIPI_DSI_MODE_VIDEO) { dsi_write(dsi, DSI_MODE_CFG, ENABLE_VIDEO_MODE); dw_mipi_dsi_video_mode_config(dsi); - dsi_write(dsi, DSI_LPCLK_CTRL, PHY_TXREQUESTCLKHS); } else { dsi_write(dsi, DSI_MODE_CFG, ENABLE_CMD_MODE); } + val = PHY_TXREQUESTCLKHS; + if (dsi->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS) + val |= AUTO_CLKLANE_CTRL; + dsi_write(dsi, DSI_LPCLK_CTRL, val); + dsi_write(dsi, DSI_PWR_UP, POWERUP); } -- 2.27.0