Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp831077pxb; Tue, 3 Nov 2020 13:48:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2Zo862Zn3ai6XckIxavITrO5XG7Qaz2NnTBdVQLtyTkPoSzSEYIG3T4wjr2ZqS53hQQbK X-Received: by 2002:a17:906:b216:: with SMTP id p22mr22240742ejz.228.1604440099912; Tue, 03 Nov 2020 13:48:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604440099; cv=none; d=google.com; s=arc-20160816; b=yTmHgDEhiqxr9YBI90eyn19wTnuLVTPxlexXKclWToSMJmIWg5neuN7mGaMO63vM38 Vjf5SHWVcCKT0JKBF8nSrq/iWEhGuYrCoaqygP0YSk3ItCsi4dh4g+le7tSu7s5l8OvA 04SNA1yRvt6w+2z2wTTBVjtzcprTn37kB2bP25HCaJ7QRyxPPs8JbMgNUchLC9mSjelk BAtpYuiVkFG6L9vzdZPNi7pKQkSG6Xu+IdEd8QAOGlRmhaeLNQXVfh9xCrcR7m2OmBoh Cgz4I7kWxceKiCTWywlzgrqbO/H8cTdO4ZrGUCipf3YpOBJYMzJYuJFHCixonaq0nYPG hVEA== 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=QOs4gPojkehH/lf5+10S+0EPRi7GpivavFnhcBpft/0=; b=0eapnhNEe22NXT0g8GTwHrTLu5v5OwE4FOIVNKdD2GzNXauDSMqyL1A1XA8tgSkewB ZFV6RomhgJic98dQzPvaK4WTXqs+wjEp0Zu8dzs7dzeREPXbnjRIEXJfzREq4NEQf7Oc 7f52yQMOi356267yzQtso/1Dzhbh00YmPmQprfXIK6iDPJ6FLXmCQ0Org8MqvzArd2B+ 2v1KFlhInt8uhtIUhtzMW5RHd4vBPlyOgBMvo4jh7Y22AVEyVA8SnkrKBXQinRgy6b8g No/A/kWHBBhTUQU9Ohhd1qzOOc4ESMGN4iVquFIHCDlNA40YOqtujTDhDnOLSMWc65Os rjcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="jyw/bdrE"; 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 i14si43296eje.464.2020.11.03.13.47.56; Tue, 03 Nov 2020 13:48: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="jyw/bdrE"; 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 S1732802AbgKCVno (ORCPT + 99 others); Tue, 3 Nov 2020 16:43:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:53502 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731913AbgKCUy1 (ORCPT ); Tue, 3 Nov 2020 15:54:27 -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 921F8223C7; Tue, 3 Nov 2020 20:54:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604436867; bh=lWaxjMV6jz9O4Lg2o8mIDYZ4MlB9Mz6+R/IFqZugWQY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jyw/bdrE9FVkmxOw5WbKFyhmeBG2NDutYvfAqCFWt4yblnlPCL5VfRhoBdokC1+Pa nTtl5za9JkVcd3LY80bFkmZAf9amU4lwZwtGBc50FxB2PQbw0qtEZpI+ZMiWjoISAR uZ8tHvbih8jJUqnWjTEIQ+NC6TWQ9l6VGP8u6AYc= 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 5.4 046/214] drm/bridge/synopsys: dsi: add support for non-continuous HS clock Date: Tue, 3 Nov 2020 21:34:54 +0100 Message-Id: <20201103203254.424706984@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@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 675442bfc1bd7..77384c49fb8dd 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -365,7 +365,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); } @@ -541,16 +540,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