Re: [PATCH] dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp: do not reference whole usb-switch.yaml

From: Neil Armstrong

Date: Wed Oct 01 2025 - 03:07:38 EST


On 9/30/25 21:10, Dmitry Baryshkov wrote:
On Fri, Sep 05, 2025 at 12:55:33PM -0500, Rob Herring wrote:
On Tue, Sep 02, 2025 at 06:10:05PM +0200, Neil Armstrong wrote:
Both bindings describe a different layout of the ports properties,
leading to errors when validating DT using this PHY bindings as
reported by Rob Herring.

Reported-by: Rob Herring <robh@xxxxxxxxxx>
Closes: https://lore.kernel.org/all/175462129176.394940.16810637795278334342.robh@xxxxxxxxxx/
Fixes: 3bad7fe22796 ("dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp: Reference usb-switch.yaml to allow mode-switch")
Signed-off-by: Neil Armstrong <neil.armstrong@xxxxxxxxxx>
---
.../devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml
index c8bc512df08b5694c8599f475de78679a4438449..5005514d7c3a1e4a8893883497fd204bc04e12be 100644
--- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml
@@ -73,8 +73,11 @@ properties:
description:
See include/dt-bindings/phy/phy-qcom-qmp.h
- mode-switch: true
- orientation-switch: true
+ mode-switch:
+ $ref: /schemas/usb/usb-switch.yaml#properties/mode-switch
+
+ orientation-switch:
+ $ref: /schemas/usb/usb-switch.yaml#properties/orientation-switch

This is a pattern we try to avoid with references at a property level. I
prefer you make port and ports not required in usb-switch.yaml.

But this solution is also not perfect. E.g.
Documentation/devicetree/bindings/phy/fsl,imx8mq-usb-phy.yaml should
only allow the orienttion-switch property, while using
allOf:$ref:usb-switch.yaml allows all three (orientation-switch,
mode-switch, retimer-switch).


I agree, but I'm not the original author of this change.

Neil