From patchwork Wed Jan 19 02:37:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12717083 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 61B9FC433EF for ; Wed, 19 Jan 2022 02:38:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=sDglDDzLkRURkJoxRdh0uWvFNClrpukw7uJuQLf5WDQ=; b=y6/1x6Y68rm365 HWTMwYRRHuU/ffbTpBeV2lo4so8Kw9fZJ7w7srF/OArJ3h8k3ykPAufXex6anjgkvzEX856dMzIdJ WAvkSC0PggNHcLtowsTnwUPSgOYKYdjJQDwSyDWJRJp26pmNjIFoNN0+PlzwnmCejbOcyG716Hwd+ t1Kd3FabCMMG1yG7vXeCEzYjCTOc1Uv66JpMv/uZefI4uF47rNGRd0HtqYMKdV0wSCdAsQ1vrkVdv JcV7wLGRYuk78nLoE7EXLR6S9NqMFPrHVaHgn4bd8Y/e1UuSjSqZPTYYII6wZu74RhUque5U1FMx+ WXy7WHNfqx64z66hGzfw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nA0rY-003aYT-1A; Wed, 19 Jan 2022 02:38:16 +0000 Received: from mail-eopbgr70088.outbound.protection.outlook.com ([40.107.7.88] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nA0rU-003aX7-NI; Wed, 19 Jan 2022 02:38:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O/HZWinBxVyJNHUB9jwez23UnAa2EpEuqRmUA1S9vG/FdubUQEoX6jFhmkXHHHh2menOttlF4O7XqPisqymDRKhX9zHt0IUUe+9IBxLa+3cjQSabmRZLkpiFf5KPuc6j/IE3bLkIkKZ1V2WPf/9NA2S9el7hdolsPZndnfEaI9A3AWlCHlV6lbH82MrAzzkH7bSa8gqAMzAbctktOYRgcW/C3RBZmcmxq3gGjXRdxd08crpglWaKsnFm0XIHcZSBMlGbo29Je9nNwPXEjZx6nBnwKAnFLZ0A6TAkVDhx7OWUdkgWih3Ie3Gf+aIF/9cKVBSKWD3m0GO7pCYgro3fIQ== 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=tnJ5yxdI7HHJD0XMNqupCI6R887JEfSr30UT0n2cnmg=; b=CLVvkCXd2KEWD0tN8MdcfmjjLPe3g9s3IBRE1Hl4pMRC4PK/hW45ylXDvdZfuwgEuargFQG8sZGjAnVvoMnV1uxb+LnQDcr5r6zZ+HXQwCGAflp1cwjuwwYa2JOnonG9rLc4/dF/oD1TyICUs+UHYld1WJp3HH3zqJx7pIyuN0xGRpwfs8KPenRGZIhyELTVELtBm67xwKNROVMcRJxkjn3JAAdvhfQeBKxn8DXg1snLWWYYFqG31I44oFsJoCQnQqEgPrrMBIeYfxHZBpHBVAC6dL7/5MrEV3c4wCwwLzCiCYRZoGI89Qeu+W11p6RvKnD8ruR5eROCfVAwlXmfAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; 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=tnJ5yxdI7HHJD0XMNqupCI6R887JEfSr30UT0n2cnmg=; b=Q55FkdahyaSmAqC3pobY3aQ409JiWHJy6fK1OZD+9Z675/UBKN+KrAAzGww+cgXZq26MELvK3MG0o4p0tDINNz6gfdm6dvTHiGkVgUIdng2lMCSbNUVr2LIe/IP+mRHwWpDARIrDxoCXjJJuUfZ8iWNtTSZKr3Aa0hvLzvyMIZE= 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 AM6PR04MB5543.eurprd04.prod.outlook.com (2603:10a6:20b:99::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Wed, 19 Jan 2022 02:38:09 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::a5b3:9e5:366:a3fc]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::a5b3:9e5:366:a3fc%3]) with mapi id 15.20.4888.014; Wed, 19 Jan 2022 02:38:08 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-rockchip@lists.infradead.org Cc: linux-imx@nxp.com, Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Kishon Vijay Abraham I , Vinod Koul , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Heiko Stuebner , Maxime Ripard , =?utf-8?q?Guido_G=C3=BCnther?= Subject: [PATCH v2] phy: dphy: Correct clk_pre parameter Date: Wed, 19 Jan 2022 10:37:14 +0800 Message-Id: <20220119023714.1498508-1-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SGXP274CA0020.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::32) 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: 5bb769a4-2ab6-4f02-ebee-08d9daf4ba81 X-MS-TrafficTypeDiagnostic: AM6PR04MB5543:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H0De4MzA40eNG7v9yOW3neQdSNkL5LwoK2/JY2OEXHrheUb0DRgl/Zfu473NjWCtBXVJs46M+nHpcw0OvX8wIsa1oXVIa8k4R5P4rSuqGwwlS33G3zwu6fJ4i96kFSbB7giA9/qtAbzGFJIKM8cBxUF+4J8XwaZpSu2IVuN9060qyhzFKGF5eC3EBR+DfRAe0qbEIz9LKTzTopM3HKi3Mw00q7d7BBhmoFa/6zJCvWbeJttbnWrNsg2CNQcVSwOHN8ohkBQpy2b/FxlRqG7VyBQLe/yHdsCPXoxOrekwvmRI6TUsJTEojOnovsKF+RMVCFJYzyYZHAGQmtpNLVFeS2K9UTiRMo/6nyZa3ni0TqaBFyf3hGWmNuxNZRYNuMRqo9Dsz8NZghCre9RdcnMXadBeTdcrdJMUwJHAmgYK4wCYnFoXfZaW1wzopDuW/XXdS+kLpMEWCR7xwS79cCUgtu+2egXjTz2sLK79M3zH0svtePr3hF9aKqmqMvacEwl1XvfnRF5wM3oEg0cWk0103lTVJ3+kXdA+JZtowiCLxlrNRoEnM4Bhhyp521vGommCWF1xbm8IF0FRAPg5bher3yleSq/21krxuWMip0vCiwP1vNSE662ObWqiQI2rk4OmrtFtVEW8187d9/G6I/gIALnN2NXJh6v2B9zBowvbJIqvZm/dH4Suxb94cSelhsShlBeel5sfnBOYC6/YPrwaEA== 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:(4636009)(366004)(8676002)(38350700002)(38100700002)(66476007)(66556008)(316002)(52116002)(36756003)(186003)(6506007)(6666004)(1076003)(8936002)(26005)(2616005)(4326008)(66574015)(83380400001)(86362001)(7416002)(508600001)(66946007)(2906002)(6512007)(54906003)(5660300002)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?+7whgdduMmC3K7uDflBMGw7MeRn1?= =?utf-8?q?8jN2RjpIyDgpZBvIAXjLn8nM295Uv6SV523VBT1FPCjfyg3jDQi7ZmDRjIhJvEVE1?= =?utf-8?q?1ZnlYaSfc7dWhSC5Gu8JkTya2nmslDjqE1hGG2RnhbcRp11XE/OIAN1op7FCKtgZT?= =?utf-8?q?3/9RmpC++68Vd/VY+DPre325ztJO+NRzqYVdIz0mgrKpgRjdL0e8pCNWXHQpVJ2Is?= =?utf-8?q?pFgP6FalfVWkHwIRs2YsUc9qngihTY23P+qQULzcrtVUuQDBp0ncpIQ/iUEBvSFrm?= =?utf-8?q?up0rVUZZbwsZG4WL9nNP1qohEJotlHQcsuBcnhKeTB4NJvPUb4p/3YVtj7vd0/aFc?= =?utf-8?q?5SOXxj1O/xUp/JudMf6nuCQqDaMdz0TBoQ/EmHXR/0rsjfE/oVeuKqeyHjM/V8u3Q?= =?utf-8?q?NJJH7dUYbbUHGq+jP43kB1zrRTx8nmiY7lHgQEEmUT+TFSoyAxSiuXNyD7jKHyQTQ?= =?utf-8?q?TYsFND0yknQPvPtFLS+0siQAaM6dEewWwedzI/67g9JUlzIySo5zrB14HBJTEzpvj?= =?utf-8?q?f7rai2c7YtGyy/QHYjKt5cNeqIN0ZWiB7RFlogjgR7vq6Ca72Qy2Yg0tRRPmEAHrI?= =?utf-8?q?wT5ZmfV1evFNwv/VHyMVbIqNUTPHz6L4DXirts+ADEQ2VnogygmtfgP7gXME8jUSf?= =?utf-8?q?6xdxPPHA6E94iQ1ZJI1cXXJystJuYEuSpuFvyP8RlHkSa5bsX/g6STXB4BkGKLQpI?= =?utf-8?q?Nm+xcPjVHR353dNBEtHCvo7FonJpfqqoMdm6t7IHfudqVpY+zVwKnoorphxwsn1rU?= =?utf-8?q?pEQMZEoDk0fzRdS/vJw7wgP+cKrQZ+G/MED8ISnZi/6fKb3qWa45hZCZmAfAWGSsr?= =?utf-8?q?Bx0ty/q+ysvqG/aDFo0Yz2ReZiNkNH3auOM8exipiboVRtLITc7aW/wBJnmPPn9bP?= =?utf-8?q?9NZgl0D0qc7h+1H8hvS1FhtiVO3Q8BrmntAeJtTpi0Byp87sqP5gmTG5JDIYZ9qYi?= =?utf-8?q?6OVrHzC5QTwn9Sfq9DsyXpyGc5BsABpebkRN+Tyl2fEQZo8BasWyK9bi7Gm5sRfci?= =?utf-8?q?jSugK87zkOTAZZ5lR3YyxKfqDQqeUjTNPxl8h8xgg1Mc727a5vKZgDqFhbx62wm/A?= =?utf-8?q?bY2a4YkEYX6KSqfUuM6FZaVN1WhE0ryVJlQ9BCic7XUAZa5hn+awNGjvLeuwMGbNR?= =?utf-8?q?uO3Ts3rBmMVBqIdfFvND+lGMb3/UDiOPw/fKugFNlA0jsp7ERbM3v5Vi3Sk3POdi0?= =?utf-8?q?OPa8IdiajKCdjjv+RnJayNI/FtoCIm1YrO1dzeLcWb4SNBccDQYwUnRfNCY2Eqcag?= =?utf-8?q?u+a+hVdQ5yK1pCRMVqpaJqSmqRLZu4pX1SMj52H741Q5Jsv6ISabRBgor7Vp4/I8g?= =?utf-8?q?LIfP60Q3wsAvIrtLVV+1iHkieiFbnNwWLYQUKqAPQZEkRrTeLDGa/NchS3t2yhEdx?= =?utf-8?q?eW0FEYwNDYNhavRTTVlmeBtNHbJD6yZ44dRCWZDTtkK/xxAn5muxwTuwh39XFIgQW?= =?utf-8?q?aM0xv/bqBEScyQgX78CLrpkAx7qTNkpodOg0ROMDP0gDD0qP27v5s6BYjbeUluPsh?= =?utf-8?q?6raQMPSaYsxGpxNctxO5yu9XHiSaUzjEJLS3wQ9+HeDfX45OA3oIVCw=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5bb769a4-2ab6-4f02-ebee-08d9daf4ba81 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2022 02:38:08.8868 (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: stLubDZYpPueqJF6FzsG4jPwFnyBBjeKvxv40o50IKLdq5mjE9K4tB6cLmRfQr2MROlhm9RxfjuuDRRvjxG0bQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB5543 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220118_183812_965035_4D1FCA48 X-CRM114-Status: GOOD ( 21.71 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org The D-PHY specification (v1.2) explicitly mentions that the T-CLK-PRE parameter's unit is Unit Interval(UI) and the minimum value is 8. Also, kernel doc of the 'clk_pre' member of struct phy_configure_opts_mipi_dphy mentions that it should be in UI. However, the dphy core driver wrongly sets 'clk_pre' to 8000, which seems to hint that it's in picoseconds. And, the kernel doc of the 'clk_pre' member wrongly says the minimum value is '8 UI', instead of 8. So, let's fix both the dphy core driver and the kernel doc of the 'clk_pre' member to correctly reflect the T-CLK-PRE parameter's unit and the minimum value according to the D-PHY specification. I'm assuming that all impacted custom drivers shall program values in TxByteClkHS cycles into hardware for the T-CLK-PRE parameter. The D-PHY specification mentions that the frequency of TxByteClkHS is exactly 1/8 the High-Speed(HS) bit rate(each HS bit consumes one UI). So, relevant custom driver code is changed to program those values as DIV_ROUND_UP(cfg->clk_pre, BITS_PER_BYTE), then. 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: 2ed869990e14 ("phy: Add MIPI D-PHY configuration options") Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Robert Foss Cc: Laurent Pinchart Cc: Jonas Karlman Cc: Jernej Skrabec Cc: David Airlie Cc: Daniel Vetter Cc: Kishon Vijay Abraham I Cc: Vinod Koul Cc: Kevin Hilman Cc: Jerome Brunet Cc: Martin Blumenstingl Cc: Heiko Stuebner Cc: Maxime Ripard Cc: Guido Günther Tested-by: Liu Ying # RM67191 DSI panel on i.MX8mq EVK Signed-off-by: Liu Ying Reviewed-by: Andrzej Hajda Reviewed-by: Neil Armstrong # for phy-meson-axg-mipi-dphy.c Tested-by: Neil Armstrong # for phy-meson-axg-mipi-dphy.c Tested-by: Guido Günther Reviewed-by: Laurent Pinchart --- v1->v2: * Use BITS_PER_BYTE macro. (Andrzej) * Drop dsi argument from ui2bc() in nwl-dsi.c. drivers/gpu/drm/bridge/nwl-dsi.c | 12 +++++------- drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c | 3 ++- drivers/phy/phy-core-mipi-dphy.c | 4 ++-- drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c | 3 ++- include/linux/phy/phy-mipi-dphy.h | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c index a7389a0facfb..af07eeb47ca0 100644 --- a/drivers/gpu/drm/bridge/nwl-dsi.c +++ b/drivers/gpu/drm/bridge/nwl-dsi.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -196,12 +197,9 @@ static u32 ps2bc(struct nwl_dsi *dsi, unsigned long long ps) /* * ui2bc - UI time periods to byte clock cycles */ -static u32 ui2bc(struct nwl_dsi *dsi, unsigned long long ui) +static u32 ui2bc(unsigned int ui) { - u32 bpp = mipi_dsi_pixel_format_to_bpp(dsi->format); - - return DIV64_U64_ROUND_UP(ui * dsi->lanes, - dsi->mode.clock * 1000 * bpp); + return DIV_ROUND_UP(ui, BITS_PER_BYTE); } /* @@ -232,12 +230,12 @@ static int nwl_dsi_config_host(struct nwl_dsi *dsi) } /* values in byte clock cycles */ - cycles = ui2bc(dsi, cfg->clk_pre); + cycles = ui2bc(cfg->clk_pre); DRM_DEV_DEBUG_DRIVER(dsi->dev, "cfg_t_pre: 0x%x\n", cycles); nwl_dsi_write(dsi, NWL_DSI_CFG_T_PRE, cycles); cycles = ps2bc(dsi, cfg->lpx + cfg->clk_prepare + cfg->clk_zero); DRM_DEV_DEBUG_DRIVER(dsi->dev, "cfg_tx_gap (pre): 0x%x\n", cycles); - cycles += ui2bc(dsi, cfg->clk_pre); + cycles += ui2bc(cfg->clk_pre); DRM_DEV_DEBUG_DRIVER(dsi->dev, "cfg_t_post: 0x%x\n", cycles); nwl_dsi_write(dsi, NWL_DSI_CFG_T_POST, cycles); cycles = ps2bc(dsi, cfg->hs_exit); diff --git a/drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c b/drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c index cd2332bf0e31..fdbd64c03e12 100644 --- a/drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c +++ b/drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -250,7 +251,7 @@ static int phy_meson_axg_mipi_dphy_power_on(struct phy *phy) (DIV_ROUND_UP(priv->config.clk_zero, temp) << 16) | (DIV_ROUND_UP(priv->config.clk_prepare, temp) << 24)); regmap_write(priv->regmap, MIPI_DSI_CLK_TIM1, - DIV_ROUND_UP(priv->config.clk_pre, temp)); + DIV_ROUND_UP(priv->config.clk_pre, BITS_PER_BYTE)); regmap_write(priv->regmap, MIPI_DSI_HS_TIM, DIV_ROUND_UP(priv->config.hs_exit, temp) | diff --git a/drivers/phy/phy-core-mipi-dphy.c b/drivers/phy/phy-core-mipi-dphy.c index 288c9c67aa74..ccb4045685cd 100644 --- a/drivers/phy/phy-core-mipi-dphy.c +++ b/drivers/phy/phy-core-mipi-dphy.c @@ -36,7 +36,7 @@ int phy_mipi_dphy_get_default_config(unsigned long pixel_clock, cfg->clk_miss = 0; cfg->clk_post = 60000 + 52 * ui; - cfg->clk_pre = 8000; + cfg->clk_pre = 8; cfg->clk_prepare = 38000; cfg->clk_settle = 95000; cfg->clk_term_en = 0; @@ -97,7 +97,7 @@ int phy_mipi_dphy_config_validate(struct phy_configure_opts_mipi_dphy *cfg) if (cfg->clk_post < (60000 + 52 * ui)) return -EINVAL; - if (cfg->clk_pre < 8000) + if (cfg->clk_pre < 8) return -EINVAL; if (cfg->clk_prepare < 38000 || cfg->clk_prepare > 95000) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c index 347dc79a18c1..630e01b5c19b 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c @@ -5,6 +5,7 @@ * Author: Wyon Bi */ +#include #include #include #include @@ -364,7 +365,7 @@ static void inno_dsidphy_mipi_mode_enable(struct inno_dsidphy *inno) * The value of counter for HS Tclk-pre * Tclk-pre = Tpin_txbyteclkhs * value */ - clk_pre = DIV_ROUND_UP(cfg->clk_pre, t_txbyteclkhs); + clk_pre = DIV_ROUND_UP(cfg->clk_pre, BITS_PER_BYTE); /* * The value of counter for HS Tlpx Time diff --git a/include/linux/phy/phy-mipi-dphy.h b/include/linux/phy/phy-mipi-dphy.h index a877ffee845d..59a5e77ab409 100644 --- a/include/linux/phy/phy-mipi-dphy.h +++ b/include/linux/phy/phy-mipi-dphy.h @@ -42,7 +42,7 @@ struct phy_configure_opts_mipi_dphy { * the transmitter prior to any associated Data Lane beginning * the transition from LP to HS mode. * - * Minimum value: 8 UI + * Minimum value: 8 */ unsigned int clk_pre;