Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3606591rwb; Fri, 30 Sep 2022 06:04:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4BiUboclSdBZvHxddQQGM+vYAAZeGPLl/8tiBmZccPLCTJ4/uBWCt5zHTREeuhxmLjYDx8 X-Received: by 2002:a50:eb8f:0:b0:458:482d:43de with SMTP id y15-20020a50eb8f000000b00458482d43demr6542093edr.205.1664543068311; Fri, 30 Sep 2022 06:04:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664543068; cv=none; d=google.com; s=arc-20160816; b=wNv9RAnr31+0TWpsx3YrOrMh1uUrihHx28VRxXtf0Zd9m8Y7qAFsDA7iy2rmSM2q6D 4AuUWaKY/gzW7wQlzcCjCb4M2BiBmkmNwSxde37ozNCR+cYxgom9Wzkt0osaW+5tHHHV QI03dAEeOk/W3OQxmQkTZSUOAH0WMvm/1vJ0xet4gQDMfntX9swKd3WxBWksd0eavUqO 9bEGAwfxPJhAOU2tZwvEY1JrDSt/53plLpMjrIvEGCGzJAgdjkmjxDwBduGolSSZ2OMQ +oAmR2DJejnbVSbegKf51JlTxuwga/PKVJuDpAgCXVVKdhMdhKaGYP4ttXeshEJwGU06 Puvg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=43anTbWVd/yKSUzCTh4GRj/tRxBiKB9I+8mkWq0pOs8=; b=GnTU3WQXIV/jcdkuKx0WB9wG4gVpTM3izzCSp+UnVf3tHH/UfaRdXK8y1MxhhskAkb NmzDtjFdYXkDRDTcOC8Jo5yayPihx77yAHtzHBGApRX8xnEVSSZU6yT4+lcXqXmQPcnl vFuJSVWFN/gi9JHj0tcceBuDzZ6cPYGWX34Kb/DY9v+qsGCmqz9FlX1ji2jhpaVkgzdd 7+UmMO94FIZoBRy34+ZI0AON1kT7ezk7B+B4YS/++AVcn9zmmAQWHBILOw5lL6q14G3I SdaqIJb6pDpu0tkmTN7quO/00k0ooIdJCHZOEPisbsLBSVF9oDr26Nz8cWLZtdqESJ7Y PBnw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 28-20020a508e5c000000b0044d7a93e44dsi1748354edx.579.2022.09.30.06.03.59; Fri, 30 Sep 2022 06:04:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229615AbiI3Msp (ORCPT + 99 others); Fri, 30 Sep 2022 08:48:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231148AbiI3Msm (ORCPT ); Fri, 30 Sep 2022 08:48:42 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A7F614E76E for ; Fri, 30 Sep 2022 05:48:42 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oeFRI-0007W0-Ax; Fri, 30 Sep 2022 14:48:24 +0200 Received: from [2a0a:edc0:0:1101:1d::28] (helo=dude02.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1oeFRH-003nvX-6u; Fri, 30 Sep 2022 14:48:21 +0200 Received: from mfe by dude02.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1oeFRE-001tpv-Or; Fri, 30 Sep 2022 14:48:20 +0200 From: Marco Felsch To: mchehab@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, kishon@ti.com, vkoul@kernel.org, laurent.pinchart@ideasonboard.com, sakari.ailus@linux.intel.com, jacopo@jmondi.org, hverkuil@xs4all.nl Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-media@vger.kernel.org Subject: [PATCH v4 1/4] phy: dphy: refactor get_default_config Date: Fri, 30 Sep 2022 14:48:09 +0200 Message-Id: <20220930124812.450332-2-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220930124812.450332-1-m.felsch@pengutronix.de> References: <20220930124812.450332-1-m.felsch@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 Factor out the calculation into phy_mipi_dphy_calc_config(). This is needed for the follow up patch which adds the support to calculate the timings based on a given hs clock. No functional changes are done. Signed-off-by: Marco Felsch Acked-by: Vinod Koul --- Changelog: v2: - added Vinod Koul a-b drivers/phy/phy-core-mipi-dphy.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/phy/phy-core-mipi-dphy.c b/drivers/phy/phy-core-mipi-dphy.c index 929e86d6558e..ba365bc77407 100644 --- a/drivers/phy/phy-core-mipi-dphy.c +++ b/drivers/phy/phy-core-mipi-dphy.c @@ -17,7 +17,7 @@ * from the valid ranges specified in Section 6.9, Table 14, Page 41 * of the D-PHY specification (v1.2). */ -int phy_mipi_dphy_get_default_config(unsigned long pixel_clock, +static int phy_mipi_dphy_calc_config(unsigned long pixel_clock, unsigned int bpp, unsigned int lanes, struct phy_configure_opts_mipi_dphy *cfg) @@ -75,6 +75,15 @@ int phy_mipi_dphy_get_default_config(unsigned long pixel_clock, return 0; } + +int phy_mipi_dphy_get_default_config(unsigned long pixel_clock, + unsigned int bpp, + unsigned int lanes, + struct phy_configure_opts_mipi_dphy *cfg) +{ + return phy_mipi_dphy_calc_config(pixel_clock, bpp, lanes, cfg); + +} EXPORT_SYMBOL(phy_mipi_dphy_get_default_config); /* -- 2.30.2