Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp634532pxx; Mon, 26 Oct 2020 17:36:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjToGQiMEOUfytJ0IVSqA4w2/InBFJWpUHv+tZa4I/RfOJtLaULyBzgONdLHWFgJigWSau X-Received: by 2002:a17:906:5402:: with SMTP id q2mr18147348ejo.316.1603758967052; Mon, 26 Oct 2020 17:36:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603758967; cv=none; d=google.com; s=arc-20160816; b=oL4PHCp57uNZWYsTs2ihFhv5VBN2cHc4i3jidgUnfhxaIFHnJTWmDzGh9ABtaQE7je o7jDAQ07jFG7AWSbzsAJfMXulCrYeRoClW1h+J4zdK5BzT6ljjXam+z28MTiQAkTiQPR 41LHxJdVr2ZrjdlYebzZJWXwMhqO+z+MwY+Y0L7AhfWg3V2aMvjBF1FIQssmSqdNsaJH FRDrbTPZ46/B7suw9h2IMT8BxiMHFWoReSIe54HAx8MR25AcjuJPVyI8euDABu/0xyoZ wfAhSk8krlY7DTX8x7hDzkYt1elMNf5upGuaVak1QSjSkSo7NyhuWOaS59x2+9Wn48fF n8NA== 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=viVs0aptWsK72Z2gjsLLRijv3UqOK4VS9P2kpd2fh/4=; b=Tsk3Qb6luOMA8WiDwp3yUd5DduXO30Hko9jD8mRNW3qkczljrFlY2XdTxCQzGKeJxu NKz+zRhl7ehYL++xgFcTCgL611T22RTq7gY3veLE9ImyVVznQ1aG0dzQqq+FO4f14z8I mkbQccp8HKOMQSkmNQTwIZiMKSVG7lSkK0ZdZshwnH1nTfbX3/eD9HhFibfawJAkpVyC 91fZfiruW4MJ9zU57KG+OFD2/qVAjr8fGkoy7IDUzZta8DBu1zGudeI+8KEbSpBLve3l yTcpYVfhMRdyGF+Wl/GK47fQ5rtel6zoZs5/jeJ1e07ftFBZ8nklv9W/7QeBwOlBsFBL kBVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fVdfFg7h; 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 a25si6229093edm.299.2020.10.26.17.35.45; Mon, 26 Oct 2020 17:36:07 -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=fVdfFg7h; 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 S2441237AbgJ0AVv (ORCPT + 99 others); Mon, 26 Oct 2020 20:21:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:34602 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2410979AbgJZXzu (ORCPT ); Mon, 26 Oct 2020 19:55:50 -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 984F72151B; Mon, 26 Oct 2020 23:55:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603756550; bh=scenCdaykCIS9/ktaWIti9ZG+4PJN2VqVmUcyHrSsnY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fVdfFg7hfPt8pFEvX1tzyuSDmiuSsg5/ZaRKrk0YSYWdhp29Sj/KJU9xKbZCs5EFb S/5WX82c5mFf3NYylfixTAbqXtAxHIZi/MB9nOXWn0sW1i5+wX3hZDQ/qsIJ8JzU+F KCtrvGnoCH/rSIN/K19NYXmn+AMkyRvBa+NitGI4= 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.4 27/80] drm/bridge/synopsys: dsi: add support for non-continuous HS clock Date: Mon, 26 Oct 2020 19:54:23 -0400 Message-Id: <20201026235516.1025100-27-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201026235516.1025100-1-sashal@kernel.org> References: <20201026235516.1025100-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 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.25.1