Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp613115pxb; Tue, 15 Feb 2022 23:48:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLXWj14THsrnHVd/maOeyv6p4wcfh/+vXAOoiWFS7NLUQB7V8jeFr2mKntLo2T7heot4i5 X-Received: by 2002:a17:902:6b0a:b0:14d:8ee9:3298 with SMTP id o10-20020a1709026b0a00b0014d8ee93298mr1281009plk.125.1644997732278; Tue, 15 Feb 2022 23:48:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1644997732; cv=pass; d=google.com; s=arc-20160816; b=sfEPAiHz8PkXB+y0Eyr2QGEY8Yx8CNE5NVUWNnn4aQh1OcNoDYTAZeOG4MyHcJWX8X 9BlbJ07N8HRfbvKnwQ5XSVwNe3WrOVsisDahn9yAiauVgRHQnwHGMHTvjOo6s+3kBWS2 9143wVcJGwmFxBnXs/lU08nVDXmolvcSD7br+cvhTQcl63DdkhPF8BVVkYx6QJnD4yft XtA7fLJAmwNCo5chxMb1i+RyMI6BfDocKEweDLm01K2TFBuMQqwgn+IPIsC7hdL1f1Eg 6qqv/AryiuaohZIzJwpmrutEHVK6OLvFd4J3y1IfN9bgsGh1IkZJ/YcRtMXcjd9YOd7j pkPA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=kExFFvUXbo3RwmK5ystYGVcQdKBZqI3DM0gcp19G7fs=; b=0xLIw8k38XHaF/HoP7RzDklloBuUmb86Re5yyRMm3qibSCxWpOKKWUXvQrGrfI9Uvd mIehVexYpIKlbvpIk3CfJshx6irqntZgt4uk/1rXttIQ6Wb2+yho2gqHdtqxCxjbRaKa 2tI9cfToMhkSbhzVeeK9WlUCs01oLnuHhyCePRizxcx7ykjWmMvakpYcQMW5QcMvk5uF 5rmY8waNFSDActddLlh7xou+yFuqQIFzmz31wiq01xyP64Ir1QnGWlqkPsp4YG2tLY2s yfO8LPDWe7R+cTHmLFGashGzB2L2IYlebVaOyVMH6Ok7FVoeZ52LvtjJo5RMBqpu2Fva 924g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=pFGuuwd0; arc=pass (i=1); 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=nxp.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id a26si5370853pgv.221.2022.02.15.23.48.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 23:48:52 -0800 (PST) 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=@nxp.com header.s=selector2 header.b=pFGuuwd0; arc=pass (i=1); 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=nxp.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6788892D14; Tue, 15 Feb 2022 23:14:37 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229798AbiBPHOc (ORCPT + 99 others); Wed, 16 Feb 2022 02:14:32 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:47678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229809AbiBPHOa (ORCPT ); Wed, 16 Feb 2022 02:14:30 -0500 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2065.outbound.protection.outlook.com [40.107.21.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9257F3A5 for ; Tue, 15 Feb 2022 23:14:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MW4kvM0nr7OwUd8wWrqd9TKQydSr1NODfM05OyPwJmhshVs2goSytQI6x9EIm4gkVIOXUqocwgm0pJcIMNEXcGLA/HnJitwEwqwRi5DTUdgvWZPD57N6C8hiGnuqlG107ufowBk88dHvQ+W3qJ6NJcZfGI5iRRkRccBl+sGm6v6mSgBpV/2oj6Z/L5o6aEU4qwt0RAiNGBMnikyH/OspyvBWrW6E7L3ntYH1zQKOaYb3HdPNLaNIDu1Zu3WDG6opAl94OuiBq3KUSc7W1uGXaQG4dhAq7tugfJwdy4Z4Zgh8NYRsfnFB96mpuFVKnIuFDt+XzM4+nrc0/awpiqox9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kExFFvUXbo3RwmK5ystYGVcQdKBZqI3DM0gcp19G7fs=; b=lNpUtXEhVo8fLE+BAWK491z11Ge0ANyU/ZrZCJjl8J/efXq0PwwqQOstHe3k13/X9xBmibi1TSLNnOtVKp/eo+4YXNZtWA/amBWZSvobW32kmLUCk5Ac+yNZ+p9adAlRd20xXTrRSVHV9owfl6FL8yQgATZIUA89NEcynt+jRydNkO7Ghe9HuJfamvmdCl+UkpIFJsdWJqWkvYMbUneH/SZp+YOzkLi7ZKXH6IxBkJpRbvPh+FSPrFD6GfFNYlHw8U8EbseryLVuLpHDi8hv9UpR4TbLMSSW4VY6kXivJJhTl8lhcPj0F2440Hbu42pZQuIpRqZ7q71zRVoZU/RW4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kExFFvUXbo3RwmK5ystYGVcQdKBZqI3DM0gcp19G7fs=; b=pFGuuwd0KCYTZqqdkFACXHtEBDUwYH5s9q9dSXuRmsBrTJYbkfWi+d165QE0YJCF7XnuYuDIvBoaAFoswWBvaWUqWjjPvpZLVZ6eF4jY05pl0AoCtsoDRhlZ1INndc59iQI6yeOK+HTXvOJqj385q5dAtxUH9TVuA47BMZrzRwY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by AM6PR04MB6248.eurprd04.prod.outlook.com (2603:10a6:20b:bf::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.19; Wed, 16 Feb 2022 07:14:01 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::ddca:beb1:95b0:1ae1]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::ddca:beb1:95b0:1ae1%4]) with mapi id 15.20.4995.016; Wed, 16 Feb 2022 07:14:00 +0000 From: Liu Ying To: linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org Cc: linux-imx@nxp.com, Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Kishon Vijay Abraham I , Vinod Koul , Heiko Stuebner , Maxime Ripard , =?UTF-8?q?Guido=20G=C3=BCnther?= Subject: [PATCH] phy: dphy: Correct lpx parameter and its derivatives(ta_{get,go,sure}) Date: Wed, 16 Feb 2022 15:12:57 +0800 Message-Id: <20220216071257.1647703-1-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SI2PR02CA0002.apcprd02.prod.outlook.com (2603:1096:4:194::22) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dce8cf30-711e-45be-33cf-08d9f11be7cf X-MS-TrafficTypeDiagnostic: AM6PR04MB6248:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RLTua+A3DN4MT4f0J7xtAvOcyW84zf0aU2VBUVFBNuNgJLgCwRViDbHFjGEbrMXPZaSzY54M4KhYI6EJbhefe+77DArSN3R2OuEog2to3S78hJjJDvbiDrglt7XphYHaCJDDmbT5oGcNP6sUBCSetl6pnAQ9K6PDYXKOF6fWgX9FPWBZfKopB+YdI9uZx9eaI3T3B7d2dnzqIGOsJY1LxkzR4WIyHI2U/GyBa3hcmYAKQO93KGhGgsQSMVA39KYcAiFCt8fsGSXR+uBBw62MpW8qQJ7WSvw3D9z8tfSDfhFFi18OfIyNcyA10UlQX+2Hl1DoJ9z0P9wc/jnhqUWxyZi/58rdYRzEWVWdVzaAqY2dBI4UC19VwE/I01UcMsaJncXTctCGiw8HrrWMmM/EqqmjOuIpzwKfAtSauKPTQcyvKFM3nzpZqjOZ8EMJ9HIvYzKNBfeYxfS1+kKgjFx5a/rxm7I1kljn3uewalKg/pXahxT27lB3fZ4czXM3jsTX7CwSGfvYXwiEK2pRh/fBb0D0d+bYUNgL/ssDE3VwuJLu495S6WgJV7iY/Ow34Fxkit0qRXb/ebQimmlyu6T8nF9CcGUxqbNjvlYUNVZKlxRVB48fl4rAcZM+OQlJXL90cEg6VlSIrbYZJ/1dqlcSzIIGv3Ygiw1rwqbTNcskw7cRVRXMSpPuJDnTciddZ0e3EnJIVkTOeUKaKWHsRFULUg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7046.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(508600001)(186003)(6486002)(2616005)(316002)(1076003)(54906003)(38100700002)(7416002)(5660300002)(52116002)(26005)(6666004)(38350700002)(6506007)(8936002)(86362001)(66556008)(66946007)(4326008)(8676002)(6512007)(66476007)(2906002)(83380400001)(66574015)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UGdXZU5kb2ZrVUoxZTRoL3JIcDl6WjdDZEl4endpd2pmb2tKS2hXbkxQaDQv?= =?utf-8?B?cXViZkFHVTBqMWc3Uk83RVh5VEtwRVpnVVNNWkdYMG5FUDZTQnJZMXlMQnMv?= =?utf-8?B?M3J0dlI3TXZjdUU3OU8xY3BiK2U0cGVaNDQwbzNCZjJRYzUvcFpkb1A4R1Bl?= =?utf-8?B?Vlcrck5TU2tNQUpyQlBzMHlnM2w4NmxPaXdhY20vOUV0QS9VRUN5MFJ5T2dH?= =?utf-8?B?ekpobmZaNkg5RG5mdlp1ZkJlU0NlR21YcnJKclUyWlU4QmpSOWJXQ2ZPNkNF?= =?utf-8?B?a2hZbVV3WlZJRHBYY1VKQVhCRm5qUjI1RkM2bXFxREsvNUZXTndXVnFaWlRJ?= =?utf-8?B?Z1BwbUZlM21sVE1QRmVyQjltQ2tvRGk4cGMzUCtKY3hvb0lUUlVNazhXTXdm?= =?utf-8?B?akF0RVZ2dnhMMkhhUVpWZ3pkaHFLNFZaUFNuY2kzQk91MFQvNlpwSFVYV0Uz?= =?utf-8?B?SFdFSVRTNXNiK1lxRzB5V1ZqNElCbFVRRWs5RmVsdVFYbElRMWR2eWFGSkVB?= =?utf-8?B?ZklZTmV1NFpyMHNXQ1F5T2QrcHZHS2I2M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Z6VURnQm9SVmFyOExvbkM4NlV6U29hZUFRdFBHbHMzMVYr?= =?utf-8?B?c1NpZ1BsOGdnOUxVU2JqdXRHTjNFMFRSZmQvRFd3WVdUVUxTT0RMUkdic2R1?= =?utf-8?B?WGlBVjJvNE5jVTVzYnBCSlpBclJIVFBZb1dJMlQwSkNSQmlnaXdYQVl2WVhP?= =?utf-8?B?dHlONTZ2SHJoSWdwUnluUUtzeVkrbENqTEhHSXNHekc2QTMvNm1McUZOQnFz?= =?utf-8?B?NE8yYUo4Rko3WXV5Q0k1blphbFJhVDdFYktjd3hzRFJVL2NjTW9vQWp0UjBx?= =?utf-8?B?YzJVNWk2dkdGS1BQTEMraW1FYzVHVlozWTVHc1ZTWjJRMXl3VHp3S2lPKzF6?= =?utf-8?B?ZDZUSHg2K0pZZWN0R1doYkk2MVhoUk1mbmloQWZyZEtUNlBCSTROR3g3K3VI?= =?utf-8?B?WGtPQUNnSU5IV3ZQWkNmV1BEcEJMU3hsQkRFUWlLNWdZSU53bUN0eklpOFBZ?= =?utf-8?B?TWlwdG5XalM5RjFMWE40aFB1UlVZMmJjS0tpUlBjWThHT0pJbU5Ec2pPaWFw?= =?utf-8?B?ZlBaSGd2WFNCQ2pmYlhCY1huMEI3TC83SDFWbVdNNGtOaTZsQlptS3htKzdq?= =?utf-8?B?bkswbmp2SHkxNi9meDRkd0EwZWE2b2V3UFFTY25md1p0bGZYbUJRSXB0Vk9P?= =?utf-8?B?UzIrZUFlRFNmS2IzaDJ4MXk5RHpDblZ6UW9SNkNDT21DL1Y3OU54N0NJNVRV?= =?utf-8?Q?6/AzQpJLSBgUWzLglLaOmW8=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dce8cf30-711e-45be-33cf-08d9f11be7cf X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2022 07:14:00.7350 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 11KmnTHfASVveuTajPyR93lyBBFhVakh4gY+veTalFdXxhiSi2ktKiWbAVeQSHyahS5NiYbGjwvYmjpYgwV2Rw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB6248 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,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 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 --- 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.25.1