From patchwork Wed Sep 11 15:10:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3446 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 93BB342E8A for ; Wed, 11 Sep 2024 17:10:58 +0200 (CEST) Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-42cbcf60722sf20886625e9.1 for ; Wed, 11 Sep 2024 08:10:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1726067458; cv=pass; d=google.com; s=arc-20240605; b=Bz16NkVDj6+6mAYU5KO6idbWe7b2KbylsgNaY0yaEGnXoxwm0MMI9GMOBdi2a6fkAE 8ONBp37IIVF2Ner3TP4Z83Kb6wX4GhTsZZG3Yf5Z1iYoi+GiWZQ3w/LKwpa6w5llg/oH gYaQ5RgWNXvOmOzhOxE/cyyHWLp/iz73KRBoGqtr6yQVLtSEiTupQBOu0vtthmx+M9/Y MLBNS/Pq48PMa9hmA8h70551qxYMx69hg1HcLSp664/Vok1gc/8Oi3OB0qFIJcitwxro KLUit93lp6UD+HtJcXgKf0lRYsWKlJZH+5TpeuOf1UKpSNiKNy+a8GoXYjtf9pBrq4SM wMUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=9ng4CwlxHxc6pwVyN9Fn6m6v+d9l4sL1wbU+U0oV8jY=; fh=mG2YtyIDtaogaGhVi6W8XraYdCUC+3z2eC1KHeb/fxA=; b=VLDGZigmg4hcryl+GBYvHRA8k+KRAGY8LheVzfbKXln/cwK9ANUm8ch8OQeRFTvQcE KWShbwR4XduWEk39Mk1+IjSmEFxIkqXFaekjIujwI0fmtP82hFg0D51BQE+rxJtrGwxg szgbQd9xv+LiB7Xg0jVddYOB6jcZ4IoQ3oloNiFF9mPLW+fHuhICixL5BifmxKfxlk/A W/iN6pZ17vVCGfuhYFuJAv7xrg1qzsoc9I/aZxJ5bcNIT0FiQN63ZBZFO+e0w5b8xeQM LmIOK+OuSpsDJNvS1JiZgX++IerA5/l+xhPKFNp/5+7XbYNnk+33KkUQ/S8Np//iz5t4 1NIA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=WARFrEyC; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1726067458; x=1726672258; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=9ng4CwlxHxc6pwVyN9Fn6m6v+d9l4sL1wbU+U0oV8jY=; b=F9dfcLPYWH9jMqknllzCklxv+awLgeBjIY3/Mtq6GLn60pzsBcHZM+QjGcacSYIusn DFMNU9WkENY7CarsPXnwF8LZbQlYtZiXOINerc7CZ8nsCfdc43a46deL1S7UiFraFcOT XTI7iVJ2aNXDc98ycmbPj1z0UeTKhtwnwycqA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726067458; x=1726672258; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9ng4CwlxHxc6pwVyN9Fn6m6v+d9l4sL1wbU+U0oV8jY=; b=RkxqXDnFKuAG4ApgILK5chwiXQEi5U1oBZyZ4GOCeVAAFrUp0+3ARMbgmqMSzofags wS7ECMiiEwISWJggfLFFno/XedbChcRO9wGF7Tj9TyexMjzEpZfvDjRLvZOfRirhCmQe up00dWRRAOheKZiFltKJn3aoB3LKCXvhVP5y11hQiCfxXTsV2Van+v/N7DscPAJbgvte hj9WoYyKVUscy3wdPIesM6TWm0PoPhzqfHEZFbnK/0o96eORxnDzz+h1BpN7PHF1Y5nU A7axxtOua3osw9tPjc93lTsVn9+Pq9NmYpqAbTvRUKXtzXlD+yCTXY2WZj9rvYtpG22P fBFg== X-Forwarded-Encrypted: i=2; AJvYcCXMk9T8GhPp2cVBbU/RhrLwam7FuVZnTWoVRm08BeFa6LIEPxSJOzLizaeIOWvdIgF3OacEKrh83t8dDAGV@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YycWo8LMEuViv2f4v+VXL002rHXWa86ikx90O8Uc6AGywG0IYf7 1gkCDZrLBWw2sReNFESkKX+QQ4Z47pHBWmvaRm9edA2LJuMpDR4fvMKOYw83fT6O3w== X-Google-Smtp-Source: AGHT+IGQLCUJQPMY1eMXw2r15LSPQiLtRdxCkOx/QCvobZVqk1B701Dr5u5wPbllHYgjaynLeZvKvw== X-Received: by 2002:a05:600c:3ca1:b0:42b:8a35:1acf with SMTP id 5b1f17b1804b1-42c9f9ca788mr148108365e9.25.1726067458128; Wed, 11 Sep 2024 08:10:58 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:1c12:b0:42c:af5b:facc with SMTP id 5b1f17b1804b1-42caf5bfd0cls22162425e9.1.-pod-prod-07-eu; Wed, 11 Sep 2024 08:10:56 -0700 (PDT) X-Received: by 2002:a05:600c:4f4e:b0:42c:b4f5:47a9 with SMTP id 5b1f17b1804b1-42cb4f54c54mr100493985e9.14.1726067456474; Wed, 11 Sep 2024 08:10:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726067456; cv=none; d=google.com; s=arc-20160816; b=Ojs4Rdq3SwGwNRfYb3e2W1+nwsNbc3gOKESgxy96IcmVKZs0zz9gR6gQQZEkWPrs69 TS3qzwVgh43S058f8zOgaYvQbQvWD297bJN5DmNhyXqAgfd3Sp1Fn/XSPYLT6tP9U+1S wMhiaM3l5ZN/ksYILoouw/sROVTES9ekyJ6/HUe08z2+Y6dKwq48goNHL5Un6H3Y21U6 AWnQNkxKPYr34uyp1XkrL61MJlmWVJxLqSr0vTWFnvkMqHm5i18sMVARPNyRKYb/XowF /tQdTvtteSq6G0LQnR48+kRugZl424DRvJ/ArZDgSVMs7M5P1O6S/N7k7lPyJjvCiNzz g0+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=5iW6rpXTdrXWar1+QLqcytSL5S0X3ZyAp83NCIocMAo=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=KKqKX+r2G+/iEJOTncJZpM8YC/5z7jn+2C44RfaURyuWQscUkpcvFFRZTpqdHzZYlK ceupvbein+4Yftf0K+ZN4W3yMdKCzq9h3N3qqwtxxuTfg1bxKDhtHzf+L4Y6TTuIIWO5 b3/9bE0haSogMsmrn9pp2z95olmJLv5L1SO1Rvba4sHNBxXC5tA8/9UFBrgy6Ko7oWUl LWYlRmxY/LiJ5VTlMH2iMJQMQwUKo7IMUIiYmN4G/8z8X7hqYybNgN0kkhwZWTk2aRjW wxQurlbvYKVV9B8DvznK4+wPGhGZKqtjKcDYoHnORxWt6UjB2G0r0rkXhvDn85pAPOYr vjCQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=WARFrEyC; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id 5b1f17b1804b1-42caf30aba1sor39619815e9.13.2024.09.11.08.10.56 for (Google Transport Security); Wed, 11 Sep 2024 08:10:56 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:600c:1d22:b0:42c:baf9:bee7 with SMTP id 5b1f17b1804b1-42cbaf9c20dmr67893985e9.12.1726067455732; Wed, 11 Sep 2024 08:10:55 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.41.3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42cb116f44esm137688375e9.45.2024.09.11.08.10.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 08:10:55 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH v2 16/27] phy: dphy: Correct lpx parameter and its derivatives(ta_{get,go,sure}) Date: Wed, 11 Sep 2024 17:10:28 +0200 Message-ID: <20240911151039.2914886-16-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240911151039.2914886-1-dario.binacchi@amarulasolutions.com> References: <20240911151039.2914886-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=WARFrEyC; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Michael Trimarchi Upstream linux commit 3153fa38e38af5. According to the comment of the function phy_mipi_dphy_get_default_config(), it uses minimum D-PHY timings based on MIPI D-PHY specification. They are derived from the valid ranges specified in Section 6.9, Table 14, Page 41 of the D-PHY specification (v1.2). The table 14 explicitly mentions that the minimum T-LPX parameter is 50 nanoseconds and the minimum TA-SURE parameter is T-LPX nanoseconds. Likewise, the kernel doc of the 'lpx' and 'ta_sure' members of struct phy_configure_opts_mipi_dphy mentions that the minimum values are 50000 picoseconds and @lpx picoseconds respectively. Also, the function phy_mipi_dphy_config_validate() checks if cfg->lpx is less than 50000 picoseconds and if cfg->ta_sure is less than cfg->lpx, which hints the same minimum values. Without this patch, the function phy_mipi_dphy_get_default_config() wrongly sets cfg->lpx to 60000 picoseconds and cfg->ta_sure to 2 * cfg->lpx. So, let's correct them to 50000 picoseconds and cfg->lpx respectively. Note that I've only tested the patch with RM67191 DSI panel on i.MX8mq EVK. Help is needed to test with other i.MX8mq, Meson and Rockchip platforms, as I don't have the hardwares. Signed-off-by: Liu Ying Link: https://lore.kernel.org/r/20220216071257.1647703-1-victor.liu@nxp.com Signed-off-by: Vinod Koul Signed-off-by: Michael Trimarchi --- drivers/phy/phy-core-mipi-dphy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/phy-core-mipi-dphy.c b/drivers/phy/phy-core-mipi-dphy.c index de467c235266..7a7cc4dc5bdf 100644 --- a/drivers/phy/phy-core-mipi-dphy.c +++ b/drivers/phy/phy-core-mipi-dphy.c @@ -64,10 +64,10 @@ static int phy_mipi_dphy_calc_config(unsigned long pixel_clock, cfg->hs_trail = max(4 * 8 * ui, 60000 + 4 * 4 * ui); cfg->init = 100; - cfg->lpx = 60000; + cfg->lpx = 50000; cfg->ta_get = 5 * cfg->lpx; cfg->ta_go = 4 * cfg->lpx; - cfg->ta_sure = 2 * cfg->lpx; + cfg->ta_sure = cfg->lpx; cfg->wakeup = 1000; cfg->hs_clk_rate = hs_clk_rate;