Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1004992pxb; Wed, 6 Apr 2022 06:31:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrnnIiOIHRvp88Pyj7PagwR7VjHe8qeX5wEkN8scddQ4LCIh8qWXqQWjmNLkLGkuOxMnvD X-Received: by 2002:aca:41d6:0:b0:2ec:f4fd:6b8b with SMTP id o205-20020aca41d6000000b002ecf4fd6b8bmr3411789oia.234.1649251906165; Wed, 06 Apr 2022 06:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649251906; cv=none; d=google.com; s=arc-20160816; b=Kn/jRd9ocF+UDKcMaBNe3WE35SqQUiQNIKWi+K6w1ZDaQEAuzEi3/5tv6sjwiFsj9z WhLrfVgCoC5AjCz6p6mMR+LXTRD0qjwaiIp3mX+3I74T6QIMd8o5ejLzfTOqP/jjMPsQ w/JCKnMSVX6H07nabEKc01gUrktAdpidoTQUiis8vtI2/NBlm8IlFVdffdp3vJp3BL1Y GLnFmRcV0EbPOFHK8XrqL0GzZYSFpMWGXLd+VB09poMbhxyZK8Dl0Mb5P4JA3vKcN+sL qIFF3I/qCdF/EJbHXTXU/zrItaHbopXUAH9pn9HB5m0gkXpGmuCwIAKlLba7+3zzu5KH m+oA== 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=IFtHidJmaSAXl/+beZ0q3yqVdEN97UnISk0ozr/spTo=; b=KgrSttwcn+Opl3jGUgkLg8cf/sVT89Fnk4t0S3iNOywU0xf98P+ioW0TMCh7DfenW2 Rjh9U+at1D4Cj5y2EpbdFO6YyVE7IpnntYLzfhTJifRu3f+HE1lUCZ9K20DrPte/RHMP ovFI6tYRMCvLn9O0aw8E07ujTZnTqaJD43D+Q9dLfPWuOYBgSXxMtCfvKcXcX3BTSIyJ Xa1OthbchHnTZi2MkgsqKPZuvqcovl9khOyO0lNXNnYAC/M3m/NNJux2O37bDkfD4m2/ l8yibqrjS5Mwg0KyySPmEjDUIS+vzrLIMbiq6wzxe/AcLrq2paGL/cUOW/Kj4OXGCU7c mOVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ls9qXCY8; 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 t24-20020a9d7758000000b005cdd679368bsi8829194otl.203.2022.04.06.06.31.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:31:46 -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=Ls9qXCY8; 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 C874440455D; Wed, 6 Apr 2022 04:10:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354681AbiDEVKc (ORCPT + 99 others); Tue, 5 Apr 2022 17:10:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240264AbiDEKbi (ORCPT ); Tue, 5 Apr 2022 06:31:38 -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 146C23BE; Tue, 5 Apr 2022 03:18:31 -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 A3F5861777; Tue, 5 Apr 2022 10:18:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B50EC385A2; Tue, 5 Apr 2022 10:18:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649153910; bh=jdRZxhGVBh24b1pO4PjXneg0iSK34WICAWHCxcRCZRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ls9qXCY8u3E6s1z6AbJhKOcYTxGGyA8Lm5V4JflnJVGxcD4sUa5Ce13eOk/SawvmX DJn6ZYcYR/J1XVNeR65zVDEsFmfBnIRgecL0vl42/o2LHVD11JN0KfNjnuIjImQxQx F2Sbbb8D4ELKgt+0IRSCtWONR6tU1G8MW/TxcZCA= 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.10 391/599] phy: dphy: Correct lpx parameter and its derivatives(ta_{get,go,sure}) Date: Tue, 5 Apr 2022 09:31:25 +0200 Message-Id: <20220405070310.466368441@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070258.802373272@linuxfoundation.org> References: <20220405070258.802373272@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 14e0551cd319..0aa740b73d0d 100644 --- a/drivers/phy/phy-core-mipi-dphy.c +++ b/drivers/phy/phy-core-mipi-dphy.c @@ -66,10 +66,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