Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2184472rwn; Fri, 16 Sep 2022 06:56:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Mzn3FVM9TkVk7wuemH51eb9cvIoODlg51TGgA4BOZNrHSWz2eBUW4XQHso1wVg5Of4gUx X-Received: by 2002:a17:907:3188:b0:741:4bf7:ec1a with SMTP id xe8-20020a170907318800b007414bf7ec1amr3810520ejb.448.1663336615275; Fri, 16 Sep 2022 06:56:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663336615; cv=none; d=google.com; s=arc-20160816; b=R2kchX9mxVeSw7Og/MQwydA+TMS4pkg72aas7P1bObj9aV/IIW15ZFDI9FQ0lGTeU3 dvmj82fyWF+DnoSSdj2mSIkFMWZ4b0RoUGDV4KS2oeVqmFiX9pjcVK6an6Jdmzzhb3O8 h9gkqzUckoRyfHgmSs+LZYBT2rYgdezaPP3W6m8/T/y4LBDSgXz3wdcMGLE2156MQWPS 0y6gCMgwjVvwkG24Jg9czAYrY85UzOfU+Cwpu1qsTHAsAKrESDiHPwszdosMQ0NTGGsx 30+W7hM2X5oUpEUIRWsSF/RRUfzAAANGhW8pOzC1Ny7bPr0P96rKb8je7n3hXen2X2gr 9t3A== 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=z4aW+8ThBgJqFGK/drrOxNC/pwi1BatXJgWobgZWtzEzMQtv3WFizMOxe5eJ66SJTU TWuckjLR8q3Xexb25YJ7VJ7sT8kotHD4rKJyYdOupUxFQ7UNn3FeBHGYI3NKdTf331Lr u0YDx1sBIuoJ3E+NuBClNFUCvakP3/YonMHi02mpR6w4pP1BQSlzpfgx3Mp9CyFT3vY3 +65LByjCqn4wZCnKPDloB0oP2qcczSfD3OQpUgGYTJCUfSXPnVMbZ1LsbAbIlx6OtFGD lYsmG8OJgrs1HSe9BGYFwRCk+J3Oz9GxYDOcm1wFv5ATEGPsotIVFXOI7iTg+RYPuFFS yG1A== 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 q7-20020a1709066ac700b00730b0fef595si13740673ejs.857.2022.09.16.06.56.29; Fri, 16 Sep 2022 06:56:55 -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 S231486AbiIPNqL (ORCPT + 99 others); Fri, 16 Sep 2022 09:46:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231265AbiIPNqJ (ORCPT ); Fri, 16 Sep 2022 09:46:09 -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 C1DB7AB1B9 for ; Fri, 16 Sep 2022 06:46:07 -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 1oZBfD-0000wS-7x; Fri, 16 Sep 2022 15:45:51 +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 1oZBfB-0015wu-S0; Fri, 16 Sep 2022 15:45:48 +0200 Received: from mfe by dude02.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1oZBf9-000XN1-9d; Fri, 16 Sep 2022 15:45:47 +0200 From: Marco Felsch To: mchehab@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, kishon@ti.com, vkoul@kernel.org, sakari.ailus@linux.intel.com, hverkuil@xs4all.nl, jacopo@jmondi.org, laurent.pinchart+renesas@ideasonboard.com Cc: kieran.bingham+renesas@ideasonboard.com, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH v2 1/4] phy: dphy: refactor get_default_config Date: Fri, 16 Sep 2022 15:45:32 +0200 Message-Id: <20220916134535.128131-2-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220916134535.128131-1-m.felsch@pengutronix.de> References: <20220916134535.128131-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