From patchwork Sun Jul 14 10:53:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Nazzareno Trimarchi X-Patchwork-Id: 3277 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 9B21540F59 for ; Sun, 14 Jul 2024 12:54:01 +0200 (CEST) Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2ee97349a5fsf35452551fa.3 for ; Sun, 14 Jul 2024 03:54:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720954441; cv=pass; d=google.com; s=arc-20160816; b=tyViYz/kuF+xz7e8ui0+Cf/QB9w8tvIfinCFj01UbibgKPv/Yk+atzJmYKId4ZdLer oLXu5qjfFIzZU75W0CLS41Pb3rqLo3R6RciHmSX6UI7rOCrGZhbF39c6ur1QN3VW6dI6 fa3tkbXM28Jn3NrMMGykJgqsIOEuvMxnLw0p46D3nbPlZK6JdEBetlv0pAiPwu4y+uao Vyan7WrAt6ka/bw4XVyOy0VMWiGFxg2r9wPLNGb2AkByw8hmcP+fHKle/XepaQqoug+g xeNJPzDYtuDGt0p+yHNQVR2JcI2wCb3feAWU0d4lHyOG+VF4v1OHkaUpmP9RmVMjS86e hM0g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=PVfTnoNgWRG2WWFnrXHoSLZ2R+QEXjCyhr42niBzrLQ=; fh=jSr+inGOB/yy9611WUDYDIxp+iVTTqKvmv55N2UMDGY=; b=OQtWzxiJGhXW6SWiSB3DdagOJHLgM2JiCCWyLSTUKqZk3p//5pOxunu3zXvdFoUp+i mWb91C4mEBXa1kjn6cB0UIGGDL6Z6T4VBRL/96dBTybSYBuR8T7R7V+goRJ0zohJwXBY VHkeOK6N+nPZfu9txzRqcb9iQzS5cGe0q/grEy453VWtqWPiuJURbc06lssWnBsSd2/K S/e0OsP5SvjTrqGyLoFnGlXCk58UD+wxFBN5RrdzISycII/2e9Ikpwwn5sFIAs0gqItJ v7EWVwjsEu1NDaSoHT0VDWHPlj9fwz0rEv2QXuVMViHggs7jBZs9eFJr0xH6HXgYdySb i0KQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rCdzOkVV; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@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=1720954441; x=1721559241; 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:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=PVfTnoNgWRG2WWFnrXHoSLZ2R+QEXjCyhr42niBzrLQ=; b=J7qHiCXk9w363OtP3zEEia23jvM2JlEXlipekwDmJuOQt/Pq9JI0cNMylmaumY3Ww3 y39+zQRXnhVRqWutVqJL5wopcoxvdtZ/452IYTsr6qijoj0xqeHLHjrZ8QIZOAlpAIF4 BjYmbbQ2rbFPcXFEDXo2x/xQ+9wgecGr7aAjY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720954441; x=1721559241; 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:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PVfTnoNgWRG2WWFnrXHoSLZ2R+QEXjCyhr42niBzrLQ=; b=akTkG44MhpJZs3enWw89NZ21EHLkB4lFmwmUhRQ6h9zYkcBko6is7hCC9w5KTAhEuq K2KHvUNXl5P8wzTgubfn1xSZTFw2BcZhMczAekJ6hPC9a16LqykFED+0GioNpAZX0nVW MKXf+05r6hHPWYzKucBkMmZCvvYZ9UtC8nC740z4id5NzRfld1LoIq7IrEgyP9JGDvvF GGEjp6QwFyxMl7SctX6TIj7tqc5D2yiVS0BYdcprP05A91n4Lljsz7csVt8GSQpIYAvK ZgJgf3Etu0g8dOx45aPSAN0ONQjM2e6b1Pva5uo4f3xUkvqv6BLgVuM3OMAia0Zkw10S K9CQ== X-Forwarded-Encrypted: i=2; AJvYcCXa/p7b+EZQPVQ4RyEFkhRJtelNYpCKpWa1ZMrDQldL3Kbq8VwBikGEHuxv1Dw/4fbgun/LYgZIT9QP/U351293RpFyHzxuj+eeqWRkFC689rTSqzD59M4VPiI1gg== X-Gm-Message-State: AOJu0YxuNxikRmaVZds65q0xG3ku3qP0lS0y6i5qh76qXTRSxy5PVTow Ntzik/E2o4CNJs945mHYLiK91/oDAtiFifh9RwNAgIO0DzHsfqYtQSGBA/HxKAQkAQ== X-Google-Smtp-Source: AGHT+IFOAVtnxgmfPkTF9NvgAPCZTnVaaQGshDFgpuHct3pRlabLyULrCiBIUJMidbTwUVp8Tbj7NA== X-Received: by 2002:a05:651c:169a:b0:2ee:d5c3:3878 with SMTP id 38308e7fff4ca-2eed5c33915mr39088371fa.37.1720954441046; Sun, 14 Jul 2024 03:54:01 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:32e:b0:58b:ce37:ebce with SMTP id 4fb4d7f45d1cf-59825c4211fls210895a12.1.-pod-prod-03-eu; Sun, 14 Jul 2024 03:53:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUH1D+ZaSPiVeT9n2VlheC8QhKuPLKeHr6uAX5P/X0DP/FSMhyR6R5yF95Qei7hxM+SSxRTS/j+bJc7fb8VC5MgYTVj9uTipBLhGDCWlZQ6kfL6 X-Received: by 2002:a17:906:1d50:b0:a77:d1ea:ab26 with SMTP id a640c23a62f3a-a780b89dd5bmr1072127966b.65.1720954439334; Sun, 14 Jul 2024 03:53:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720954439; cv=none; d=google.com; s=arc-20160816; b=coY8rb1O8aWzu6900njIrQ85JEl2tXhHoZxPSNhc+2Qt8nTo7oE0FK+Vsku75BI9x4 SWvLmsecmW32DqGNP3Lii7ixpJpgKBJPiAO3IN8r9afxc9xGCzf+pGb3abfSjG84MWwh +ZSqTEXadPh+83jd1pkNL0BKUvrmd0ssiKMbVFaqElPuTL+5h0ZdYoXtTSceiYxqpnJp t88eUUYiSEwGavC3iSKY3IjfPVoYGkv+EgbL/d5UsEtd8Qr3uVtnnz00EbhwCHKqtXML S1Q3nx5xfuqPrFiPMYHcGMG6Wp+KxzHkj+Vsjsq5UgcijS/IUw0thzl5DVokkLzwcPP9 lfKw== 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:cc:to:from:dkim-signature; bh=UFF3VkS9CogNcGTm1c94A5k2cs51ThCGRz+LfvSTAgU=; fh=RmzkY6iJCMjCEdLztQL8Cjqyy0uco8Riz/VIvCmeLv4=; b=g1ebszBxWXg6I5wLWEdrBBKJg6IPaGSp0oxRQnITqaFY5dws0paqXpGHCrXPXhe1Uy 2IDwnsQCHAsfBsvXqXXqIqui0U05EZ1XoBPfaburpVEWoZCGWafLUe0YEDbuKHoCg5Pc eYHyzrQ5UL0iWGsSQqOxVW8PvnOdUldvkXit1KA+RjdeOHZDNU5LFRB/uIdWqTlw+YU4 CtjNSNRbE1fy8+I1unb0hwfJhsA+homD2wzsIGFV5vbo1jloKsbFzABHVY1tZBIoMbD7 +9u2t9kM6+2luIsqNN3uUQQnjVxRCN8CQ5tJR8BP0sFB/RBl+uhSfybBbHy+1yiLpt7y qfyA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rCdzOkVV; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@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 a640c23a62f3a-a79bc59ebdbsor36615766b.2.2024.07.14.03.53.59 for (Google Transport Security); Sun, 14 Jul 2024 03:53:59 -0700 (PDT) Received-SPF: pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Forwarded-Encrypted: i=1; AJvYcCW+PdvaS+uqhsKvS0zMu7h5HKU4F+sNE30SOThxIgkYwmnblRwy9dnMu1Pb0IGcy2Rg72QPp4hlWlfh5iZcmihZjOnRotK51NyH/1tFCPNgLjMP X-Received: by 2002:a17:907:1c10:b0:a72:4b4a:a626 with SMTP id a640c23a62f3a-a780b89dde4mr1409583566b.68.1720954437017; Sun, 14 Jul 2024 03:53:57 -0700 (PDT) Received: from panicking.. (mob-5-91-58-211.net.vodafone.it. [5.91.58.211]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a79bc5a36c7sm119966166b.7.2024.07.14.03.53.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jul 2024 03:53:56 -0700 (PDT) From: Michael Trimarchi To: Michael Trimarchi Cc: Dario Binacchi , Patrick Barsanti , linux-amarula@amarulasolutions.com Subject: [PATCH 20/25] phy: dphy: Correct lpx parameter and its derivatives(ta_{get,go,sure}) Date: Sun, 14 Jul 2024 12:53:23 +0200 Message-ID: <20240714105328.35825-20-michael@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240714105328.35825-1-michael@amarulasolutions.com> References: <20240714105328.35825-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: michael@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rCdzOkVV; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@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: , 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 de467c2352..7a7cc4dc5b 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;