public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Johan Hovold <johan+linaro@kernel.org>,
	Vinod Koul <vkoul@kernel.org>, Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 02/14] dt-bindings: phy: qcom,qmp-usb3-dp: fix sc8280xp bindings
Date: Tue, 15 Nov 2022 15:22:56 +0100	[thread overview]
Message-ID: <Y3OgwLlNaqcd5SwW@hovoldconsulting.com> (raw)
In-Reply-To: <61df3c4f-f41c-9525-606d-1b8261163080@linaro.org>

On Tue, Nov 15, 2022 at 09:12:54AM +0100, Krzysztof Kozlowski wrote:
> On 14/11/2022 18:08, Johan Hovold wrote:
> >>
> >> Which is also fine. I don't understand still why it is a problem - even
> >> if you have multiple files, one for each SoC/phy. If USB4 brings here 10
> >> more clocks and other SoCs/phys might bring many more options, then what
> >> else can you do? Grow the binding file with big text-based mapping of
> >> IDs? It's not a viable solution. Header or headers is the only
> >> maintainable way for such cases.
> > 
> > So then we must add per-SoC (and PHY type) headers even if we can
> > possibly reuse defines from one platform for another as long as they
> > appear to be similar enough?
> 
> No, you don't have to. I just got impression that future devices will
> bring so many changes that anyway you will end up with per-SoC defines.
> 
> > For example, using a "SC7180_USB3_DP" infix
> > for the current platforms and add a new series of indexes for SC8280XP:
> > 
> > 	QMP_SC7180_USB3_DP_USB3_PIPE			0
> > 	QMP_SC7180_USB3_DP_DP_LINK			1
> > 	QMP_SC7180_USB3_DP_DP_VCO_DIV			2
> > 
> > 	QMP_SC8280XP_USB4_USB3_DP_USB3_PIPE		0
> > 	QMP_SC8280XP_USB4_USB3_DP_DP_LINK		1
> > 	QMP_SC8280XP_USB4_USB3_DP_DP_VCO_DIV		2
> > 	QMP_SC8280XP_USB4_USB3_DP_USB4_PCIE_PIPE	3
> > 	...
> > 	QMP_SC8280XP_USB4_USB3_DP_USB4_RX1		9
> 
> The names are just a names, you can even use QMP_SC7180_* on SC8280XP.
> You can skip the SoC part and have something shared. We already have
> such patterns - although maybe more often for outside components (like
> PMICs). The differences are:
> 1. For per-SoC name it's quite obvious which clock is supported on fiven
> SoC,
> 2. With shared names, you should document somewhere mapping between
> supported clocks and SoCs. Also what to do if new device comes with 10
> new clocks entirely different - re-use/map existing defines or add
> completely new set of 10 of them?

Ok, thanks. I'll go with a common prefix per PHY type for now, and we
can worry about hypothetical hardware revisions later.

I'll use a "QMP_USB43DP_" prefix for the new SC8280XP binding, which can
be reused also for the older SoCs with USB3-DP PHYs if/when we convert
them as their indexes will be a subset of the SC8280XP ones:

	/* QMP USB4-USB3-DP clocks */
	#define QMP_USB43DP_USB3_PIPE_CLK	0
	#define QMP_USB43DP_DP_LINK_CLK		1
	#define QMP_USB43DP_DP_VCO_DIV_CLK	2

Since I'm adding a new header anyway, I decided to go with dedicated
indexes also for the PHY selection (instead of using the PHY_TYPE
defines):

	/* QMP USB4-USB3-DP PHYs */
	#define QMP_USB43DP_USB3_PHY		0
	#define QMP_USB43DP_DP_PHY		1

I'll add these to a common dt-bindings/phy/phy-qcom-qmp.h header so that
it can be used also for the UFS clocks (with a "QMP_UFS_" prefix).

Johan

  reply	other threads:[~2022-11-15 14:23 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11  9:24 [PATCH 00/14] phy: qcom-qmp-combo: fix sc8280xp binding (set 3/3) Johan Hovold
2022-11-11  9:24 ` [PATCH 01/14] dt-bindings: phy: qcom,qmp-usb3-dp: rename current bindings Johan Hovold
2022-11-11 15:15   ` Krzysztof Kozlowski
2022-11-11  9:24 ` [PATCH 02/14] dt-bindings: phy: qcom,qmp-usb3-dp: fix sc8280xp bindings Johan Hovold
2022-11-11 13:24   ` Johan Hovold
2022-11-11 13:30   ` Rob Herring
2022-11-11 15:17   ` Krzysztof Kozlowski
2022-11-14 13:27     ` Johan Hovold
2022-11-14 14:07       ` Krzysztof Kozlowski
2022-11-14 14:18         ` Johan Hovold
2022-11-14 15:19           ` Dmitry Baryshkov
2022-11-14 15:38             ` Johan Hovold
2022-11-14 16:14               ` Dmitry Baryshkov
2022-11-14 16:42                 ` Johan Hovold
2022-11-14 16:51                   ` Dmitry Baryshkov
2022-11-14 16:53                     ` Johan Hovold
2022-11-14 15:49           ` Krzysztof Kozlowski
2022-11-14 16:32             ` Johan Hovold
2022-11-14 16:39               ` Krzysztof Kozlowski
2022-11-14 16:48                 ` Johan Hovold
2022-11-14 16:56                   ` Krzysztof Kozlowski
2022-11-14 17:08                     ` Johan Hovold
2022-11-15  8:12                       ` Krzysztof Kozlowski
2022-11-15 14:22                         ` Johan Hovold [this message]
2022-11-15 14:56                           ` Krzysztof Kozlowski
2022-11-12 11:43   ` Dmitry Baryshkov
2022-11-14 13:37     ` Johan Hovold
2022-11-14 15:31       ` Dmitry Baryshkov
2022-11-14 16:21         ` Johan Hovold
2022-11-11  9:24 ` [PATCH 03/14] phy: qcom-qmp-combo: drop v4 reference-clock source Johan Hovold
2022-11-12 11:43   ` Dmitry Baryshkov
2022-11-14 13:03     ` Johan Hovold
2022-11-11  9:24 ` [PATCH 04/14] phy: qcom-qmp-combo: restructure PHY creation Johan Hovold
2022-11-11  9:28   ` Johan Hovold
2022-11-11 15:18     ` Krzysztof Kozlowski
2022-11-11 15:19     ` Krzysztof Kozlowski
2022-11-11  9:24 ` [PATCH 05/14] phy: qcom-qmp-combo: register clocks sooner Johan Hovold
2022-11-12 11:15   ` Dmitry Baryshkov
2022-11-14 13:42     ` Johan Hovold
2022-11-11  9:24 ` [PATCH 06/14] phy: qcom-qmp-combo: generate pipe clock name Johan Hovold
2022-11-12 11:15   ` Dmitry Baryshkov
2022-11-11  9:24 ` [PATCH 07/14] phy: qcom-qmp-combo: drop redundant clock structure Johan Hovold
2022-11-12 11:16   ` Dmitry Baryshkov
2022-11-11  9:24 ` [PATCH 08/14] phy: qcom-qmp-combo: drop redundant clock allocation Johan Hovold
2022-11-12 11:17   ` Dmitry Baryshkov
2022-11-14 12:42     ` Johan Hovold
2022-11-14 15:31       ` Dmitry Baryshkov
2022-11-11  9:24 ` [PATCH 09/14] phy: qcom-qmp-combo: add clock registration helper Johan Hovold
2022-11-14 10:12   ` Dmitry Baryshkov
2022-11-11  9:24 ` [PATCH 10/14] phy: qcom-qmp-combo: separate clock and provider registration Johan Hovold
2022-11-14 10:13   ` Dmitry Baryshkov
2022-11-11  9:24 ` [PATCH 11/14] phy: qcom-qmp-combo: clean up DP clock callbacks Johan Hovold
2022-11-12 11:20   ` Dmitry Baryshkov
2022-11-11  9:24 ` [PATCH 12/14] phy: qcom-qmp-combo: rename common-register pointers Johan Hovold
2022-11-12 11:31   ` Dmitry Baryshkov
2022-11-14 12:54     ` Johan Hovold
2022-11-14 15:38       ` Dmitry Baryshkov
2022-11-14 15:51         ` Johan Hovold
2022-11-11  9:24 ` [PATCH 13/14] phy: qcom-qmp-combo: rename DP_PHY register pointer Johan Hovold
2022-11-12 11:31   ` Dmitry Baryshkov
2022-11-11  9:24 ` [PATCH 14/14] phy: qcom-qmp-combo: add support for updated sc8280xp binding Johan Hovold
2022-11-12 11:36   ` Dmitry Baryshkov
2022-11-14 12:58     ` Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y3OgwLlNaqcd5SwW@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=johan+linaro@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=robh+dt@kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox