Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dt-bindings: usb: usb-device: relax compatible pattern to a contains

The dt-core typically allows multiple compatibles[1] but usb-device
currently forces a single compatible.

This is an issue when multiple devices with slightly different productID
all behave the same. This would require the driver to keep updating its
compatible matching table to include this new productID instead of doing
what is usually done: have two compatibles, the leftmost which matches
exactly the HW device definition, and the rightmost one as a fallback
which is assumed to be 100% compatible with the device at hand. If this
assumption turns out to be wrong, it is easy to work around this without
having to modify the device tree by handling the leftmost compatible in the driver.

[1] https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/dt-core.yaml#L21-L25

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250418-dt-binding-usb-device-compatibles-v2-1-b3029f14e800@cherry.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Quentin Schulz and committed by
Greg Kroah-Hartman
495df45f f4239ace

+2 -1
+2 -1
Documentation/devicetree/bindings/usb/usb-device.yaml
··· 28 28 29 29 properties: 30 30 compatible: 31 - pattern: "^usb[0-9a-f]{1,4},[0-9a-f]{1,4}$" 31 + contains: 32 + pattern: "^usb[0-9a-f]{1,4},[0-9a-f]{1,4}$" 32 33 description: Device nodes or combined nodes. 33 34 "usbVID,PID", where VID is the vendor id and PID the product id. 34 35 The textual representation of VID and PID shall be in lower case