diff mbox series

[v3,02/12] dt-bindings: media: i2c: max9286: Add property to select I2C speed

Message ID 20221214233825.13050-3-laurent.pinchart+renesas@ideasonboard.com (mailing list archive)
State New, archived
Headers show
Series media: i2c: max9286: Small new features | expand

Commit Message

Laurent Pinchart Dec. 14, 2022, 11:38 p.m. UTC
The I2C speed on the remote side (the I2C master bus of the connected
serializers) is configurable, and doesn't need to match the speed of the
local bus (the slave bus of the MAX9286). All remote buses must use the
same speed, and the MAX9286 needs to be programmed accordingly. Add a
new DT property to select the speed to make it configurable.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
Changes since v2:

- Rename property to maxim,i2c-remote-bus-hz
- Specify the property type
---
 .../devicetree/bindings/media/i2c/maxim,max9286.yaml      | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Rob Herring (Arm) Dec. 15, 2022, 1:24 p.m. UTC | #1
On Thu, 15 Dec 2022 01:38:15 +0200, Laurent Pinchart wrote:
> The I2C speed on the remote side (the I2C master bus of the connected
> serializers) is configurable, and doesn't need to match the speed of the
> local bus (the slave bus of the MAX9286). All remote buses must use the
> same speed, and the MAX9286 needs to be programmed accordingly. Add a
> new DT property to select the speed to make it configurable.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
> ---
> Changes since v2:
> 
> - Rename property to maxim,i2c-remote-bus-hz
> - Specify the property type
> ---
>  .../devicetree/bindings/media/i2c/maxim,max9286.yaml      | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml: properties:maxim,i2c-remote-bus-hz: '$ref' should not be valid under {'const': '$ref'}
	hint: Standard unit suffix properties don't need a type $ref
	from schema $id: http://devicetree.org/meta-schemas/core.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20221214233825.13050-3-laurent.pinchart+renesas@ideasonboard.com

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.
Laurent Pinchart Dec. 15, 2022, 1:43 p.m. UTC | #2
Hi Rob,

On Thu, Dec 15, 2022 at 07:24:38AM -0600, Rob Herring wrote:
> On Thu, 15 Dec 2022 01:38:15 +0200, Laurent Pinchart wrote:
> > The I2C speed on the remote side (the I2C master bus of the connected
> > serializers) is configurable, and doesn't need to match the speed of the
> > local bus (the slave bus of the MAX9286). All remote buses must use the
> > same speed, and the MAX9286 needs to be programmed accordingly. Add a
> > new DT property to select the speed to make it configurable.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > Reviewed-by: Rob Herring <robh@kernel.org>
> > ---
> > Changes since v2:
> > 
> > - Rename property to maxim,i2c-remote-bus-hz
> > - Specify the property type
> > ---
> >  .../devicetree/bindings/media/i2c/maxim,max9286.yaml      | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> 
> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> on your patch (DT_CHECKER_FLAGS is new in v5.13):
> 
> yamllint warnings/errors:
> 
> dtschema/dtc warnings/errors:
> /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml: properties:maxim,i2c-remote-bus-hz: '$ref' should not be valid under {'const': '$ref'}
> 	hint: Standard unit suffix properties don't need a type $ref
> 	from schema $id: http://devicetree.org/meta-schemas/core.yaml#

I wonder how I missed that, as I've run dt_binding_check before
submitting. I'll fix it.

I'm a bit surprised though, all unit-suffixed properties use 32-bit
integers in the DT schema, while I can imagine that some may need a
64-bit integer. What's the recommendation in that case ?

> doc reference errors (make refcheckdocs):
> 
> See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20221214233825.13050-3-laurent.pinchart+renesas@ideasonboard.com
> 
> 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.
Rob Herring (Arm) Dec. 15, 2022, 4:22 p.m. UTC | #3
On Thu, Dec 15, 2022 at 03:43:28PM +0200, Laurent Pinchart wrote:
> Hi Rob,
> 
> On Thu, Dec 15, 2022 at 07:24:38AM -0600, Rob Herring wrote:
> > On Thu, 15 Dec 2022 01:38:15 +0200, Laurent Pinchart wrote:
> > > The I2C speed on the remote side (the I2C master bus of the connected
> > > serializers) is configurable, and doesn't need to match the speed of the
> > > local bus (the slave bus of the MAX9286). All remote buses must use the
> > > same speed, and the MAX9286 needs to be programmed accordingly. Add a
> > > new DT property to select the speed to make it configurable.
> > > 
> > > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > > Reviewed-by: Rob Herring <robh@kernel.org>
> > > ---
> > > Changes since v2:
> > > 
> > > - Rename property to maxim,i2c-remote-bus-hz
> > > - Specify the property type
> > > ---
> > >  .../devicetree/bindings/media/i2c/maxim,max9286.yaml      | 8 ++++++++
> > >  1 file changed, 8 insertions(+)
> > > 
> > 
> > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> > on your patch (DT_CHECKER_FLAGS is new in v5.13):
> > 
> > yamllint warnings/errors:
> > 
> > dtschema/dtc warnings/errors:
> > /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml: properties:maxim,i2c-remote-bus-hz: '$ref' should not be valid under {'const': '$ref'}
> > 	hint: Standard unit suffix properties don't need a type $ref
> > 	from schema $id: http://devicetree.org/meta-schemas/core.yaml#
> 
> I wonder how I missed that, as I've run dt_binding_check before
> submitting. I'll fix it.
> 
> I'm a bit surprised though, all unit-suffixed properties use 32-bit
> integers in the DT schema, while I can imagine that some may need a
> 64-bit integer. What's the recommendation in that case ?

Use -mhz.

Anything outside the norm we have to special case in 
property-units.yaml.

Rob
Laurent Pinchart Dec. 15, 2022, 4:46 p.m. UTC | #4
Hi Rob,

On Thu, Dec 15, 2022 at 10:22:16AM -0600, Rob Herring wrote:
> On Thu, Dec 15, 2022 at 03:43:28PM +0200, Laurent Pinchart wrote:
> > On Thu, Dec 15, 2022 at 07:24:38AM -0600, Rob Herring wrote:
> > > On Thu, 15 Dec 2022 01:38:15 +0200, Laurent Pinchart wrote:
> > > > The I2C speed on the remote side (the I2C master bus of the connected
> > > > serializers) is configurable, and doesn't need to match the speed of the
> > > > local bus (the slave bus of the MAX9286). All remote buses must use the
> > > > same speed, and the MAX9286 needs to be programmed accordingly. Add a
> > > > new DT property to select the speed to make it configurable.
> > > > 
> > > > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > > > Reviewed-by: Rob Herring <robh@kernel.org>
> > > > ---
> > > > Changes since v2:
> > > > 
> > > > - Rename property to maxim,i2c-remote-bus-hz
> > > > - Specify the property type
> > > > ---
> > > >  .../devicetree/bindings/media/i2c/maxim,max9286.yaml      | 8 ++++++++
> > > >  1 file changed, 8 insertions(+)
> > > > 
> > > 
> > > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> > > on your patch (DT_CHECKER_FLAGS is new in v5.13):
> > > 
> > > yamllint warnings/errors:
> > > 
> > > dtschema/dtc warnings/errors:
> > > /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml: properties:maxim,i2c-remote-bus-hz: '$ref' should not be valid under {'const': '$ref'}
> > > 	hint: Standard unit suffix properties don't need a type $ref
> > > 	from schema $id: http://devicetree.org/meta-schemas/core.yaml#
> > 
> > I wonder how I missed that, as I've run dt_binding_check before
> > submitting. I'll fix it.
> > 
> > I'm a bit surprised though, all unit-suffixed properties use 32-bit
> > integers in the DT schema, while I can imagine that some may need a
> > 64-bit integer. What's the recommendation in that case ?
> 
> Use -mhz.

I expected that answer :-) It's not an issue with this specific
property, so I'm fine. If I ever run into the need of a 64-bit Hz value
to have both range and precision, we'll talk about it then :-) I don't
expect that to be very common.

> Anything outside the norm we have to special case in 
> property-units.yaml.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml b/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml
index 4f28690eabcd..315a6eef6198 100644
--- a/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml
+++ b/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml
@@ -50,6 +50,14 @@  properties:
   '#gpio-cells':
     const: 2
 
+  maxim,i2c-remote-bus-hz:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [ 8470, 28300, 84700, 105000, 173000, 339000, 533000, 837000 ]
+    default: 105000
+    description: |
+      The I2C clock frequency for the remote I2C buses. The value must match
+      the configuration of the remote serializers.
+
   maxim,reverse-channel-microvolt:
     minimum: 30000
     maximum: 200000