Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp522625rwb; Thu, 18 Aug 2022 07:48:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR6n/Z/hLI+uTsTCwN6/k5ECYnAGp4xVXBW8+UHwuyuzX1dQ57m//WII9fs0mr8hCWa96jkV X-Received: by 2002:a17:907:3f11:b0:731:57ed:3aea with SMTP id hq17-20020a1709073f1100b0073157ed3aeamr2074493ejc.432.1660834116485; Thu, 18 Aug 2022 07:48:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660834116; cv=none; d=google.com; s=arc-20160816; b=evBMV20Ab98Tt7ajyH6oMkD8hs97lj5KFk4E1zoslHTf5H52QBdMSCVbHH5CopXO41 wTCKxJ5NIVZg3EH6ZNablxDOmmU5BtCoC05Ulkm5R8uSLZEekOXS0jN/gits6HYAPHY0 DyegrvBxyMEqB7ZCZWyKywKdxAUrT6Vu76JmTvVWbbs5knA7hISYL+WCOiuwJf3Dq8h2 dNv5BTiPF18T5/hKNHlMSUSbjxf5XrGC8uHIzdLMyYZRSBlbYzHuAHkjUj5zFk6RG4tH z9KWWtt4S+ykEgS1BXJon5pihw/6AvqHcmRjSZN/KRvLolRJZ1/t/OxU0GaxTJ1qX7Nr Go+w== 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=iWxO5ddkrKX61YLW5RbLOg3CHDA83/E9GGRmccYTjyA=; b=rpBL5VL0Q7M6/+M4nWuXi+5mGYan7E/U97NsyjbdV+9U/nHevamjbZLLB1SgsL1X67 F0rKjgLrnq+Qnucn0pnGSfkcU6Jjx9DlRjXFVkEINwLhhlsTxQoCGigq4qp8Byci33fg WjIdRsZcZtTWIcMr6lGFcquh/a3jwEYi7mwFTylDoAltMOdaT/Fhf9wxNWKaNvy96fMv UgrJKpzif8X9tLVxVt21yiZaevjTAaOayGfLs8RKR87Cl2BxWo94k507IoBTAJQo3dP0 7H+p+MrbAmM42y4ZkpTngf/z+rx376LkKeOfSETKjZVlDyHWhVPFu6ypniqJaUcLkdvg gIDA== 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 qf26-20020a1709077f1a00b007310137867csi1290321ejc.916.2022.08.18.07.48.08; Thu, 18 Aug 2022 07:48:36 -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 S1343537AbiHROeg (ORCPT + 99 others); Thu, 18 Aug 2022 10:34:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245689AbiHROd5 (ORCPT ); Thu, 18 Aug 2022 10:33:57 -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 D859122B0B for ; Thu, 18 Aug 2022 07:33:40 -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 1oOgaJ-0005lQ-Kl; Thu, 18 Aug 2022 16:33:23 +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 1oOgaI-000X12-E9; Thu, 18 Aug 2022 16:33:22 +0200 Received: from mfe by dude02.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1oOgaH-0043dO-1r; Thu, 18 Aug 2022 16:33:21 +0200 From: Marco Felsch To: mchehab@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, vkoul@kernel.org, kishon@ti.com, sakari.ailus@linux.intel.com, hverkuil@xs4all.nl, jacopo@jmondi.org, laurent.pinchart+renesas@ideasonboard.com Cc: linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 1/4] phy: dphy: refactor get_default_config Date: Thu, 18 Aug 2022 16:33:04 +0200 Message-Id: <20220818143307.967150-2-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220818143307.967150-1-m.felsch@pengutronix.de> References: <20220818143307.967150-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,T_SCC_BODY_TEXT_LINE 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 --- 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