Re: [PATCH v3 2/7] dt-bindings: mfd: brcm,bcm59056: Add compatible for BCM59054

From: Artur Weber
Date: Wed Feb 05 2025 - 12:58:37 EST


On 2.02.2025 14:24, Krzysztof Kozlowski wrote:
On Fri, Jan 31, 2025 at 07:13:50PM +0100, Artur Weber wrote:
...
@@ -22,7 +24,6 @@ properties:
regulators:
type: object
description: Container node for regulators.
- $ref: ../regulator/brcm,bcm59056.yaml

Refs should rather stay here, so I don't think keeping these devices in
one binding makes it simpler.

Simpler - drop ref and add properties compatible with enum for your
regulator compatibles.


The only problem with that is that the regulator nodes have no
compatibles. I see two ways out of it: either we add a compatible then
use the compatible enum (might break existing users who don't have the
compatible, unless we make the driver ignore it), or if we just want to
simplify but not add compatibles, list all the refs under an oneOf
condition (like it's done in
Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml[1]).

Personally I'm in favor of keeping this as-is, though, for the benefit
of the DT linter preventing accidental mixing of bindings for different
device types (e.g. BCM59056 MFD node with BCM59054 regulators). There's
at least some precedent for this method[2]. But if making it simple is
what's considered better, I'll go with one of the aforementioned
options.

Best regards
Artur

[1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml#n147
[2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Documentation/devicetree/bindings/mfd/samsung,s2mps11.yaml#n69