From patchwork Tue Sep 3 15:30:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3388 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 49ED83FA49 for ; Tue, 3 Sep 2024 17:31:19 +0200 (CEST) Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-53341717c62sf5136194e87.2 for ; Tue, 03 Sep 2024 08:31:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377479; cv=pass; d=google.com; s=arc-20240605; b=NIZHEXn7mGx7rEsN+XW13WOUSXnh1vg/jTV0L2dp2bflzi/37prXWVZcWXyXqhG52z YrZgVfajmkeEqbCrzupAA8jlau5QPYtObnOVa9NPFAYJ6R2FmR+B4Kd0uaji6j8HvKXm 7IaxZESvV+GpMjemGL/+pVAGoB37gQicxV1QvMU6itzkb7oi0GMczcEePG+cQ+m+7PTu AXGphOKp55S9/czE8Weme50sq1bmCXRvTlPXBBrWD4Zionv085+Oz6b5jBudSv/eNZfx PnN4BXrO8jZY6jMSDr22Oo01yjd8WCajhz5HhHk0649H17rRxu3X/KHVOROVh7c4ac0J 84xg== 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=xOJdm1Oe3uKdMTxHaw1jp31ixok7SkxnIcQhYrnUY/4=; b=PBNhpPP15nr2BmD9z52f3zacD5l37jxsh6IMk95WJG31kgp7leV7mjhupx14hrORls oXCWV8b6yv+MY4LllaRi9FLd08mRhP6vjzyqgcrgzgq6+m6qqsitUzc7AixABtIwvUvK zEjo87t0P3al7YBenacGFSJeqVccQcecz7i6CrorP2jjMUDan76OtELJGimk/+/OVH6p zS18QUhBET1FkiES/q9YYfWXs/HkuCS9iW/jMAntdULULV/fSLHPmfcN4rLcfMZ8PriD GYRbM1DdDRiZwKw/IXUJgiuagb3Woxb4CdC344OrI7uVNAci6XlLzQFUU6PtTt3daH0y a9dw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UCiW3d70; 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=1725377479; x=1725982279; 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=lQu8PGnZNbwyrAOsGCkazjEoNb2MZntSyPPImAFbqc5352an3O4RJ1+yI93O+vmui/ fR96FB4eVvxPUJam91ypmGwJciPWqX4q29yKAwCckfhGPyzdvunkVMXbovhcCW/fno1t ZpUYESP4PPvPPHtIYO5Mf460ggR4wTuZp10fE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377479; x=1725982279; 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=U9FPWlc8TAw4gF5PdZm+4iDxp9WKwt4bzeQV2HznBi4WPSfiFJu2E9bhD/mVBWBVss yqtKW9Q1/3mcgkV3TGdq79/CylwiZZD3G/lFxslo5Q9k/ncn8cDim8FUQcrvgOR8sReT 78W4JCOFB+JX/E/jjidg6nkZXLn1CPVSDAujD2uGGpPQBY9BUFU+BU9ftjsc7fHGGP7i 2UzOOoUjCunnuyx8kxstWA/cKluZ3oYCNRlOzElkcg6jeVR7fiG1vfgR6BauwvUh1aUH 2lHWkqcnG7EDm6OIbtVq64Ow1gC2GDtHJ0fD+J+cx95yo+eIXIcrClclcP7QvI1RvBtv eo7Q== X-Forwarded-Encrypted: i=2; AJvYcCUsMotaitAVdnNcdrMEl7tQQ3TrK6abhuV3j2TP94aVBffocHWtF2W86V0FCKD3BBIZfTsWfSKhlLxYbCP3@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yxsf+Dnb6KxEuCcDcrBaJeV1Bk6SR+mpecM6mYUziPw9gGScz6N 3OvBXgQKCae2dcWLimrupIMzqqdg38Iymxz46L4Z1aBIEpYh5j+rliEUtELS+YYxnA== X-Google-Smtp-Source: AGHT+IGtJxWu8w0X2A1fF30YoREEshaPcLWH5Hrvs1UPc0ABup1Tr++AAuFWFEJYALoW6fsME7TW1g== X-Received: by 2002:a05:6512:3b0b:b0:530:aa82:a50a with SMTP id 2adb3069b0e04-53546ba0471mr9670760e87.45.1725377478608; Tue, 03 Sep 2024 08:31:18 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:3596:b0:427:ad0:2dd8 with SMTP id 5b1f17b1804b1-42bb284074cls3435555e9.0.-pod-prod-04-eu; Tue, 03 Sep 2024 08:31:17 -0700 (PDT) X-Received: by 2002:a05:600c:4f4b:b0:426:629f:1556 with SMTP id 5b1f17b1804b1-42c7b5f0cf8mr65591415e9.31.1725377476952; Tue, 03 Sep 2024 08:31:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377476; cv=none; d=google.com; s=arc-20160816; b=FZzi3vOiTPCSyl5g51+9W7arbMi+OxBzNL9vX/4wa5J9FKPjWY4comc+oYwCdJFJcv TfNM9eLaLylvfxQ2GJT4IgwtYz6JVuIk0hY3L+Yj1z//jqj/yYWAOvb72BaVCSEZFrUi mQCaoepRMZgyBRSknJfTvNw9RKfYu7h9WEKRYubiv0YtO6U6f9i10meX89mCBg63H/a0 MNEVeBetp9Ys9NU6tByNlbBoNbXY4AaCrJyIsl5THbisfHnA9bfjpcq/FjP+x43pxUZ7 hjlM1LxnbGi6yVTkG/xbfy4ij4iXxvk4LlCSCiH4Xoq4Eo9ECmkN9g/NSExwLqbA4Wiv 9XSw== 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=ctXGBEQHwsXxMx73eVlvfeYJP3q68KSLDz0flAwn0bQV069qTeJNuTpERtKZbiWA3r O8cE8yVwOxew48tZqbceq/rdVilbj8MPsXP1hJ+rRugy2SdlVMFBX5/x8S65h/O7F5Rs a7lYJQRA3dOcZXdw/Wc7bvRZN14eRKJM/pg1mrVPTsu6sNeat3uMpLh10ag7qqsVxOrm EJ64ftduVcKyFrcIJGKOv49QqdmSERAJNccFA3PIqovooLWUlLnHDLAI/QDdUq+MavTu MPAdNzx4eDdycRJAjiywHQeclEfocHyxJFXPLivEasPPtCZ+AoQtaJLuvXopbP178twX PYyw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UCiW3d70; 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-42bb70879e0sor26175975e9.4.2024.09.03.08.31.16 for (Google Transport Security); Tue, 03 Sep 2024 08:31:16 -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:5493:b0:428:52a:3580 with SMTP id 5b1f17b1804b1-42c7b59e329mr68508845e9.3.1725377476236; Tue, 03 Sep 2024 08:31:16 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:15 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 16/29] phy: dphy: Correct lpx parameter and its derivatives(ta_{get,go,sure}) Date: Tue, 3 Sep 2024 17:30:47 +0200 Message-ID: <20240903153100.918077-16-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=UCiW3d70; 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;