From patchwork Sun Jul 14 07:10:18 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: 3253 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id BAAA1412C7 for ; Sun, 14 Jul 2024 09:10:54 +0200 (CEST) Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-58d6fdee657sf3174058a12.2 for ; Sun, 14 Jul 2024 00:10:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720941054; cv=pass; d=google.com; s=arc-20160816; b=LHD6d4jGiUnG2aoUjcteRE1ziNRF4KxP5BgjutrBDrGx4c6XRYf4SMuNn4npQfdmjl nXUx6THnNhgRFWC/BNqlY2NRj6M0AorKuRbsndgbOQqRHQPRU9VGJo3A2GsakvH+7sPD AwsaSFWt6jw07Q2UMZr74/E4H/fICs5Owscxg/tVs4aFWfPxtqSbINod2qH8UBkT7rft Cx35/nmuMhq9kU8kp/a1jAWR5NYQY1XDrbpZCarQjUpUDySYQbTmUGzLc059Jtc4G4Ls uGvnhTzmPcUYvI9fepiWuU80dZjCeBqZI7TH04VmwD0k1WQTH9UNscXp4e7l2w5UtjWd FxVw== 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=i10I9YRlNYS41nWoE/ehxJAS1YmiKkROEWLhIFclSgQ=; b=qjehZJmKbC67xS09eUvf6w504RJTirEP3ikdZtGKsU44mp70exyIRaNNAz9OypkIJI f+Okk+O2fQbaPz9w7+yCGq4Iy72re70/mmXvmPRbJ07ai/h2VskOYYwqhBnY2E2v6L8x GKJzyqRNdX3z5b6DFx5BxVvs0rZyEdlRwGWBWIxCMG7jm8dxZ0NPLEcpavfnn51+6Bya EfpjnIuOnmZhSw6r0Q4b+D4mTsV6zrOts7lws0oz8CTZCs6pRIyFDMDqlwwzfpCIlZjS jxYuHg6XNURne0so/Q82ODf86ptCjp6xObiQmosCYZI57XifykHXSnYVs/Uu+PO8hUxT u3oA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=beld683d; 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=1720941054; x=1721545854; 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=BjeSEhy+BZWzmI9m0Soh5ZtKVKjojFRLPl6Bc2vWY6Xr4HGFbvt5/RaREnJ18ZfFXV y0mepZ+zmywOl2P29VIQts0ml/xOdGEeB6YZandvNEKEgUO7rJazYOgjAWupvkxc/lsX ghY43RKCUQ8XJxqTreu0Y2gXDfSqL4DqMz+CY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720941054; x=1721545854; 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=ujX86+SRJu0LxJ12H2aoxXZ9OuqOC3lMSCeFlzj73tES3HzP5khB1Jit7SiBa5QyX5 +1ibIWMpZlyqvYlNp6oJYNVM8tpup6Fm2IZxXPyMj7RPZeEvreLOSK+0uJ6YgNSShoz5 hx8mBBj4OJN+9EOdN3gyBVtrEu0btICZwejbu4nWIVQwhanYhZvmQRDlw6wzpw2rWnQK 0y5Y/L1XHD2uSukcIJ3EN338u/Gfy4v1nRUCFpWE+XGm1ExO2NPRcCyyn2tNQDqTE0Wq eUo81v+oaYAcqrIiANDosbXmA5Qmf+5y98PosB8JrPXUccu91CK2kymd0wubef22cYUp foxA== X-Forwarded-Encrypted: i=2; AJvYcCW/VIo8spDGFbmkCs8wzux99nHy/dzDxx996h+irH2zAiEEF0P0yix21vFyKWUGamr9md7HdDKDcGGNJbmsMfj2aIjY0xwVeWWkq5uNagqz+6+f1wF81AfCVZnCdg== X-Gm-Message-State: AOJu0Yx8XsPDPYN8sZNErIdozetpXWV+Cd16qInFQSl22qPmGxzwGYKS 4BMyY2kzVjd1j26+MLVb0rWEEiku+QK8liaoKq21/Qps0C3ZpwzOS+Aimaf2rbUIlg== X-Google-Smtp-Source: AGHT+IHNIyo2w5MNfpPD7aP+ayN2myXubf6yNuG3KOL1iInB6FNRdTzInW5UGuTeVfSEWJW/wPqFbw== X-Received: by 2002:a05:6402:2293:b0:57c:7471:a0dd with SMTP id 4fb4d7f45d1cf-594baf8753cmr9608109a12.12.1720941054420; Sun, 14 Jul 2024 00:10:54 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:aa7:d5d5:0:b0:58b:b493:fcc9 with SMTP id 4fb4d7f45d1cf-598217e0b7als178639a12.0.-pod-prod-03-eu; Sun, 14 Jul 2024 00:10:53 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWO1N54UAxJPCRypSbq+a5B054QsLy6FNLSvQ2k5TzRSfSaeBzeSxjAOQ3z/r1Ymj5sMQCcb9lMJrj908EONu8lnjcGYQ/khmWw51ITy4L5gH4V X-Received: by 2002:a17:906:7107:b0:a72:40b4:c845 with SMTP id a640c23a62f3a-a780b8833ffmr996014166b.51.1720941052614; Sun, 14 Jul 2024 00:10:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720941052; cv=none; d=google.com; s=arc-20160816; b=oXuqmBfemwie7dbWGDTfMSx6etIW6yEWyEtfw7eiAG/u9uLNp3pXWb+p7rSinj/yUy USLjMsQLQb/qT8AE54BgwobrapOZytdGz0BMPrmD+OdLwSrAODWMvOhhrT5a4wwVTOoX n+tIHAaRoEYX+WUfBpFx4SWHzjthz2GAOlm5GWUqnfGomWEIruAQ4LBrNazs7Af6JtW/ RH1zm76s7B0qANtDWViq4IHQkisEI+9VV/+FJf/WYyuqvIdJ56LnUEa9h0ncZF8XpD/w RkQL9URsX7IDM6GR3TFWQbWQ1xsrMeAWzv9yzEozSsKGa5x3nuhBTFt260EUkt08M5tJ eGBw== 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=CEQAE1H3XQY8MNFgtq8HMpboqn7psHrQEmt3OuqYVBU=; b=rER+Zr4x0HGYNowQxkn1g5aSNeeUf63cKRNHIrw+jsmOsngx03d71D9TtXNjbqG1uW irHFuo1i1jKxKRlt/EC4IBaL+IK6RxneBIfcUGaN6tX8Nvc7ZFeakyi/Pg8VbkZlSmu8 5s8lfXji7V6itmEzaghg+L5sQW92O4YjWH+5Tj4lm0317J7ZaQ+0v2Ho5PtyTnWFAvyB uz381JgeVXsy1jeGuRKYxv2CRvS1c4S8bU+Qsqj5dnsY8KrM/LGtuumHeifWYoQblM80 OY4cELrKKtCRT/aCQeIyqgO1vPi0mpKIMaN+ZBtfcx40Ce6V1NRjM3AkH9oGvVBdXp6C VMjQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=beld683d; 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-a79bc7cf325sor36170766b.15.2024.07.14.00.10.52 for (Google Transport Security); Sun, 14 Jul 2024 00:10:52 -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; AJvYcCUHHuiUuxR3Uw/Fb8f4mNdirK1ksPhPtc/KgINgZ2/+7keGAyysr2PNGUjouvmFpLtu0QGoTD/2W5CGbsQnItAEcDiwlQrokk7AzrO8DDtgjc2+ X-Received: by 2002:a17:907:868e:b0:a72:603f:1ea2 with SMTP id a640c23a62f3a-a780b8834f8mr1246227266b.62.1720941052119; Sun, 14 Jul 2024 00:10:52 -0700 (PDT) Received: from panicking.. (93-35-128-17.ip55.fastwebnet.it. [93.35.128.17]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a79bc820d52sm104950266b.214.2024.07.14.00.10.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jul 2024 00:10:51 -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 09:10:18 +0200 Message-ID: <20240714071023.10417-20-michael@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240714071023.10417-1-michael@amarulasolutions.com> References: <20240714071023.10417-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=beld683d; 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;