From patchwork Sun Jul 14 11:32:57 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: 3302 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 187AF40F88 for ; Sun, 14 Jul 2024 13:33:31 +0200 (CEST) Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2ee87d500casf34695881fa.3 for ; Sun, 14 Jul 2024 04:33:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720956810; cv=pass; d=google.com; s=arc-20160816; b=wULWALUOkNDsTTUN7FppKrAW56lGfCIdqrIENXBBw0y3nvZ3uyTcly+2Zqq+B9U7Qf 8jYGklR49iuj78uTikTbn3nICm74hlUpH+axyt86jC3SbJjFhR594ovoluFoNAABxWai XCT610CcmphM5acz03xtwCnVeih7KeixocxVUHamu9N7b+UY/EPcHiAoe3ptfVG4g3RX aAqybTwlzMd4uMIrMe1YhFFlJDcYvXQjvmM7eGxn76Qmk+GMQSs/sMByXgI4L5H4nTOt CNi4aUpIFTgUUF5E/YX+vj7fUdPWTDItn0eR+cuTOlRPVrGqFBMzgssi1xCzO3L+4auz ZwDA== 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=sKVKKuGRG3lH9Gq/3swkbJ1Z+NJk75thbeB5UPVh82c=; b=sNzePiHu4K9Xo+zfqpCFP4TjckIL2Gt43D3S9YYHRMF5sIbpZW5JYZGKkzoDpp31Uh Ot54tgwzRIYsaTbTqxc0a+v3JGkOrkEmkKKcxLCmHtIneJM+BqAq+53G6wUvNUpajmkw 0UmyANaCBl2aJezU/76k4iG9AC5QljyZhHPIuC+SAOZaPkcKAJVLukf+2csceNTIWN9f sGnJJzxki0qS8cYsoU9MgT70eYYO3UjBlk2VD9yAfKqZJYzDjRFEYbbUnOJRXdThniiP +NyEfUFeDo1bRBBECxLto0Vlb2R9NO9snF9cLnyQRdOZh8XlHNMRFBMQ96sNPvJatDBM TRSQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=H6l5y0LE; 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=1720956810; x=1721561610; 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=Se950KJHXT1Zaa6HIKFQYl77p6IUSXVwEkU39CmINy253uuS1QESUCa5YeKL+pmkeG AgTTdqhHLsyhyRdKRbcS3ARhPaqyTZamSBtsCas27L3yNxepCsWrT1PyJ77uRqaKtjnD hdlZ3aePQYMATU9KRwqZyeDPPvVyYqw+NFSoo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720956810; x=1721561610; 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=D25tLbjkZhne8WirK8+A/vg2Y/fJ8TqiLPRs1DMZ8GGGclbLqzE3oWcJFPQg8pM2on ZZJAfaQqAGM/KSa+/Ec/Lzz9WQ1PDCY/G/MYd1swFG8zhOpa6ULHY8/SGx1wcuf3YPAy kqCQ7lk3GerKJurXAlW9tarnzTVxQBOOZczP0sB0VnKimOZQy1+Q3yXDrLqmZyvsPDXZ At6DKK0+C7U5vz75UxyC/3ESGvlsbLi18QatwXN+7Xq3NKjrSKkaUpFgFYxnVLy4hEwp Rddh3ZFKjQihnzT87YPXIYeuAhvL+1kqD+Kh3b6kRQYV3rxZwdfW1ZOYh2wy8nUO6K02 Q7Wg== X-Forwarded-Encrypted: i=2; AJvYcCUY3fdKhcdiGd98sp+rUSWtbHeTaQCommKoykm4FyFVBj/VLcD+zFHyLaBEjUvoJAUFVlsxIt90INTsOMC7BhpfF/O57wM4ioHyuu6tkYx8xMlBhz+YyHLBlosf2w== X-Gm-Message-State: AOJu0YzYQroTkWYN6WJj9TlHfGubou4Hkp6nG1TEslfLCr3LT1uLk/Se jGgC5wtE6Fi8cxPrcUfOGk3iODswluVDQPXhn67dRXXcp2fcHJyV8SbPvaC+0rxQhA== X-Google-Smtp-Source: AGHT+IH8L/klxY2HSE/Q+qFr9T5/gjRae5mlVoWO/nXnz2G2+byzeccrZVi8zv6JaqhYhplGeUjBcQ== X-Received: by 2002:a2e:be05:0:b0:2ee:d5c3:3888 with SMTP id 38308e7fff4ca-2eed5c33979mr48675061fa.4.1720956810530; Sun, 14 Jul 2024 04:33:30 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a2e:a481:0:b0:2ec:4d9a:63bc with SMTP id 38308e7fff4ca-2eec93a6e39ls8813651fa.1.-pod-prod-09-eu; Sun, 14 Jul 2024 04:33:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUFezDt+oLWPSjFiqKAXEk6CyNyqThrB6nXABME7XDKU5QRPfrBnuQrISpuOarg22Y8xcw2c6jZp7sB7GKjkARSJ4bUC8SJSEYM8UWEpLiHTaRE X-Received: by 2002:a05:6512:1049:b0:52e:9ec8:a3fd with SMTP id 2adb3069b0e04-52eb99cb023mr11815044e87.45.1720956808618; Sun, 14 Jul 2024 04:33:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720956808; cv=none; d=google.com; s=arc-20160816; b=BxYYpC1a1Ozn5/YavDNPeOup2SMf6LrLP/fS0ENnjEehEOb/c5j0Ga9S6deI47WwRo XyI6ZSAk6r07nxCpBZLMyj+hwwWP8Dfhpvb7awb5R9LmNhMEFJz6r6en9fQRmZogZM6E mwa87I0u6GupVk0VDFqM7hmYunGbI6Jr+X94qvBst8h9nEGsreZ1f07NX5DK9FMzZ6Dm HtIxyjgJ6LIiD5pYV9jYp3DDuiyUJvu/DlNsjlR50vNSZOKl38XvHTztIund7SFBkEOa QVTbsIaYBIw2pJD/BfYaVqtuJqBkBIGiLPmn8viAR2OBCYJEaQI6/Qf3deVEwHPhjBWT rrRg== 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=ID2ntNf8s7o9iYahA6E9lnu00h6EQE3BPH1yz6GEuiU=; b=cwzSYmgWoqwi6xj+TbqyN4/QkjvNWDFS5R6XOr911YeGA59XxLuLajg2WJo18b5pfq DbXFgbkZseEkb6hyIpLCz+Zl2AT3SjxdKiH3qSSnDAkqlo7e3FjGJCBNADOsNXzrazYO rxS4Qg+z5mc2Wh6djNDpSLUGMRdZfcExVzVgA7UQrlUcn6g2w0Ox2wBYQpaT8S2W+t8N LAJIajwTAjiF6Jmb4RofiRMGZ+XQk/MPZsQXTTICBfj32ELCo76goZl2kaMkLuCRjHdp 2D4dZN+noNBc3yQLXuJvaEh/UtkQ2xwgn+8YX/EbBCHbwfk7XwVRGjydHW//8D6gTmj3 /8Hg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=H6l5y0LE; 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 2adb3069b0e04-52ed25641bfsor436145e87.18.2024.07.14.04.33.28 for (Google Transport Security); Sun, 14 Jul 2024 04:33:28 -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+ACcdiszKNp9ntsurRPNqv6sc0sOXngyI3bxE7gYvWTpMR9rfNUty9AK4X8BNTKW0HSBzN0i040ZpzZBBknla5P6Fk1brGv3k8wTSiu8bpr6y X-Received: by 2002:a2e:9cda:0:b0:2ee:bc9a:9d7d with SMTP id 38308e7fff4ca-2eebc9a9f96mr90136801fa.37.1720956808115; Sun, 14 Jul 2024 04:33:28 -0700 (PDT) Received: from panicking.. (mob-5-91-58-211.net.vodafone.it. [5.91.58.211]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-59b25528dc1sm1929469a12.52.2024.07.14.04.33.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jul 2024 04:33:27 -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 13:32:57 +0200 Message-ID: <20240714113302.133399-20-michael@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240714113302.133399-1-michael@amarulasolutions.com> References: <20240714113302.133399-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=H6l5y0LE; 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;