* [PATCH v9 1/7] dt-bindings: media: qcom,x1e80100-camss: Add optional PHY handle definitions
2026-02-26 14:28 [PATCH v9 0/7] Add dt-bindings and dtsi changes for CAMSS on x1e80100 silicon Bryan O'Donoghue
@ 2026-02-26 14:28 ` Bryan O'Donoghue
2026-02-27 0:02 ` Dmitry Baryshkov
2026-02-27 7:26 ` Krzysztof Kozlowski
2026-02-26 14:28 ` [PATCH v9 2/7] dt-bindings: media: qcom,x1e80100-camss: Add support for combo-mode endpoints Bryan O'Donoghue
` (5 subsequent siblings)
6 siblings, 2 replies; 15+ messages in thread
From: Bryan O'Donoghue @ 2026-02-26 14:28 UTC (permalink / raw)
To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Robert Foss, Todor Tomov,
Mauro Carvalho Chehab, Konrad Dybcio, Vladimir Zapolskiy,
Bryan O'Donoghue
Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-media,
Bryan O'Donoghue, Krzysztof Kozlowski
Add optional PHY handle definitions. This will allow for supporting both
legacy PHY definitions as well as supporting the optional new handle based
approach.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
.../devicetree/bindings/media/qcom,x1e80100-camss.yaml | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml b/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
index 2d1662ef522b7..bb18236b4f344 100644
--- a/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
+++ b/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
@@ -126,6 +126,16 @@ properties:
description:
1.2V supply to a PHY.
+ phys:
+ maxItems: 4
+
+ phy-names:
+ items:
+ - const: csiphy0
+ - const: csiphy1
+ - const: csiphy2
+ - const: csiphy4
+
ports:
$ref: /schemas/graph.yaml#/properties/ports
@@ -351,6 +361,11 @@ examples:
vdd-csiphy-0p8-supply = <&csiphy_0p8_supply>;
vdd-csiphy-1p2-supply = <&csiphy_1p2_supply>;
+ phys = <&csiphy0>, <&csiphy1>,
+ <&csiphy2>, <&csiphy4>;
+ phy-names = "csiphy0", "csiphy1",
+ "csiphy2", "csiphy4";
+
ports {
#address-cells = <1>;
#size-cells = <0>;
--
2.52.0
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v9 1/7] dt-bindings: media: qcom,x1e80100-camss: Add optional PHY handle definitions
2026-02-26 14:28 ` [PATCH v9 1/7] dt-bindings: media: qcom,x1e80100-camss: Add optional PHY handle definitions Bryan O'Donoghue
@ 2026-02-27 0:02 ` Dmitry Baryshkov
2026-02-27 8:58 ` Bryan O'Donoghue
2026-02-27 7:26 ` Krzysztof Kozlowski
1 sibling, 1 reply; 15+ messages in thread
From: Dmitry Baryshkov @ 2026-02-27 0:02 UTC (permalink / raw)
To: Bryan O'Donoghue
Cc: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Robert Foss, Todor Tomov,
Mauro Carvalho Chehab, Konrad Dybcio, Vladimir Zapolskiy,
Bryan O'Donoghue, linux-arm-msm, linux-clk, devicetree,
linux-kernel, linux-media, Krzysztof Kozlowski
On Thu, Feb 26, 2026 at 02:28:42PM +0000, Bryan O'Donoghue wrote:
> Add optional PHY handle definitions. This will allow for supporting both
> legacy PHY definitions as well as supporting the optional new handle based
> approach.
If my search-foo tells me right things, we have more or less the same CSI
PHY block for a variety of the platforms starting from MSM8996 (at least
CAMSS uses the same set of ops). If we don't allow older platforms to
migrate to the CSIPHY driver, we end up with the code duplication for
CSI PHY drivers (one in camss and a separate one in drivers/phy).
What can be sensible from my point of view:
- Add CSI PHY as an optional device node under the camss node.
- If it is not present there, create it manually (by applying the
platform-specific overlay, by using OF_DYNAMIC or just by creating the
platform device manually)
- Migrate existing platforms into using the CSI PHY driver (ideally, one
by one), while still retaining the backwards compatibility with the
current camss ABI.
- For platforms starting with N+1 (the next platform to be submitted or
merged(?) into the kernel) make CSI PHY node mandatory, keeping
backwards compatibility code limited to the currently defined affected
platforms, which unfortunately means the following list (I'd leave the
question on how to handle the patches currently in flight to the
maintainer's discretion):
- "qcom,msm8996-camss"
- "qcom,qcm2290-camss"
- "qcom,qcs8300-camss"
- "qcom,sa8775p-camss"
- "qcom,sc7280-camss"
- "qcom,sc8280xp-camss"
- "qcom,sdm660-camss"
- "qcom,sdm670-camss"
- "qcom,sdm845-camss"
- "qcom,sm8250-camss"
- "qcom,sm8550-camss"
- "qcom,sm8650-camss"
- "qcom,x1e80100-camss"
>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
> .../devicetree/bindings/media/qcom,x1e80100-camss.yaml | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml b/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
> index 2d1662ef522b7..bb18236b4f344 100644
> --- a/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
> +++ b/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
> @@ -126,6 +126,16 @@ properties:
> description:
> 1.2V supply to a PHY.
>
> + phys:
> + maxItems: 4
> +
> + phy-names:
> + items:
> + - const: csiphy0
> + - const: csiphy1
> + - const: csiphy2
> + - const: csiphy4
> +
> ports:
> $ref: /schemas/graph.yaml#/properties/ports
>
> @@ -351,6 +361,11 @@ examples:
> vdd-csiphy-0p8-supply = <&csiphy_0p8_supply>;
> vdd-csiphy-1p2-supply = <&csiphy_1p2_supply>;
>
> + phys = <&csiphy0>, <&csiphy1>,
> + <&csiphy2>, <&csiphy4>;
> + phy-names = "csiphy0", "csiphy1",
> + "csiphy2", "csiphy4";
> +
> ports {
> #address-cells = <1>;
> #size-cells = <0>;
>
> --
> 2.52.0
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v9 1/7] dt-bindings: media: qcom,x1e80100-camss: Add optional PHY handle definitions
2026-02-27 0:02 ` Dmitry Baryshkov
@ 2026-02-27 8:58 ` Bryan O'Donoghue
0 siblings, 0 replies; 15+ messages in thread
From: Bryan O'Donoghue @ 2026-02-27 8:58 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Robert Foss, Todor Tomov,
Mauro Carvalho Chehab, Konrad Dybcio, Vladimir Zapolskiy,
Bryan O'Donoghue, linux-arm-msm, linux-clk, devicetree,
linux-kernel, linux-media, Krzysztof Kozlowski
On 27/02/2026 00:02, Dmitry Baryshkov wrote:
> - Add CSI PHY as an optional device node under the camss node.
> - If it is not present there, create it manually (by applying the
> platform-specific overlay, by using OF_DYNAMIC or just by creating the
> platform device manually)
> - Migrate existing platforms into using the CSI PHY driver (ideally, one
> by one), while still retaining the backwards compatibility with the
> current camss ABI.
Even though this is more work, I actually quite like this suggestion.
Provided the DT compiler doesn't complain, I think I'll take this feedback.
One reason for that is indeed as you say, we can reach back to older
devices and give them some love.
> - For platforms starting with N+1 (the next platform to be submitted or
> merged(?) into the kernel) make CSI PHY node mandatory, keeping
> backwards compatibility code limited to the currently defined affected
> platforms, which unfortunately means the following list (I'd leave the
> question on how to handle the patches currently in flight to the
> maintainer's discretion):
---
bod
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v9 1/7] dt-bindings: media: qcom,x1e80100-camss: Add optional PHY handle definitions
2026-02-26 14:28 ` [PATCH v9 1/7] dt-bindings: media: qcom,x1e80100-camss: Add optional PHY handle definitions Bryan O'Donoghue
2026-02-27 0:02 ` Dmitry Baryshkov
@ 2026-02-27 7:26 ` Krzysztof Kozlowski
1 sibling, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-27 7:26 UTC (permalink / raw)
To: Bryan O'Donoghue
Cc: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Robert Foss, Todor Tomov,
Mauro Carvalho Chehab, Konrad Dybcio, Vladimir Zapolskiy,
Bryan O'Donoghue, linux-arm-msm, linux-clk, devicetree,
linux-kernel, linux-media
On Thu, Feb 26, 2026 at 02:28:42PM +0000, Bryan O'Donoghue wrote:
> Add optional PHY handle definitions. This will allow for supporting both
> legacy PHY definitions as well as supporting the optional new handle based
> approach.
Please squash patches doing the same logical thing - adding children CSI
PHY nodes is one thing.
>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
> .../devicetree/bindings/media/qcom,x1e80100-camss.yaml | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml b/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
> index 2d1662ef522b7..bb18236b4f344 100644
> --- a/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
> +++ b/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
> @@ -126,6 +126,16 @@ properties:
> description:
> 1.2V supply to a PHY.
>
> + phys:
> + maxItems: 4
> +
> + phy-names:
> + items:
> + - const: csiphy0
> + - const: csiphy1
> + - const: csiphy2
> + - const: csiphy4
This is fine in general, except that I thought CSI PHY is the child of
this node. It's not?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v9 2/7] dt-bindings: media: qcom,x1e80100-camss: Add support for combo-mode endpoints
2026-02-26 14:28 [PATCH v9 0/7] Add dt-bindings and dtsi changes for CAMSS on x1e80100 silicon Bryan O'Donoghue
2026-02-26 14:28 ` [PATCH v9 1/7] dt-bindings: media: qcom,x1e80100-camss: Add optional PHY handle definitions Bryan O'Donoghue
@ 2026-02-26 14:28 ` Bryan O'Donoghue
2026-02-26 14:28 ` [PATCH v9 3/7] dt-bindings: media: qcom,x1e80100-camss: Add iommus minItems: 5 Bryan O'Donoghue
` (4 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: Bryan O'Donoghue @ 2026-02-26 14:28 UTC (permalink / raw)
To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Robert Foss, Todor Tomov,
Mauro Carvalho Chehab, Konrad Dybcio, Vladimir Zapolskiy,
Bryan O'Donoghue
Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-media,
Bryan O'Donoghue, Krzysztof Kozlowski
Qualcomm CSI2 PHYs support a mode where two sensors may be attached to the
one CSIPHY.
When we have one endpoint we may have
- DPHY 1, 2 or 4 data lanes + 1 clock lane
- CPHY 3 wire data lane
When we have two endpoints this indicates the special fixed combo-mode.
- DPHY endpoint0 => 2+1 and endpoint1 => 1+1 data-lane/clock-lane combination.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
.../bindings/media/qcom,x1e80100-camss.yaml | 69 ++++++++++++++++++++--
1 file changed, 65 insertions(+), 4 deletions(-)
diff --git a/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml b/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
index bb18236b4f344..8dbaab16b11d4 100644
--- a/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
+++ b/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
@@ -140,7 +140,8 @@ properties:
$ref: /schemas/graph.yaml#/properties/ports
description:
- CSI input ports.
+ CSI input ports. Supports either standard single sensor mode or
+ Qualcomm's combo mode with one sensor in 2x1 + 1x1 data-lane, clock-lane mode.
patternProperties:
"^port@[0-3]$":
@@ -148,26 +149,86 @@ properties:
unevaluatedProperties: false
description:
- Input port for receiving CSI data from a CSIPHY.
+ Input port for receiving CSI data.
properties:
- endpoint:
+ endpoint@0:
$ref: video-interfaces.yaml#
unevaluatedProperties: false
+ description:
+ Endpoint for receiving a single sensor input (or first leg of combo).
+
properties:
data-lanes:
minItems: 1
- maxItems: 4
+ maxItems: 4 # Base max allows 4 (for D-PHY)
+
+ clock-lanes:
+ maxItems: 1
bus-type:
enum:
- 1 # MEDIA_BUS_TYPE_CSI2_CPHY
- 4 # MEDIA_BUS_TYPE_CSI2_DPHY
+ endpoint@1:
+ $ref: video-interfaces.yaml#
+ unevaluatedProperties: false
+
+ description:
+ Endpoint for receiving the second leg of a combo sensor input.
+
+ properties:
+ data-lanes:
+ maxItems: 1
+
+ clock-lanes:
+ maxItems: 1
+
+ bus-type:
+ const: 4 # Combo is D-PHY specific
+
required:
- data-lanes
+ allOf:
+ # Case 1: Combo Mode (endpoint@1 is present)
+ # If endpoint@1 exists, we restrict endpoint@0 to 2 lanes (D-PHY split)
+ - if:
+ required:
+ - endpoint@1
+ then:
+ properties:
+ endpoint@0:
+ properties:
+ data-lanes:
+ minItems: 2
+ maxItems: 2
+ bus-type:
+ const: 4
+ endpoint@1:
+ properties:
+ data-lanes:
+ minItems: 1
+ maxItems: 1
+ bus-type:
+ const: 4
+
+ # Case 2: Single Mode (endpoint@1 is missing)
+ # We explicitly allow up to 4 lanes here to cover the D-PHY use case.
+ - if:
+ not:
+ required:
+ - endpoint@1
+ then:
+ properties:
+ endpoint@0:
+ properties:
+ data-lanes:
+ minItems: 1
+ maxItems: 4
+
required:
- compatible
- reg
--
2.52.0
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH v9 3/7] dt-bindings: media: qcom,x1e80100-camss: Add iommus minItems: 5
2026-02-26 14:28 [PATCH v9 0/7] Add dt-bindings and dtsi changes for CAMSS on x1e80100 silicon Bryan O'Donoghue
2026-02-26 14:28 ` [PATCH v9 1/7] dt-bindings: media: qcom,x1e80100-camss: Add optional PHY handle definitions Bryan O'Donoghue
2026-02-26 14:28 ` [PATCH v9 2/7] dt-bindings: media: qcom,x1e80100-camss: Add support for combo-mode endpoints Bryan O'Donoghue
@ 2026-02-26 14:28 ` Bryan O'Donoghue
2026-02-27 7:27 ` Krzysztof Kozlowski
2026-02-26 14:28 ` [PATCH v9 4/7] dt-bindings: media: qcom,x1e80100-camss: Allow CSIPHY supplies to be optional Bryan O'Donoghue
` (3 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Bryan O'Donoghue @ 2026-02-26 14:28 UTC (permalink / raw)
To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Robert Foss, Todor Tomov,
Mauro Carvalho Chehab, Konrad Dybcio, Vladimir Zapolskiy,
Bryan O'Donoghue
Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-media,
Bryan O'Donoghue, Krzysztof Kozlowski
Specify a minimum number of iommus entries. Currently the schema
requires exactly eight. Add minItems to allow fewer entries while
retaining the existing maximum.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml b/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
index 8dbaab16b11d4..f406cf6f8f9c1 100644
--- a/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
+++ b/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
@@ -104,6 +104,7 @@ properties:
- const: sf_icp_mnoc
iommus:
+ minItems: 5
maxItems: 8
power-domains:
@@ -404,11 +405,8 @@ examples:
iommus = <&apps_smmu 0x800 0x60>,
<&apps_smmu 0x860 0x60>,
- <&apps_smmu 0x1800 0x60>,
<&apps_smmu 0x1860 0x60>,
<&apps_smmu 0x18e0 0x00>,
- <&apps_smmu 0x1980 0x20>,
- <&apps_smmu 0x1900 0x00>,
<&apps_smmu 0x19a0 0x20>;
power-domains = <&camcc CAM_CC_IFE_0_GDSC>,
--
2.52.0
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v9 3/7] dt-bindings: media: qcom,x1e80100-camss: Add iommus minItems: 5
2026-02-26 14:28 ` [PATCH v9 3/7] dt-bindings: media: qcom,x1e80100-camss: Add iommus minItems: 5 Bryan O'Donoghue
@ 2026-02-27 7:27 ` Krzysztof Kozlowski
2026-02-27 8:50 ` Bryan O'Donoghue
0 siblings, 1 reply; 15+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-27 7:27 UTC (permalink / raw)
To: Bryan O'Donoghue
Cc: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Robert Foss, Todor Tomov,
Mauro Carvalho Chehab, Konrad Dybcio, Vladimir Zapolskiy,
Bryan O'Donoghue, linux-arm-msm, linux-clk, devicetree,
linux-kernel, linux-media
On Thu, Feb 26, 2026 at 02:28:44PM +0000, Bryan O'Donoghue wrote:
> Specify a minimum number of iommus entries. Currently the schema
Why? Your commit msg must explain that.
> requires exactly eight. Add minItems to allow fewer entries while
> retaining the existing maximum.
>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
> Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml b/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
> index 8dbaab16b11d4..f406cf6f8f9c1 100644
> --- a/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
> +++ b/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
> @@ -104,6 +104,7 @@ properties:
> - const: sf_icp_mnoc
>
> iommus:
> + minItems: 5
> maxItems: 8
Same review given to two other such tries from Qualcomm - you need to
list the items. You know differentiate them, so the items in the list
have strict order and meaning.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v9 3/7] dt-bindings: media: qcom,x1e80100-camss: Add iommus minItems: 5
2026-02-27 7:27 ` Krzysztof Kozlowski
@ 2026-02-27 8:50 ` Bryan O'Donoghue
0 siblings, 0 replies; 15+ messages in thread
From: Bryan O'Donoghue @ 2026-02-27 8:50 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Robert Foss, Todor Tomov,
Mauro Carvalho Chehab, Konrad Dybcio, Vladimir Zapolskiy,
Bryan O'Donoghue, linux-arm-msm, linux-clk, devicetree,
linux-kernel, linux-media
On 27/02/2026 07:27, Krzysztof Kozlowski wrote:
> On Thu, Feb 26, 2026 at 02:28:44PM +0000, Bryan O'Donoghue wrote:
>> Specify a minimum number of iommus entries. Currently the schema
>
> Why? Your commit msg must explain that.
>
>> requires exactly eight. Add minItems to allow fewer entries while
>> retaining the existing maximum.
>>
>> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
>> ---
>> Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml | 4 +---
>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml b/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
>> index 8dbaab16b11d4..f406cf6f8f9c1 100644
>> --- a/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
>> +++ b/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
>> @@ -104,6 +104,7 @@ properties:
>> - const: sf_icp_mnoc
>>
>> iommus:
>> + minItems: 5
>> maxItems: 8
>
> Same review given to two other such tries from Qualcomm - you need to
> list the items. You know differentiate them, so the items in the list
> have strict order and meaning.
Ah I knew there was something I couldn't quite remember - an
differentiated list.
Yes np.
---
bod
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v9 4/7] dt-bindings: media: qcom,x1e80100-camss: Allow CSIPHY supplies to be optional
2026-02-26 14:28 [PATCH v9 0/7] Add dt-bindings and dtsi changes for CAMSS on x1e80100 silicon Bryan O'Donoghue
` (2 preceding siblings ...)
2026-02-26 14:28 ` [PATCH v9 3/7] dt-bindings: media: qcom,x1e80100-camss: Add iommus minItems: 5 Bryan O'Donoghue
@ 2026-02-26 14:28 ` Bryan O'Donoghue
2026-02-27 7:28 ` Krzysztof Kozlowski
2026-02-26 14:28 ` [PATCH v9 5/7] media: qcom: camss: Add legacy_phy flag to SoC definition structures Bryan O'Donoghue
` (2 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Bryan O'Donoghue @ 2026-02-26 14:28 UTC (permalink / raw)
To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Robert Foss, Todor Tomov,
Mauro Carvalho Chehab, Konrad Dybcio, Vladimir Zapolskiy,
Bryan O'Donoghue
Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-media,
Bryan O'Donoghue, Krzysztof Kozlowski
When CSIPHY devices are modelled as standalone PHY nodes the voltage
rails are defined per-PHY. Allow the CAMSS-level supply properties
to be omitted in this case.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml | 2 --
1 file changed, 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml b/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
index f406cf6f8f9c1..3a5f179c15910 100644
--- a/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
+++ b/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
@@ -243,8 +243,6 @@ required:
- iommus
- power-domains
- power-domain-names
- - vdd-csiphy-0p8-supply
- - vdd-csiphy-1p2-supply
- ports
additionalProperties: false
--
2.52.0
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v9 4/7] dt-bindings: media: qcom,x1e80100-camss: Allow CSIPHY supplies to be optional
2026-02-26 14:28 ` [PATCH v9 4/7] dt-bindings: media: qcom,x1e80100-camss: Allow CSIPHY supplies to be optional Bryan O'Donoghue
@ 2026-02-27 7:28 ` Krzysztof Kozlowski
0 siblings, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-27 7:28 UTC (permalink / raw)
To: Bryan O'Donoghue
Cc: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Robert Foss, Todor Tomov,
Mauro Carvalho Chehab, Konrad Dybcio, Vladimir Zapolskiy,
Bryan O'Donoghue, linux-arm-msm, linux-clk, devicetree,
linux-kernel, linux-media
On Thu, Feb 26, 2026 at 02:28:45PM +0000, Bryan O'Donoghue wrote:
> When CSIPHY devices are modelled as standalone PHY nodes the voltage
> rails are defined per-PHY. Allow the CAMSS-level supply properties
> to be omitted in this case.
So that's the same patch as adding phys. Why would adding phys and
keeping these required be a correct approach?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v9 5/7] media: qcom: camss: Add legacy_phy flag to SoC definition structures
2026-02-26 14:28 [PATCH v9 0/7] Add dt-bindings and dtsi changes for CAMSS on x1e80100 silicon Bryan O'Donoghue
` (3 preceding siblings ...)
2026-02-26 14:28 ` [PATCH v9 4/7] dt-bindings: media: qcom,x1e80100-camss: Allow CSIPHY supplies to be optional Bryan O'Donoghue
@ 2026-02-26 14:28 ` Bryan O'Donoghue
2026-02-26 14:28 ` [PATCH v9 6/7] media: qcom: camss: Add support for PHY API devices Bryan O'Donoghue
2026-02-26 14:28 ` [PATCH v9 7/7] media: qcom: camss: Drop legacy PHY descriptions from x1e Bryan O'Donoghue
6 siblings, 0 replies; 15+ messages in thread
From: Bryan O'Donoghue @ 2026-02-26 14:28 UTC (permalink / raw)
To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Robert Foss, Todor Tomov,
Mauro Carvalho Chehab, Konrad Dybcio, Vladimir Zapolskiy,
Bryan O'Donoghue
Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-media,
Bryan O'Donoghue, Krzysztof Kozlowski
Flag which SoCs have legacy - builtin PHY code. This will be useful in
subsequent patches to inform PHY bringup logic if legacy bindings are
available.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
drivers/media/platform/qcom/camss/camss.c | 17 +++++++++++++++++
drivers/media/platform/qcom/camss/camss.h | 1 +
2 files changed, 18 insertions(+)
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
index 00b87fd9afbd8..5fb5ad87e1671 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -5104,6 +5104,7 @@ static void camss_remove(struct platform_device *pdev)
static const struct camss_resources msm8916_resources = {
.version = CAMSS_8x16,
+ .legacy_phy = true,
.csiphy_res = csiphy_res_8x16,
.csid_res = csid_res_8x16,
.ispif_res = &ispif_res_8x16,
@@ -5115,6 +5116,7 @@ static const struct camss_resources msm8916_resources = {
static const struct camss_resources msm8939_resources = {
.version = CAMSS_8x39,
+ .legacy_phy = true,
.csiphy_res = csiphy_res_8x39,
.csid_res = csid_res_8x39,
.ispif_res = &ispif_res_8x39,
@@ -5126,6 +5128,7 @@ static const struct camss_resources msm8939_resources = {
static const struct camss_resources msm8953_resources = {
.version = CAMSS_8x53,
+ .legacy_phy = true,
.icc_res = icc_res_8x53,
.icc_path_num = ARRAY_SIZE(icc_res_8x53),
.csiphy_res = csiphy_res_8x96,
@@ -5139,6 +5142,7 @@ static const struct camss_resources msm8953_resources = {
static const struct camss_resources msm8996_resources = {
.version = CAMSS_8x96,
+ .legacy_phy = true,
.csiphy_res = csiphy_res_8x96,
.csid_res = csid_res_8x96,
.ispif_res = &ispif_res_8x96,
@@ -5150,6 +5154,7 @@ static const struct camss_resources msm8996_resources = {
static const struct camss_resources qcm2290_resources = {
.version = CAMSS_2290,
+ .legacy_phy = true,
.csiphy_res = csiphy_res_2290,
.csid_res = csid_res_2290,
.vfe_res = vfe_res_2290,
@@ -5163,6 +5168,7 @@ static const struct camss_resources qcm2290_resources = {
static const struct camss_resources qcs8300_resources = {
.version = CAMSS_8300,
.pd_name = "top",
+ .legacy_phy = true,
.csiphy_res = csiphy_res_8300,
.csid_res = csid_res_8775p,
.csid_wrapper_res = &csid_wrapper_res_sm8550,
@@ -5177,6 +5183,7 @@ static const struct camss_resources qcs8300_resources = {
static const struct camss_resources sa8775p_resources = {
.version = CAMSS_8775P,
.pd_name = "top",
+ .legacy_phy = true,
.csiphy_res = csiphy_res_8775p,
.csid_res = csid_res_8775p,
.csid_wrapper_res = &csid_wrapper_res_sm8550,
@@ -5190,6 +5197,7 @@ static const struct camss_resources sa8775p_resources = {
static const struct camss_resources sdm660_resources = {
.version = CAMSS_660,
+ .legacy_phy = true,
.csiphy_res = csiphy_res_660,
.csid_res = csid_res_660,
.ispif_res = &ispif_res_660,
@@ -5201,6 +5209,7 @@ static const struct camss_resources sdm660_resources = {
static const struct camss_resources sdm670_resources = {
.version = CAMSS_845,
+ .legacy_phy = true,
.csiphy_res = csiphy_res_670,
.csid_res = csid_res_670,
.vfe_res = vfe_res_670,
@@ -5212,6 +5221,7 @@ static const struct camss_resources sdm670_resources = {
static const struct camss_resources sdm845_resources = {
.version = CAMSS_845,
.pd_name = "top",
+ .legacy_phy = true,
.csiphy_res = csiphy_res_845,
.csid_res = csid_res_845,
.vfe_res = vfe_res_845,
@@ -5223,6 +5233,7 @@ static const struct camss_resources sdm845_resources = {
static const struct camss_resources sm6150_resources = {
.version = CAMSS_6150,
.pd_name = "top",
+ .legacy_phy = true,
.csiphy_res = csiphy_res_sm6150,
.csid_res = csid_res_sm6150,
.vfe_res = vfe_res_sm6150,
@@ -5236,6 +5247,7 @@ static const struct camss_resources sm6150_resources = {
static const struct camss_resources sm8250_resources = {
.version = CAMSS_8250,
.pd_name = "top",
+ .legacy_phy = true,
.csiphy_res = csiphy_res_8250,
.csid_res = csid_res_8250,
.vfe_res = vfe_res_8250,
@@ -5249,6 +5261,7 @@ static const struct camss_resources sm8250_resources = {
static const struct camss_resources sc8280xp_resources = {
.version = CAMSS_8280XP,
.pd_name = "top",
+ .legacy_phy = true,
.csiphy_res = csiphy_res_sc8280xp,
.csid_res = csid_res_sc8280xp,
.ispif_res = NULL,
@@ -5263,6 +5276,7 @@ static const struct camss_resources sc8280xp_resources = {
static const struct camss_resources sc7280_resources = {
.version = CAMSS_7280,
.pd_name = "top",
+ .legacy_phy = true,
.csiphy_res = csiphy_res_7280,
.csid_res = csid_res_7280,
.vfe_res = vfe_res_7280,
@@ -5276,6 +5290,7 @@ static const struct camss_resources sc7280_resources = {
static const struct camss_resources sm8550_resources = {
.version = CAMSS_8550,
.pd_name = "top",
+ .legacy_phy = true,
.csiphy_res = csiphy_res_8550,
.csid_res = csid_res_8550,
.vfe_res = vfe_res_8550,
@@ -5290,6 +5305,7 @@ static const struct camss_resources sm8550_resources = {
static const struct camss_resources sm8650_resources = {
.version = CAMSS_8650,
.pd_name = "top",
+ .legacy_phy = true,
.csiphy_res = csiphy_res_sm8650,
.csid_res = csid_res_sm8650,
.csid_wrapper_res = &csid_wrapper_res_sm8550,
@@ -5304,6 +5320,7 @@ static const struct camss_resources sm8650_resources = {
static const struct camss_resources x1e80100_resources = {
.version = CAMSS_X1E80100,
.pd_name = "top",
+ .legacy_phy = true,
.csiphy_res = csiphy_res_x1e80100,
.csid_res = csid_res_x1e80100,
.vfe_res = vfe_res_x1e80100,
diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/platform/qcom/camss/camss.h
index 6d048414c919e..24ec3ad7990e7 100644
--- a/drivers/media/platform/qcom/camss/camss.h
+++ b/drivers/media/platform/qcom/camss/camss.h
@@ -104,6 +104,7 @@ enum icc_count {
struct camss_resources {
enum camss_version version;
const char *pd_name;
+ const bool legacy_phy;
const struct camss_subdev_resources *csiphy_res;
const struct camss_subdev_resources *csid_res;
const struct camss_subdev_resources *ispif_res;
--
2.52.0
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH v9 6/7] media: qcom: camss: Add support for PHY API devices
2026-02-26 14:28 [PATCH v9 0/7] Add dt-bindings and dtsi changes for CAMSS on x1e80100 silicon Bryan O'Donoghue
` (4 preceding siblings ...)
2026-02-26 14:28 ` [PATCH v9 5/7] media: qcom: camss: Add legacy_phy flag to SoC definition structures Bryan O'Donoghue
@ 2026-02-26 14:28 ` Bryan O'Donoghue
2026-02-27 0:05 ` Dmitry Baryshkov
2026-02-26 14:28 ` [PATCH v9 7/7] media: qcom: camss: Drop legacy PHY descriptions from x1e Bryan O'Donoghue
6 siblings, 1 reply; 15+ messages in thread
From: Bryan O'Donoghue @ 2026-02-26 14:28 UTC (permalink / raw)
To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Robert Foss, Todor Tomov,
Mauro Carvalho Chehab, Konrad Dybcio, Vladimir Zapolskiy,
Bryan O'Donoghue
Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-media,
Bryan O'Donoghue, Krzysztof Kozlowski
Add the ability to use a PHY pointer which interacts with the standard PHY
API.
In the first instance the code will try to use the new PHY interface. If no
PHYs are present in the DT then the legacy method will be attempted.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
drivers/media/platform/qcom/camss/Kconfig | 1 +
drivers/media/platform/qcom/camss/camss-csiphy.c | 185 +++++++++++++++++++++--
drivers/media/platform/qcom/camss/camss-csiphy.h | 7 +
drivers/media/platform/qcom/camss/camss.c | 72 +++++++--
4 files changed, 235 insertions(+), 30 deletions(-)
diff --git a/drivers/media/platform/qcom/camss/Kconfig b/drivers/media/platform/qcom/camss/Kconfig
index 4eda48cb1adf0..1edc5e5a1829e 100644
--- a/drivers/media/platform/qcom/camss/Kconfig
+++ b/drivers/media/platform/qcom/camss/Kconfig
@@ -7,3 +7,4 @@ config VIDEO_QCOM_CAMSS
select VIDEO_V4L2_SUBDEV_API
select VIDEOBUF2_DMA_SG
select V4L2_FWNODE
+ select PHY_QCOM_MIPI_CSI2
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/media/platform/qcom/camss/camss-csiphy.c
index 62623393f4144..b8bfbf2fef8fa 100644
--- a/drivers/media/platform/qcom/camss/camss-csiphy.c
+++ b/drivers/media/platform/qcom/camss/camss-csiphy.c
@@ -7,12 +7,14 @@
* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
* Copyright (C) 2016-2018 Linaro Ltd.
*/
+#include <dt-bindings/phy/phy.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/of.h>
+#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <media/media-entity.h>
@@ -131,10 +133,10 @@ static u8 csiphy_get_bpp(const struct csiphy_format_info *formats,
}
/*
- * csiphy_set_clock_rates - Calculate and set clock rates on CSIPHY module
+ * csiphy_set_clock_rates_legacy - Calculate and set clock rates on CSIPHY module
* @csiphy: CSIPHY device
*/
-static int csiphy_set_clock_rates(struct csiphy_device *csiphy)
+static int csiphy_set_clock_rates_legacy(struct csiphy_device *csiphy)
{
struct device *dev = csiphy->camss->dev;
s64 link_freq;
@@ -200,7 +202,7 @@ static int csiphy_set_clock_rates(struct csiphy_device *csiphy)
*
* Return 0 on success or a negative error code otherwise
*/
-static int csiphy_set_power(struct v4l2_subdev *sd, int on)
+static int csiphy_set_power_legacy(struct v4l2_subdev *sd, int on)
{
struct csiphy_device *csiphy = v4l2_get_subdevdata(sd);
struct device *dev = csiphy->camss->dev;
@@ -219,7 +221,7 @@ static int csiphy_set_power(struct v4l2_subdev *sd, int on)
return ret;
}
- ret = csiphy_set_clock_rates(csiphy);
+ ret = csiphy_set_clock_rates_legacy(csiphy);
if (ret < 0) {
regulator_bulk_disable(csiphy->num_supplies,
csiphy->supplies);
@@ -254,7 +256,7 @@ static int csiphy_set_power(struct v4l2_subdev *sd, int on)
}
/*
- * csiphy_stream_on - Enable streaming on CSIPHY module
+ * csiphy_stream_on_legacy - Enable streaming on CSIPHY module
* @csiphy: CSIPHY device
*
* Helper function to enable streaming on CSIPHY module.
@@ -262,7 +264,7 @@ static int csiphy_set_power(struct v4l2_subdev *sd, int on)
*
* Return 0 on success or a negative error code otherwise
*/
-static int csiphy_stream_on(struct csiphy_device *csiphy)
+static int csiphy_stream_on_legacy(struct csiphy_device *csiphy)
{
struct csiphy_config *cfg = &csiphy->cfg;
s64 link_freq;
@@ -306,11 +308,86 @@ static int csiphy_stream_on(struct csiphy_device *csiphy)
*
* Helper function to disable streaming on CSIPHY module
*/
-static void csiphy_stream_off(struct csiphy_device *csiphy)
+static void csiphy_stream_off_legacy(struct csiphy_device *csiphy)
{
csiphy->res->hw_ops->lanes_disable(csiphy, &csiphy->cfg);
}
+/*
+ * csiphy_stream_on - Enable streaming on CSIPHY module
+ * @csiphy: CSIPHY device
+ *
+ * Helper function to enable streaming on CSIPHY module.
+ * Main configuration of CSIPHY module is also done here.
+ *
+ * Return 0 on success or a negative error code otherwise
+ */
+static int csiphy_stream_on(struct csiphy_device *csiphy)
+{
+ u8 bpp = csiphy_get_bpp(csiphy->res->formats->formats, csiphy->res->formats->nformats,
+ csiphy->fmt[MSM_CSIPHY_PAD_SINK].code);
+ u8 num_lanes = csiphy->cfg.csi2->lane_cfg.num_data;
+ struct phy_configure_opts_mipi_dphy *dphy_cfg;
+ union phy_configure_opts dphy_opts = { 0 };
+ struct device *dev = csiphy->camss->dev;
+ s64 link_freq;
+ int ret;
+
+ dphy_cfg = &dphy_opts.mipi_dphy;
+
+ link_freq = camss_get_link_freq(&csiphy->subdev.entity, bpp, num_lanes);
+
+ if (link_freq < 0) {
+ dev_err(dev,
+ "Cannot get CSI2 transmitter's link frequency\n");
+ return -EINVAL;
+ }
+
+ phy_mipi_dphy_get_default_config_for_hsclk(link_freq, num_lanes, dphy_cfg);
+
+ phy_set_mode(csiphy->phy, PHY_MODE_MIPI_DPHY);
+ ret = phy_configure(csiphy->phy, &dphy_opts);
+ if (ret) {
+ dev_err(dev, "failed to configure MIPI D-PHY\n");
+ goto error;
+ }
+
+ return phy_power_on(csiphy->phy);
+
+error:
+ return ret;
+}
+
+/*
+ * csiphy_stream_off - Disable streaming on CSIPHY module
+ * @csiphy: CSIPHY device
+ *
+ * Helper function to disable streaming on CSIPHY module
+ */
+static void csiphy_stream_off(struct csiphy_device *csiphy)
+{
+ phy_power_off(csiphy->phy);
+}
+
+/*
+ * csiphy_set_stream - Enable/disable streaming on CSIPHY module
+ * @sd: CSIPHY V4L2 subdevice
+ * @enable: Requested streaming state
+ *
+ * Return 0 on success or a negative error code otherwise
+ */
+static int csiphy_set_stream_legacy(struct v4l2_subdev *sd, int enable)
+{
+ struct csiphy_device *csiphy = v4l2_get_subdevdata(sd);
+ int ret = 0;
+
+ if (enable)
+ ret = csiphy_stream_on_legacy(csiphy);
+ else
+ csiphy_stream_off_legacy(csiphy);
+
+ return ret;
+}
/*
* csiphy_set_stream - Enable/disable streaming on CSIPHY module
@@ -568,16 +645,16 @@ static bool csiphy_match_clock_name(const char *clock_name, const char *format,
}
/*
- * msm_csiphy_subdev_init - Initialize CSIPHY device structure and resources
+ * msm_csiphy_subdev_init_legacy - Initialize CSIPHY device structure and resources
* @csiphy: CSIPHY device
* @res: CSIPHY module resources table
* @id: CSIPHY module id
*
* Return 0 on success or a negative error code otherwise
*/
-int msm_csiphy_subdev_init(struct camss *camss,
- struct csiphy_device *csiphy,
- const struct camss_subdev_resources *res, u8 id)
+int msm_csiphy_subdev_init_legacy(struct camss *camss,
+ struct csiphy_device *csiphy,
+ const struct camss_subdev_resources *res, u8 id)
{
struct device *dev = camss->dev;
struct platform_device *pdev = to_platform_device(dev);
@@ -705,6 +782,69 @@ int msm_csiphy_subdev_init(struct camss *camss,
return ret;
}
+/*
+ * msm_csiphy_subdev_init - Initialize CSIPHY device structure and resources
+ * @csiphy: CSIPHY device
+ * @res: CSIPHY module resources table
+ * @id: CSIPHY module id
+ *
+ * Return 0 on success or a negative error code otherwise
+ */
+int msm_csiphy_subdev_init(struct camss *camss,
+ struct csiphy_device *csiphy,
+ const struct camss_subdev_resources *res, u8 id)
+{
+ struct device *dev = camss->dev;
+ struct of_phandle_args args;
+ u8 combo_mode;
+ int idx;
+ int ret;
+
+ snprintf(csiphy->name, ARRAY_SIZE(csiphy->name), "csiphy%d", id);
+
+ idx = of_property_match_string(dev->of_node, "phy-names", csiphy->name);
+ if (idx < 0) {
+ dev_err(dev, "%s not found\n", csiphy->name);
+ return idx;
+ }
+
+ ret = of_parse_phandle_with_args(dev->of_node, "phys", "#phy-cells", idx, &args);
+ if (ret < 0) {
+ dev_err(dev, "unable to parse phys args %s\n", csiphy->name);
+ return ret;
+ }
+
+ if (!of_device_is_available(args.np))
+ goto put_np;
+
+ combo_mode = args.args[0];
+ if (combo_mode != PHY_TYPE_DPHY) {
+ dev_err(dev, "%s mode %d not supported\n", csiphy->name, combo_mode);
+ ret = -EOPNOTSUPP;
+ goto put_np;
+ }
+
+ csiphy->phy = devm_phy_get(dev, csiphy->name);
+ if (IS_ERR(csiphy->phy)) {
+ ret = PTR_ERR(csiphy->phy);
+ goto put_np;
+ }
+
+ csiphy->camss = camss;
+ csiphy->id = id;
+ csiphy->cfg.combo_mode = combo_mode;
+ csiphy->res = &res->csiphy;
+
+ ret = phy_init(csiphy->phy);
+ if (ret)
+ dev_err(dev, "phy %s init fail %d\n", csiphy->name, ret);
+
+put_np:
+ of_node_put(args.np);
+
+ return ret;
+}
+
/*
* csiphy_link_setup - Setup CSIPHY connections
* @entity: Pointer to media entity structure
@@ -739,8 +879,12 @@ static int csiphy_link_setup(struct media_entity *entity,
return 0;
}
-static const struct v4l2_subdev_core_ops csiphy_core_ops = {
- .s_power = csiphy_set_power,
+static const struct v4l2_subdev_core_ops csiphy_core_ops_legacy = {
+ .s_power = csiphy_set_power_legacy,
+};
+
+static const struct v4l2_subdev_video_ops csiphy_video_ops_legacy = {
+ .s_stream = csiphy_set_stream_legacy,
};
static const struct v4l2_subdev_video_ops csiphy_video_ops = {
@@ -754,8 +898,13 @@ static const struct v4l2_subdev_pad_ops csiphy_pad_ops = {
.set_fmt = csiphy_set_format,
};
+static const struct v4l2_subdev_ops csiphy_v4l2_ops_legacy = {
+ .core = &csiphy_core_ops_legacy,
+ .video = &csiphy_video_ops_legacy,
+ .pad = &csiphy_pad_ops,
+};
+
static const struct v4l2_subdev_ops csiphy_v4l2_ops = {
- .core = &csiphy_core_ops,
.video = &csiphy_video_ops,
.pad = &csiphy_pad_ops,
};
@@ -784,7 +933,11 @@ int msm_csiphy_register_entity(struct csiphy_device *csiphy,
struct device *dev = csiphy->camss->dev;
int ret;
- v4l2_subdev_init(sd, &csiphy_v4l2_ops);
+ if (IS_ERR(csiphy->phy))
+ v4l2_subdev_init(sd, &csiphy_v4l2_ops_legacy);
+ else
+ v4l2_subdev_init(sd, &csiphy_v4l2_ops);
+
sd->internal_ops = &csiphy_v4l2_internal_ops;
sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
snprintf(sd->name, ARRAY_SIZE(sd->name), "%s%d",
@@ -823,6 +976,8 @@ int msm_csiphy_register_entity(struct csiphy_device *csiphy,
*/
void msm_csiphy_unregister_entity(struct csiphy_device *csiphy)
{
+ if (!IS_ERR(csiphy->phy))
+ phy_exit(csiphy->phy);
v4l2_device_unregister_subdev(&csiphy->subdev);
media_entity_cleanup(&csiphy->subdev.entity);
}
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.h b/drivers/media/platform/qcom/camss/camss-csiphy.h
index 2d5054819df7f..25b803c06e8bf 100644
--- a/drivers/media/platform/qcom/camss/camss-csiphy.h
+++ b/drivers/media/platform/qcom/camss/camss-csiphy.h
@@ -12,6 +12,7 @@
#include <linux/clk.h>
#include <linux/interrupt.h>
+#include <linux/phy/phy.h>
#include <media/media-entity.h>
#include <media/v4l2-device.h>
#include <media/v4l2-mediabus.h>
@@ -95,6 +96,7 @@ struct csiphy_device_regs {
struct csiphy_device {
struct camss *camss;
+ struct phy *phy;
u8 id;
struct v4l2_subdev subdev;
struct media_pad pads[MSM_CSIPHY_PADS_NUM];
@@ -102,6 +104,7 @@ struct csiphy_device {
void __iomem *base_clk_mux;
u32 irq;
char irq_name[30];
+ char name[16];
struct camss_clock *clock;
bool *rate_set;
int nclocks;
@@ -116,6 +119,10 @@ struct csiphy_device {
struct camss_subdev_resources;
+int msm_csiphy_subdev_init_legacy(struct camss *camss,
+ struct csiphy_device *csiphy,
+ const struct camss_subdev_resources *res, u8 id);
+
int msm_csiphy_subdev_init(struct camss *camss,
struct csiphy_device *csiphy,
const struct camss_subdev_resources *res, u8 id);
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
index 5fb5ad87e1671..b1737b5d52160 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -4450,14 +4450,35 @@ static int camss_parse_endpoint_node(struct device *dev,
static int camss_parse_ports(struct camss *camss)
{
struct device *dev = camss->dev;
+ const struct camss_resources *res = camss->res;
struct fwnode_handle *fwnode = dev_fwnode(dev), *ep;
int ret;
fwnode_graph_for_each_endpoint(fwnode, ep) {
struct camss_async_subdev *csd;
+ struct fwnode_handle *remote;
+
+ if (!fwnode_device_is_available(ep))
+ continue;
+
+ if (res->legacy_phy) {
+ csd = v4l2_async_nf_add_fwnode_remote(&camss->notifier, ep,
+ typeof(*csd));
+ } else {
+ /*
+ * For non-legacy PHY, the CSIPHY is a separate device.
+ * Register the remote endpoint (CSIPHY's endpoint) as
+ * the async subdev, not the remote port parent.
+ */
+ remote = fwnode_graph_get_remote_endpoint(ep);
+ if (!remote)
+ continue;
+
+ csd = v4l2_async_nf_add_fwnode(&camss->notifier, remote,
+ struct camss_async_subdev);
+ fwnode_handle_put(remote);
+ }
- csd = v4l2_async_nf_add_fwnode_remote(&camss->notifier, ep,
- typeof(*csd));
if (IS_ERR(csd)) {
ret = PTR_ERR(csd);
goto err_cleanup;
@@ -4489,15 +4510,26 @@ static int camss_init_subdevices(struct camss *camss)
unsigned int i;
int ret;
- for (i = 0; i < camss->res->csiphy_num; i++) {
- ret = msm_csiphy_subdev_init(camss, &camss->csiphy[i],
- &res->csiphy_res[i],
- res->csiphy_res[i].csiphy.id);
- if (ret < 0) {
- dev_err(camss->dev,
- "Failed to init csiphy%d sub-device: %d\n",
- i, ret);
- return ret;
+ if (!res->legacy_phy) {
+ for (i = 0; i < camss->res->csiphy_num; i++) {
+ ret = msm_csiphy_subdev_init(camss, &camss->csiphy[i],
+ &res->csiphy_res[i],
+ res->csiphy_res[i].csiphy.id);
+ if (ret < 0)
+ return ret;
+ }
+ } else {
+ for (i = 0; i < camss->res->csiphy_num; i++) {
+ ret = msm_csiphy_subdev_init_legacy(camss, &camss->csiphy[i],
+ &res->csiphy_res[i],
+ res->csiphy_res[i].csiphy.id);
+ if (ret < 0) {
+ dev_err(camss->dev,
+ "Failed to init csiphy%d sub-device: %d\n",
+ i, ret);
+ return ret;
+ }
+ camss->csiphy[i].phy = ERR_PTR(-ENODEV);
}
}
@@ -4574,6 +4606,9 @@ static int camss_link_entities(struct camss *camss)
for (i = 0; i < camss->res->csiphy_num; i++) {
for (j = 0; j < camss->res->csid_num; j++) {
+ if (!camss->csiphy[i].phy)
+ continue;
+
ret = media_create_pad_link(&camss->csiphy[i].subdev.entity,
MSM_CSIPHY_PAD_SRC,
&camss->csid[j].subdev.entity,
@@ -4683,6 +4718,9 @@ static int camss_register_entities(struct camss *camss)
int ret;
for (i = 0; i < camss->res->csiphy_num; i++) {
+ if (!camss->csiphy[i].phy)
+ continue;
+
ret = msm_csiphy_register_entity(&camss->csiphy[i],
&camss->v4l2_dev);
if (ret < 0) {
@@ -4738,8 +4776,10 @@ static int camss_register_entities(struct camss *camss)
i = camss->res->csiphy_num;
err_reg_csiphy:
- for (i--; i >= 0; i--)
- msm_csiphy_unregister_entity(&camss->csiphy[i]);
+ for (i--; i >= 0; i--) {
+ if (camss->csiphy[i].phy)
+ msm_csiphy_unregister_entity(&camss->csiphy[i]);
+ }
return ret;
}
@@ -4754,8 +4794,10 @@ static void camss_unregister_entities(struct camss *camss)
{
unsigned int i;
- for (i = 0; i < camss->res->csiphy_num; i++)
- msm_csiphy_unregister_entity(&camss->csiphy[i]);
+ for (i = 0; i < camss->res->csiphy_num; i++) {
+ if (camss->csiphy[i].phy)
+ msm_csiphy_unregister_entity(&camss->csiphy[i]);
+ }
for (i = 0; i < camss->res->csid_num; i++)
msm_csid_unregister_entity(&camss->csid[i]);
--
2.52.0
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v9 6/7] media: qcom: camss: Add support for PHY API devices
2026-02-26 14:28 ` [PATCH v9 6/7] media: qcom: camss: Add support for PHY API devices Bryan O'Donoghue
@ 2026-02-27 0:05 ` Dmitry Baryshkov
0 siblings, 0 replies; 15+ messages in thread
From: Dmitry Baryshkov @ 2026-02-27 0:05 UTC (permalink / raw)
To: Bryan O'Donoghue
Cc: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Robert Foss, Todor Tomov,
Mauro Carvalho Chehab, Konrad Dybcio, Vladimir Zapolskiy,
Bryan O'Donoghue, linux-arm-msm, linux-clk, devicetree,
linux-kernel, linux-media, Krzysztof Kozlowski
On Thu, Feb 26, 2026 at 02:28:47PM +0000, Bryan O'Donoghue wrote:
> Add the ability to use a PHY pointer which interacts with the standard PHY
> API.
>
> In the first instance the code will try to use the new PHY interface. If no
> PHYs are present in the DT then the legacy method will be attempted.
>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
> drivers/media/platform/qcom/camss/Kconfig | 1 +
> drivers/media/platform/qcom/camss/camss-csiphy.c | 185 +++++++++++++++++++++--
> drivers/media/platform/qcom/camss/camss-csiphy.h | 7 +
> drivers/media/platform/qcom/camss/camss.c | 72 +++++++--
> 4 files changed, 235 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/camss/Kconfig b/drivers/media/platform/qcom/camss/Kconfig
> index 4eda48cb1adf0..1edc5e5a1829e 100644
> --- a/drivers/media/platform/qcom/camss/Kconfig
> +++ b/drivers/media/platform/qcom/camss/Kconfig
> @@ -7,3 +7,4 @@ config VIDEO_QCOM_CAMSS
> select VIDEO_V4L2_SUBDEV_API
> select VIDEOBUF2_DMA_SG
> select V4L2_FWNODE
> + select PHY_QCOM_MIPI_CSI2
> diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/media/platform/qcom/camss/camss-csiphy.c
> index 62623393f4144..b8bfbf2fef8fa 100644
> --- a/drivers/media/platform/qcom/camss/camss-csiphy.c
> +++ b/drivers/media/platform/qcom/camss/camss-csiphy.c
> @@ -7,12 +7,14 @@
> * Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
> * Copyright (C) 2016-2018 Linaro Ltd.
> */
> +#include <dt-bindings/phy/phy.h>
> #include <linux/clk.h>
> #include <linux/delay.h>
> #include <linux/interrupt.h>
> #include <linux/io.h>
> #include <linux/kernel.h>
> #include <linux/of.h>
> +#include <linux/phy/phy.h>
> #include <linux/platform_device.h>
> #include <linux/pm_runtime.h>
> #include <media/media-entity.h>
> @@ -131,10 +133,10 @@ static u8 csiphy_get_bpp(const struct csiphy_format_info *formats,
> }
>
> /*
> - * csiphy_set_clock_rates - Calculate and set clock rates on CSIPHY module
> + * csiphy_set_clock_rates_legacy - Calculate and set clock rates on CSIPHY module
> * @csiphy: CSIPHY device
> */
> -static int csiphy_set_clock_rates(struct csiphy_device *csiphy)
> +static int csiphy_set_clock_rates_legacy(struct csiphy_device *csiphy)
> {
> struct device *dev = csiphy->camss->dev;
> s64 link_freq;
> @@ -200,7 +202,7 @@ static int csiphy_set_clock_rates(struct csiphy_device *csiphy)
> *
> * Return 0 on success or a negative error code otherwise
> */
> -static int csiphy_set_power(struct v4l2_subdev *sd, int on)
> +static int csiphy_set_power_legacy(struct v4l2_subdev *sd, int on)
> {
> struct csiphy_device *csiphy = v4l2_get_subdevdata(sd);
> struct device *dev = csiphy->camss->dev;
> @@ -219,7 +221,7 @@ static int csiphy_set_power(struct v4l2_subdev *sd, int on)
> return ret;
> }
>
> - ret = csiphy_set_clock_rates(csiphy);
> + ret = csiphy_set_clock_rates_legacy(csiphy);
> if (ret < 0) {
> regulator_bulk_disable(csiphy->num_supplies,
> csiphy->supplies);
> @@ -254,7 +256,7 @@ static int csiphy_set_power(struct v4l2_subdev *sd, int on)
> }
>
> /*
> - * csiphy_stream_on - Enable streaming on CSIPHY module
> + * csiphy_stream_on_legacy - Enable streaming on CSIPHY module
> * @csiphy: CSIPHY device
> *
> * Helper function to enable streaming on CSIPHY module.
> @@ -262,7 +264,7 @@ static int csiphy_set_power(struct v4l2_subdev *sd, int on)
> *
> * Return 0 on success or a negative error code otherwise
> */
> -static int csiphy_stream_on(struct csiphy_device *csiphy)
> +static int csiphy_stream_on_legacy(struct csiphy_device *csiphy)
> {
> struct csiphy_config *cfg = &csiphy->cfg;
> s64 link_freq;
> @@ -306,11 +308,86 @@ static int csiphy_stream_on(struct csiphy_device *csiphy)
> *
> * Helper function to disable streaming on CSIPHY module
> */
> -static void csiphy_stream_off(struct csiphy_device *csiphy)
> +static void csiphy_stream_off_legacy(struct csiphy_device *csiphy)
> {
> csiphy->res->hw_ops->lanes_disable(csiphy, &csiphy->cfg);
> }
>
> +/*
> + * csiphy_stream_on - Enable streaming on CSIPHY module
> + * @csiphy: CSIPHY device
> + *
> + * Helper function to enable streaming on CSIPHY module.
> + * Main configuration of CSIPHY module is also done here.
> + *
> + * Return 0 on success or a negative error code otherwise
> + */
> +static int csiphy_stream_on(struct csiphy_device *csiphy)
> +{
> + u8 bpp = csiphy_get_bpp(csiphy->res->formats->formats, csiphy->res->formats->nformats,
> + csiphy->fmt[MSM_CSIPHY_PAD_SINK].code);
> + u8 num_lanes = csiphy->cfg.csi2->lane_cfg.num_data;
> + struct phy_configure_opts_mipi_dphy *dphy_cfg;
> + union phy_configure_opts dphy_opts = { 0 };
> + struct device *dev = csiphy->camss->dev;
> + s64 link_freq;
> + int ret;
> +
> + dphy_cfg = &dphy_opts.mipi_dphy;
> +
> + link_freq = camss_get_link_freq(&csiphy->subdev.entity, bpp, num_lanes);
> +
> + if (link_freq < 0) {
> + dev_err(dev,
> + "Cannot get CSI2 transmitter's link frequency\n");
> + return -EINVAL;
> + }
> +
> + phy_mipi_dphy_get_default_config_for_hsclk(link_freq, num_lanes, dphy_cfg);
> +
> + phy_set_mode(csiphy->phy, PHY_MODE_MIPI_DPHY);
> + ret = phy_configure(csiphy->phy, &dphy_opts);
> + if (ret) {
> + dev_err(dev, "failed to configure MIPI D-PHY\n");
> + goto error;
> + }
> +
> + return phy_power_on(csiphy->phy);
> +
> +error:
> + return ret;
> +}
> +
> +/*
> + * csiphy_stream_off - Disable streaming on CSIPHY module
> + * @csiphy: CSIPHY device
> + *
> + * Helper function to disable streaming on CSIPHY module
> + */
> +static void csiphy_stream_off(struct csiphy_device *csiphy)
> +{
> + phy_power_off(csiphy->phy);
> +}
> +
> +/*
> + * csiphy_set_stream - Enable/disable streaming on CSIPHY module
> + * @sd: CSIPHY V4L2 subdevice
> + * @enable: Requested streaming state
> + *
> + * Return 0 on success or a negative error code otherwise
> + */
> +static int csiphy_set_stream_legacy(struct v4l2_subdev *sd, int enable)
> +{
> + struct csiphy_device *csiphy = v4l2_get_subdevdata(sd);
> + int ret = 0;
> +
> + if (enable)
> + ret = csiphy_stream_on_legacy(csiphy);
> + else
> + csiphy_stream_off_legacy(csiphy);
> +
> + return ret;
> +}
>
> /*
> * csiphy_set_stream - Enable/disable streaming on CSIPHY module
> @@ -568,16 +645,16 @@ static bool csiphy_match_clock_name(const char *clock_name, const char *format,
> }
>
> /*
> - * msm_csiphy_subdev_init - Initialize CSIPHY device structure and resources
> + * msm_csiphy_subdev_init_legacy - Initialize CSIPHY device structure and resources
> * @csiphy: CSIPHY device
> * @res: CSIPHY module resources table
> * @id: CSIPHY module id
> *
> * Return 0 on success or a negative error code otherwise
> */
> -int msm_csiphy_subdev_init(struct camss *camss,
> - struct csiphy_device *csiphy,
> - const struct camss_subdev_resources *res, u8 id)
> +int msm_csiphy_subdev_init_legacy(struct camss *camss,
> + struct csiphy_device *csiphy,
> + const struct camss_subdev_resources *res, u8 id)
> {
> struct device *dev = camss->dev;
> struct platform_device *pdev = to_platform_device(dev);
> @@ -705,6 +782,69 @@ int msm_csiphy_subdev_init(struct camss *camss,
> return ret;
> }
>
> +/*
> + * msm_csiphy_subdev_init - Initialize CSIPHY device structure and resources
> + * @csiphy: CSIPHY device
> + * @res: CSIPHY module resources table
> + * @id: CSIPHY module id
> + *
> + * Return 0 on success or a negative error code otherwise
> + */
> +int msm_csiphy_subdev_init(struct camss *camss,
> + struct csiphy_device *csiphy,
> + const struct camss_subdev_resources *res, u8 id)
> +{
> + struct device *dev = camss->dev;
> + struct of_phandle_args args;
> + u8 combo_mode;
> + int idx;
> + int ret;
> +
> + snprintf(csiphy->name, ARRAY_SIZE(csiphy->name), "csiphy%d", id);
> +
> + idx = of_property_match_string(dev->of_node, "phy-names", csiphy->name);
> + if (idx < 0) {
> + dev_err(dev, "%s not found\n", csiphy->name);
It can't be an error. You are breaking the possiblity for existing
platforms to gradually migrate from the legacy DT bindings to the new
CSI PHY bindings (or to the new CSI PHY driver, if you prefer it this
way).
Not to mention that you've just broken compatibility with the camss
schema that was defined for the last 4(?) Linux releases for X1E8.
> + return idx;
> + }
> +
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v9 7/7] media: qcom: camss: Drop legacy PHY descriptions from x1e
2026-02-26 14:28 [PATCH v9 0/7] Add dt-bindings and dtsi changes for CAMSS on x1e80100 silicon Bryan O'Donoghue
` (5 preceding siblings ...)
2026-02-26 14:28 ` [PATCH v9 6/7] media: qcom: camss: Add support for PHY API devices Bryan O'Donoghue
@ 2026-02-26 14:28 ` Bryan O'Donoghue
6 siblings, 0 replies; 15+ messages in thread
From: Bryan O'Donoghue @ 2026-02-26 14:28 UTC (permalink / raw)
To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Robert Foss, Todor Tomov,
Mauro Carvalho Chehab, Konrad Dybcio, Vladimir Zapolskiy,
Bryan O'Donoghue
Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-media,
Bryan O'Donoghue, Krzysztof Kozlowski
x1e is the first CAMSS SoC to use the new PHY interface. Drop the redundant
legacy CSIPHY descriptions.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
drivers/media/platform/qcom/camss/camss.c | 37 -------------------------------
1 file changed, 37 deletions(-)
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
index b1737b5d52160..0ebe634f5d96b 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -3895,15 +3895,6 @@ static const struct resources_icc icc_res_sa8775p[] = {
static const struct camss_subdev_resources csiphy_res_x1e80100[] = {
/* CSIPHY0 */
{
- .regulators = {
- { .supply = "vdd-csiphy-0p8", .init_load_uA = 105000 },
- { .supply = "vdd-csiphy-1p2", .init_load_uA = 58900 }
- },
- .clock = { "csiphy0", "csiphy0_timer" },
- .clock_rate = { { 300000000, 400000000, 480000000 },
- { 266666667, 400000000 } },
- .reg = { "csiphy0" },
- .interrupt = { "csiphy0" },
.csiphy = {
.id = 0,
.hw_ops = &csiphy_ops_3ph_1_0,
@@ -3912,15 +3903,6 @@ static const struct camss_subdev_resources csiphy_res_x1e80100[] = {
},
/* CSIPHY1 */
{
- .regulators = {
- { .supply = "vdd-csiphy-0p8", .init_load_uA = 105000 },
- { .supply = "vdd-csiphy-1p2", .init_load_uA = 58900 }
- },
- .clock = { "csiphy1", "csiphy1_timer" },
- .clock_rate = { { 300000000, 400000000, 480000000 },
- { 266666667, 400000000 } },
- .reg = { "csiphy1" },
- .interrupt = { "csiphy1" },
.csiphy = {
.id = 1,
.hw_ops = &csiphy_ops_3ph_1_0,
@@ -3929,15 +3911,6 @@ static const struct camss_subdev_resources csiphy_res_x1e80100[] = {
},
/* CSIPHY2 */
{
- .regulators = {
- { .supply = "vdd-csiphy-0p8", .init_load_uA = 105000 },
- { .supply = "vdd-csiphy-1p2", .init_load_uA = 58900 }
- },
- .clock = { "csiphy2", "csiphy2_timer" },
- .clock_rate = { { 300000000, 400000000, 480000000 },
- { 266666667, 400000000 } },
- .reg = { "csiphy2" },
- .interrupt = { "csiphy2" },
.csiphy = {
.id = 2,
.hw_ops = &csiphy_ops_3ph_1_0,
@@ -3946,15 +3919,6 @@ static const struct camss_subdev_resources csiphy_res_x1e80100[] = {
},
/* CSIPHY4 */
{
- .regulators = {
- { .supply = "vdd-csiphy-0p8", .init_load_uA = 105000 },
- { .supply = "vdd-csiphy-1p2", .init_load_uA = 58900 }
- },
- .clock = { "csiphy4", "csiphy4_timer" },
- .clock_rate = { { 300000000, 400000000, 480000000 },
- { 266666667, 400000000 } },
- .reg = { "csiphy4" },
- .interrupt = { "csiphy4" },
.csiphy = {
.id = 4,
.hw_ops = &csiphy_ops_3ph_1_0,
@@ -5362,7 +5326,6 @@ static const struct camss_resources sm8650_resources = {
static const struct camss_resources x1e80100_resources = {
.version = CAMSS_X1E80100,
.pd_name = "top",
- .legacy_phy = true,
.csiphy_res = csiphy_res_x1e80100,
.csid_res = csid_res_x1e80100,
.vfe_res = vfe_res_x1e80100,
--
2.52.0
^ permalink raw reply [flat|nested] 15+ messages in thread