On Wed, 18 Sep 2024 11:29:28 +1200, Chris Packham wrote: > Add dtschema for the I2C controller on the RTL9300 SoC. The I2C > controllers on this SoC are part of the "switch" block which is > represented here as a syscon node. The SCL pins are dependent on the I2C > controller (GPIO8 for the first controller, GPIO 17 for the second). The > SDA pins can be assigned to either one of the I2C controllers (but not > both). > > Signed-off-by: Chris Packham <chris.packham@xxxxxxxxxxxxxxxxxxx> > --- > > Notes: > This does hit generate the following dt_binding_check warning > > realtek,rtl9300-i2c.example.dts:22.19-30.13: Warning (unit_address_vs_reg): /example-0/switch@1b000000/i2c@36c: node has a unit name, but no reg or ranges property > > Which is totally correct. I haven't given this thing a reg property > because I'm using an offset from the parent syscon node. I'm also not > calling the first offset "offset" but I don't think that'd help. > > I looked at a couple of other examples of devices that are children of > syscon nodes (e.g. armada-ap806-thermal, ap806-cpu-clock) these do have > a reg property in the dts but as far as I can see from the code it's not > actually used, instead the register offsets are in the code looked up > from the driver data (in at least one-case the reg offset is for a > legacy usage). > > So I'm a little unsure what to do here. I can add a reg property and > update the driver to use that to get the offset for the first set of > registers (or just not use it). Or I could drop the @36c from the node > names but then I coudn't distinguish the two controllers without failing > the $nodename: requirement from i2c-controller.yaml. > > .../bindings/i2c/realtek,rtl9300-i2c.yaml | 73 +++++++++++++++++++ > MAINTAINERS | 6 ++ > 2 files changed, 79 insertions(+) > create mode 100644 Documentation/devicetree/bindings/i2c/realtek,rtl9300-i2c.yaml > My bot found errors running 'make dt_binding_check' on your patch: yamllint warnings/errors: dtschema/dtc warnings/errors: Documentation/devicetree/bindings/i2c/realtek,rtl9300-i2c.example.dts:22.19-30.13: Warning (unit_address_vs_reg): /example-0/switch@1b000000/i2c@36c: node has a unit name, but no reg or ranges property Documentation/devicetree/bindings/i2c/realtek,rtl9300-i2c.example.dts:32.19-38.13: Warning (unit_address_vs_reg): /example-0/switch@1b000000/i2c@388: node has a unit name, but no reg or ranges property Documentation/devicetree/bindings/i2c/realtek,rtl9300-i2c.example.dtb: /example-0/switch@1b000000: failed to match any schema with compatible: ['realtek,rtl9302c-switch', 'syscon', 'simple-mfd'] doc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20240917232932.3641992-2-chris.packham@xxxxxxxxxxxxxxxxxxx The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.