Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp945247pxb; Wed, 6 Apr 2022 05:02:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfd2QgrGoyrQV1WpkTmFufO38X2f7cY6D4aDTSpshVgdFem2nxlhOjkp1oZoYc+Wvft5n4 X-Received: by 2002:a5e:a717:0:b0:649:6328:792b with SMTP id b23-20020a5ea717000000b006496328792bmr3892617iod.54.1649246529183; Wed, 06 Apr 2022 05:02:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649246529; cv=none; d=google.com; s=arc-20160816; b=xeveqTf3dIxsd4Dq6bhbvFtrKtyb5wiAVldyVVDxKoUEo6QV6FlgCyMyzc17ylLT4Z Fhcbal7tQhgTO7UXdRU92tB29VNO9+wXAjxhoBC8VbLFoDpkBO/sUYq7UkVYF+NybAJ1 CQdUGDUmV0ATHJK0Xr6+S0D8ZGd9efOHSo0CpityRHRPkDXpNWFoWO0XLZLfsx8/fNXx H2yFY+aBHtC7KbnZljwvsPfZrlFq+WLQYAhIhnbWv8n7PNCVubEWJVmPk9ntreJ5+EYO 6YUa6nYXpFziPIF912Gmimslglrdn5S16j+HYy4dmFoKL0RwiWsXp/Ko8quFola1V699 bbkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nhzAK8ikPj2ystg256qMUkgh3G3HOkNNvOc5Bi3IKnM=; b=i70vhCyyohNUSeIczkksF0CpF3dDZqnmNP1Gj6rT1KROmlh9VvmG0I9ovRS2EiKSth ccEHh5MaFGw4a/OvsG2yiGmDlCju8+SrqweQDKvyX9o3n71WecAWs/LFTExyzRKDhUVY hVQ7ypd7KXNGGRkW+l6ReyXkCIQaXs9JMZ27UPcQZqq0oUpfOcY5NcHJXULB8+eFoJuS D14IWcy05GyXmADyPjhNVFHtic5/eKZtpydSWDIUsf3i+RYFdRUNb3c3JPxPNgGUg9Y6 UX2l9kR4/mzy8rrHGUIqF/UmDiCnzqEnBfBfzx7ZhznHAZluQaPa55WhLpn2i/Mnxed0 a8xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Fmoh3PC9; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id p4-20020a0566022b0400b0064c88eab91bsi11042287iov.48.2022.04.06.05.02.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:02:09 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Fmoh3PC9; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AD9CC2B4589; Wed, 6 Apr 2022 03:28:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357204AbiDEUQ1 (ORCPT + 99 others); Tue, 5 Apr 2022 16:16:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349433AbiDEJtw (ORCPT ); Tue, 5 Apr 2022 05:49:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9244E24BD1; Tue, 5 Apr 2022 02:45:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2D7AA61675; Tue, 5 Apr 2022 09:45:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09DE1C385A2; Tue, 5 Apr 2022 09:45:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151945; bh=zPCGveBQgJIlDVIMeFHkX0aMMcRrkc0ZJmZXhkmwY1w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fmoh3PC9MkzVVgVISbnNSsyTDV8g6RlMqccTT0cT0nBLqfa0WK9fNdMMmLuCBQ+8M pQ8YHjtZGJ3YRiiuYjYwxdlBeunIeRa6inmubpMZsULPGas/+PanBM+zHcBhSHTRjj aGCDiDhowCQnT1yEaNYuqZeado5DEgPOiP7tXpJU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Kishon Vijay Abraham I , Vinod Koul , Heiko Stuebner , Maxime Ripard , =?UTF-8?q?Guido=20G=C3=BCnther?= , Liu Ying , Sasha Levin Subject: [PATCH 5.15 598/913] phy: dphy: Correct lpx parameter and its derivatives(ta_{get,go,sure}) Date: Tue, 5 Apr 2022 09:27:40 +0200 Message-Id: <20220405070357.767344907@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Liu Ying [ Upstream commit 3153fa38e38af566cf6454a03b1dbadaf6f323c0 ] 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. Fixes: dddc97e82303 ("phy: dphy: Add configuration helpers") Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Laurent Pinchart Cc: Kishon Vijay Abraham I Cc: Vinod Koul Cc: Heiko Stuebner Cc: Maxime Ripard Cc: Guido Günther 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: Sasha Levin --- 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 ccb4045685cd..929e86d6558e 100644 --- a/drivers/phy/phy-core-mipi-dphy.c +++ b/drivers/phy/phy-core-mipi-dphy.c @@ -64,10 +64,10 @@ int phy_mipi_dphy_get_default_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; -- 2.34.1