Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp871141pxx; Tue, 27 Oct 2020 02:32:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLFwJY1SWkG4c55AdcXPcWkntsDs7ko4nUmQHZuQUmgHFexIpCD9oKCIh1kkg8UORSyLXV X-Received: by 2002:aa7:dcc2:: with SMTP id w2mr1248201edu.121.1603791145300; Tue, 27 Oct 2020 02:32:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603791145; cv=none; d=google.com; s=arc-20160816; b=IzRKhRxOwNLrLO7FoRtINFdjXRb7KE5mJOJ0t0TqlTVslMF1vDAjlQu9dGJASBM2j/ 5kBNZBsMv25RrJKrApzGvm8VIh973Mz3ZJhUjvNSfoS6Ynxr1jphAwoQUdr/PBIbcZgY O4bq+T691EQPTHNFNmEXTxPmrjSr8QGiuF82DIQKYx9guldO9TeXgpgQxi0ZXErszRpD GukoMyD2ZgOyQcIz1cjY2lGGMVK6dDrV3/Sa7cM29X0NS//BQ0XPKfnyQ/Wr0q8j7TYZ TGC5PkBUD/6NhqWkPkihcTVw3lw7HQJ/SRK8piGAKOjSGYveWhPx6qp1e2ra/RiH9YFQ XeBw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YRTboN380NnBxsxx0FypvwbCnd807EH7HYn41dVLfBU=; b=rc59ITaphIEJSq1300W4WqWFcS1vqcu7z3PoFRYloJiZmh9Y7x5mSnrjAieDT4zZHg 2xi6L7C/svQipc4fdwadDiYjF48/lfV0m8AO+UbF7zcdCxixXcWVkkLucZYbCtwqeuIm e4ZMM6pEc14qaNOjWH+wXXGiyhFil1ZRLfp9O7kGPfJwprqPiJzY8r7A1aQ8uXaZo47w iaFQZ0PgJaqPFl4ljH0GCfRwlp3DEtpvqFx2gW0EhbCZGjEhtPCBBc49tJIiG91FSj+P BB2rWF9zjgW9fwaf+vKSxi/mXD27fGmkYIHdxfsppo4wow7YBe4T/IU11x50MHVcwLxV faog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JhK1Xl4d; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u10si508982edp.411.2020.10.27.02.32.03; Tue, 27 Oct 2020 02:32:25 -0700 (PDT) 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=JhK1Xl4d; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2409152AbgJZXui (ORCPT + 99 others); Mon, 26 Oct 2020 19:50:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:48872 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2409045AbgJZXuL (ORCPT ); Mon, 26 Oct 2020 19:50:11 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 125B021741; Mon, 26 Oct 2020 23:50:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603756210; bh=gAPL6BNOfP5T2Mrk9jG/GKNKMQj51k78R9X5CwxhFNM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JhK1Xl4d+kd5Eu5m8LOTwb+5f/2zW5DHQv6lzMf+GTrFvcxCGRv3dUvHaARKHKAEY wb8rX/ZEYWz4az2PylRId3zWlSncvZmLvMVZnKfFNP1crB6hKpDuSrYMLuFN+4pgIt eY2cOTefDyjJc6xvyhn9hJZBw9wc5Jlfhe17aE4I= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Antonio Borneo , Philippe Cornu , Neil Armstrong , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.9 052/147] drm/bridge/synopsys: dsi: add support for non-continuous HS clock Date: Mon, 26 Oct 2020 19:47:30 -0400 Message-Id: <20201026234905.1022767-52-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201026234905.1022767-1-sashal@kernel.org> References: <20201026234905.1022767-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 d580b2aa4ce98..979acaa90d002 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.25.1