Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp839476rwb; Thu, 22 Sep 2022 07:05:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ZkXMLliV0Su5R2wZ3TBpcm7AcZCe4WhDcwKU5XKK/pWn2p4aun+sB1TRc4MGqwYjQooDp X-Received: by 2002:a17:90b:4a82:b0:200:a89e:6f1f with SMTP id lp2-20020a17090b4a8200b00200a89e6f1fmr15199510pjb.13.1663855534326; Thu, 22 Sep 2022 07:05:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663855534; cv=none; d=google.com; s=arc-20160816; b=epJX5lf88QkPtka60MYMpX3Eqstr1QJC5yejjKOlN+uvpTKIqPgoWhsTPuYz7iG+Y2 OoqVo3Ur09ygdj4mgxf5FIDtgmtiLOj+S+PVwcUmMTEHat4jSoLeRkJtuQUIa1nRKBtS FSuZhHOnIlffUkg3hnieZpNfMDu7EOpeuK92M5JKmn4MYsj39HEbjlBTgA8dsBFD36pG eyQkvVEYhTiwHRbooBKUGQCl5fbxMhBPNqiwOJMiDo1Rp6KXxOrTMqmq/1aRYRcoY1Od j0IDAVOqA90AKTBnKquTLGmYCQF533WSsnC0fUIQqluihsAMnuewHb9JXaYHvJ3Mb5Hk MChw== 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=EiUhyrcyEZAXG5wchW41xCJM2XCshuHVeAWZMGNKu1o=; b=uxyBrJwwWtIUQEqhmtN/oErU7cODjdEiQijEkcZRhsYByab0G8hxwCt10n3o18KPe1 AC6KzrKW6a76/OQkOHjvRblV6o7Qm56pZhJYoBEViZXr5pa5LEJnQoRohR13wZowIIvt LBQtYx0ms3RB03U98SN0+DPN6Exh9bNw2/CDm2X6FjXEB0AU4RYenNLT0UCdy/4aQSDB 1j/2GHb4d6b3isewXN1e08YupfYZ6WEhS8j3cIq1iv51TtGlyPALlSFzxnjkKFcBRd34 vq86jNy0hfv+mq6G4JsgBBeKogrQWXR6vD10fGnq8F1/zo1lwjsxGFN7PNKELpyk1Tcn 3VCw== 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 x38-20020a634866000000b0043a18ce4e2asi6324806pgk.393.2022.09.22.07.05.21; Thu, 22 Sep 2022 07:05:34 -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 S231858AbiIVNt2 (ORCPT + 99 others); Thu, 22 Sep 2022 09:49:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231585AbiIVNtF (ORCPT ); Thu, 22 Sep 2022 09:49:05 -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 DBFCDDE0D7 for ; Thu, 22 Sep 2022 06:49:03 -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 1obMZM-0008EX-Fa; Thu, 22 Sep 2022 15:48:48 +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 1obMZL-002GUc-PI; Thu, 22 Sep 2022 15:48:46 +0200 Received: from mfe by dude02.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1obMZJ-00D4D7-Bk; Thu, 22 Sep 2022 15:48:45 +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, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH v3 1/4] phy: dphy: refactor get_default_config Date: Thu, 22 Sep 2022 15:48:40 +0200 Message-Id: <20220922134843.3108267-2-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220922134843.3108267-1-m.felsch@pengutronix.de> References: <20220922134843.3108267-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=ham 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