mbox series

[v2,0/3] Fairphone 5 DisplayPort over USB-C support

Message ID 20250312-fp5-pmic-glink-dp-v2-0-a55927749d77@fairphone.com (mailing list archive)
Headers show
Series Fairphone 5 DisplayPort over USB-C support | expand

Message

Luca Weiss March 12, 2025, 12:05 p.m. UTC
This series adds all the necessary bits to enable DisplayPort-out over
USB-C on Fairphone 5.

There's currently a dt validation error with this, not quite sure how to
resolve this:

  arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dtb: typec-mux@42: port:endpoint: Unevaluated properties are not allowed ('data-lanes' was unexpected)
          from schema $id: http://devicetree.org/schemas/usb/fcs,fsa4480.yaml#

See also this mail plus replies:
* https://lore.kernel.org/linux-arm-msm/D0H3VE6RLM2I.MK2NT1P9N02O@fairphone.com/

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
Changes in v2:
- Move adding "*-switch;" properties already in earlier patches
- Move wiring up SS USB & DP to SoC instead of being done in device
- Pick up tags
- Link to v1: https://lore.kernel.org/r/20250226-fp5-pmic-glink-dp-v1-0-e6661d38652c@fairphone.com

---
Luca Weiss (3):
      arm64: dts: qcom: qcm6490-fairphone-fp5: Add PTN36502 redriver
      arm64: dts: qcom: qcm6490-fairphone-fp5: Add OCP96011 audio switch
      arm64: dts: qcom: qcm6490-fairphone-fp5: Hook up DisplayPort over USB-C

 arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 103 +++++++++++++++++++--
 arch/arm64/boot/dts/qcom/sc7280.dtsi               |   9 +-
 2 files changed, 104 insertions(+), 8 deletions(-)
---
base-commit: dcb11dc4740372cd4cce0b763a4a8ec4e9f347a6
change-id: 20231208-fp5-pmic-glink-dp-216b76084bee

Best regards,

Comments

Dmitry Baryshkov March 12, 2025, 7:06 p.m. UTC | #1
On Wed, Mar 12, 2025 at 01:05:07PM +0100, Luca Weiss wrote:
> This series adds all the necessary bits to enable DisplayPort-out over
> USB-C on Fairphone 5.
> 
> There's currently a dt validation error with this, not quite sure how to
> resolve this:
> 
>   arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dtb: typec-mux@42: port:endpoint: Unevaluated properties are not allowed ('data-lanes' was unexpected)
>           from schema $id: http://devicetree.org/schemas/usb/fcs,fsa4480.yaml#

This comes from usb-switch.yaml, it requires that 'port' adheres to the
/schemas/graph.yaml#/properties/port (which forbids extra properties).
The usb-switch.yaml needs to be fixed to use port-base for that node.

> 
> See also this mail plus replies:
> * https://lore.kernel.org/linux-arm-msm/D0H3VE6RLM2I.MK2NT1P9N02O@fairphone.com/
> 
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
> Changes in v2:
> - Move adding "*-switch;" properties already in earlier patches
> - Move wiring up SS USB & DP to SoC instead of being done in device
> - Pick up tags
> - Link to v1: https://lore.kernel.org/r/20250226-fp5-pmic-glink-dp-v1-0-e6661d38652c@fairphone.com
> 
> ---
> Luca Weiss (3):
>       arm64: dts: qcom: qcm6490-fairphone-fp5: Add PTN36502 redriver
>       arm64: dts: qcom: qcm6490-fairphone-fp5: Add OCP96011 audio switch
>       arm64: dts: qcom: qcm6490-fairphone-fp5: Hook up DisplayPort over USB-C
> 
>  arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 103 +++++++++++++++++++--
>  arch/arm64/boot/dts/qcom/sc7280.dtsi               |   9 +-
>  2 files changed, 104 insertions(+), 8 deletions(-)
> ---
> base-commit: dcb11dc4740372cd4cce0b763a4a8ec4e9f347a6
> change-id: 20231208-fp5-pmic-glink-dp-216b76084bee
> 
> Best regards,
> -- 
> Luca Weiss <luca.weiss@fairphone.com>
>
Luca Weiss April 1, 2025, 9:32 a.m. UTC | #2
Hi Dmitry,

On Wed Mar 12, 2025 at 8:06 PM CET, Dmitry Baryshkov wrote:
> On Wed, Mar 12, 2025 at 01:05:07PM +0100, Luca Weiss wrote:
>> This series adds all the necessary bits to enable DisplayPort-out over
>> USB-C on Fairphone 5.
>> 
>> There's currently a dt validation error with this, not quite sure how to
>> resolve this:
>> 
>>   arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dtb: typec-mux@42: port:endpoint: Unevaluated properties are not allowed ('data-lanes' was unexpected)
>>           from schema $id: http://devicetree.org/schemas/usb/fcs,fsa4480.yaml#
>
> This comes from usb-switch.yaml, it requires that 'port' adheres to the
> /schemas/graph.yaml#/properties/port (which forbids extra properties).
> The usb-switch.yaml needs to be fixed to use port-base for that node.

Thanks, do you think the attached patch would be suitable? It does fix
the warning for me, but not sure if it's too lax or doing the wrong
thing.

diff --git a/Documentation/devicetree/bindings/usb/usb-switch.yaml b/Documentation/devicetree/bindings/usb/usb-switch.yaml
index da76118e73a5..9598c1748d35 100644
--- a/Documentation/devicetree/bindings/usb/usb-switch.yaml
+++ b/Documentation/devicetree/bindings/usb/usb-switch.yaml
@@ -26,11 +26,15 @@ properties:
     type: boolean
 
   port:
-    $ref: /schemas/graph.yaml#/properties/port
+    $ref: /schemas/graph.yaml#/$defs/port-base
     description:
       A port node to link the device to a TypeC controller for the purpose of
       handling altmode muxing and orientation switching.
 
+    patternProperties:
+      "^endpoint(@[0-9a-f]+)?$":
+        $ref: /schemas/graph.yaml#/$defs/endpoint-base
+
   ports:
     $ref: /schemas/graph.yaml#/properties/ports
     properties:


Regards
Luca

>
>> 
>> See also this mail plus replies:
>> * https://lore.kernel.org/linux-arm-msm/D0H3VE6RLM2I.MK2NT1P9N02O@fairphone.com/
>> 
>> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
>> ---
>> Changes in v2:
>> - Move adding "*-switch;" properties already in earlier patches
>> - Move wiring up SS USB & DP to SoC instead of being done in device
>> - Pick up tags
>> - Link to v1: https://lore.kernel.org/r/20250226-fp5-pmic-glink-dp-v1-0-e6661d38652c@fairphone.com
>> 
>> ---
>> Luca Weiss (3):
>>       arm64: dts: qcom: qcm6490-fairphone-fp5: Add PTN36502 redriver
>>       arm64: dts: qcom: qcm6490-fairphone-fp5: Add OCP96011 audio switch
>>       arm64: dts: qcom: qcm6490-fairphone-fp5: Hook up DisplayPort over USB-C
>> 
>>  arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 103 +++++++++++++++++++--
>>  arch/arm64/boot/dts/qcom/sc7280.dtsi               |   9 +-
>>  2 files changed, 104 insertions(+), 8 deletions(-)
>> ---
>> base-commit: dcb11dc4740372cd4cce0b763a4a8ec4e9f347a6
>> change-id: 20231208-fp5-pmic-glink-dp-216b76084bee
>> 
>> Best regards,
>> -- 
>> Luca Weiss <luca.weiss@fairphone.com>
>>