All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Stefan Riedmüller" <S.Riedmueller@phytec.de>
To: "robh@kernel.org" <robh@kernel.org>
Cc: "mchehab@kernel.org" <mchehab@kernel.org>,
	"laurent.pinchart@ideasonboard.com" 
	<laurent.pinchart@ideasonboard.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"sakari.ailus@linux.intel.com" <sakari.ailus@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5 5/6] media: dt-bindings: mt9p031: Convert bindings to yaml
Date: Wed, 14 Jul 2021 10:01:29 +0000	[thread overview]
Message-ID: <99b0b3ad4eac3a5653e0e4630bf59fc63eef114d.camel@phytec.de> (raw)
In-Reply-To: <20210714021904.GA1312716@robh.at.kernel.org>

Hi Rob,

On Tue, 2021-07-13 at 20:19 -0600, Rob Herring wrote:
> On Mon, Jul 12, 2021 at 10:55:34AM +0200, Stefan Riedmueller wrote:
> > Convert mt9p031 sensor bindings to yaml schema. Also update the
> > MAINTAINERS entry.
> > 
> > Although input-clock-frequency and pixel-clock-frequency have not been
> > definded as endpoint propierties in the textual bindings, the sensor
> > does parse them from the endpoint. Thus move these properties to the
> > endpoint in the new yaml bindings.
> > 
> > Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
> > ---
> >  .../bindings/media/i2c/aptina,mt9p031.yaml    | 75 +++++++++++++++++++
> >  .../devicetree/bindings/media/i2c/mt9p031.txt | 40 ----------
> >  MAINTAINERS                                   |  1 +
> >  3 files changed, 76 insertions(+), 40 deletions(-)
> >  create mode 100644
> > Documentation/devicetree/bindings/media/i2c/aptina,mt9p031.yaml
> >  delete mode 100644
> > Documentation/devicetree/bindings/media/i2c/mt9p031.txt
> > 
> > diff --git
> > a/Documentation/devicetree/bindings/media/i2c/aptina,mt9p031.yaml
> > b/Documentation/devicetree/bindings/media/i2c/aptina,mt9p031.yaml
> > new file mode 100644
> > index 000000000000..ad9a2db73d86
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/i2c/aptina,mt9p031.yaml
> > @@ -0,0 +1,75 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/media/i2c/aptina,mt9p031.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Aptina 1/2.5-Inch 5Mp CMOS Digital Image Sensor
> > +
> > +maintainers:
> > +  - Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > +
> > +description: |
> > +  The Aptina MT9P031 is a 1/2.5-inch CMOS active pixel digital image
> > sensor
> > +  with an active array size of 2592H x 1944V. It is programmable through
> > a
> > +  simple two-wire serial interface.
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - aptina,mt9p031
> > +      - aptina,mt9p031m
> > +
> > +  reg:
> > +    description: I2C device address
> > +    maxItems: 1
> > +
> > +  reset-gpios:
> > +    maxItems: 1
> > +    description: Chip reset GPIO
> > +
> > +  port:
> > +    $ref: /schemas/graph.yaml#/$defs/port-base
> > +    additionalProperties: false
> > +
> > +    properties:
> > +      endpoint:
> > +        $ref: /schemas/media/video-interfaces.yaml#
> 
> Doesn't look like you use any properties from video-interfaces.yaml. You 
> should just reference graph.yaml#/$defs/endpoint-base instead.

Thanks for your comment. It made me realize, that I have something wrong. The
driver does use properties from the video interface as it parses the bus
configuration from the endpoint. But I thought these properties were
implicitly used by referencing the video-interfaces schema. Now I assume that
I have to mention them here explicitly. Correct?

> 
> > +        unevaluatedProperties: false
> > +
> > +        properties:
> > +          input-clock-frequency: true
> > +          pixel-clock-frequency: true
> 
> These are custom properties, so they need a type, description, and any 
> constraints.

I'll add that.

Thanks,
Stefan

> 
> > +
> > +        required:
> > +          - input-clock-frequency
> > +          - pixel-clock-frequency
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - port
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    i2c0 {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        mt9p031@5d {
> > +            compatible = "aptina,mt9p031";
> > +            reg = <0x5d>;
> > +            reset-gpios = <&gpio_sensor 0 0>;
> > +
> > +            port {
> > +                mt9p031_1: endpoint {
> > +                    input-clock-frequency = <6000000>;
> > +                    pixel-clock-frequency = <96000000>;
> > +                };
> > +            };
> > +        };
> > +    };
> > +
> > +...
> > diff --git a/Documentation/devicetree/bindings/media/i2c/mt9p031.txt
> > b/Documentation/devicetree/bindings/media/i2c/mt9p031.txt
> > deleted file mode 100644
> > index cb60443ff78f..000000000000
> > --- a/Documentation/devicetree/bindings/media/i2c/mt9p031.txt
> > +++ /dev/null
> > @@ -1,40 +0,0 @@
> > -* Aptina 1/2.5-Inch 5Mp CMOS Digital Image Sensor
> > -
> > -The Aptina MT9P031 is a 1/2.5-inch CMOS active pixel digital image sensor
> > with
> > -an active array size of 2592H x 1944V. It is programmable through a
> > simple
> > -two-wire serial interface.
> > -
> > -Required Properties:
> > -- compatible: value should be either one among the following
> > -	(a) "aptina,mt9p031" for mt9p031 sensor
> > -	(b) "aptina,mt9p031m" for mt9p031m sensor
> > -
> > -- input-clock-frequency: Input clock frequency.
> > -
> > -- pixel-clock-frequency: Pixel clock frequency.
> > -
> > -Optional Properties:
> > -- reset-gpios: Chip reset GPIO
> > -
> > -For further reading on port node refer to
> > -Documentation/devicetree/bindings/media/video-interfaces.txt.
> > -
> > -Example:
> > -
> > -	i2c0@1c22000 {
> > -		...
> > -		...
> > -		mt9p031@5d {
> > -			compatible = "aptina,mt9p031";
> > -			reg = <0x5d>;
> > -			reset-gpios = <&gpio3 30 0>;
> > -
> > -			port {
> > -				mt9p031_1: endpoint {
> > -					input-clock-frequency = <6000000>;
> > -					pixel-clock-frequency = <96000000>;
> > -				};
> > -			};
> > -		};
> > -		...
> > -	};
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index a61f4f3b78a9..33dd81237a91 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -12635,6 +12635,7 @@ M:	Laurent Pinchart <
> > laurent.pinchart@ideasonboard.com>
> >  L:	linux-media@vger.kernel.org
> >  S:	Maintained
> >  T:	git git://linuxtv.org/media_tree.git
> > +F:	Documentation/devicetree/bindings/media/i2c/aptina,mt9p031.yaml
> >  F:	drivers/media/i2c/mt9p031.c
> >  F:	include/media/i2c/mt9p031.h
> >  
> > -- 
> > 2.25.1
> > 
> > 

  reply	other threads:[~2021-07-14 10:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-12  8:55 [PATCH v5 0/6] media: mt9p031: Read back the real clock rate Stefan Riedmueller
2021-07-12  8:55 ` [PATCH v5 1/6] " Stefan Riedmueller
2021-07-12  8:55 ` [PATCH v5 2/6] media: mt9p031: Make pixel clock polarity configurable by DT Stefan Riedmueller
2021-07-12  8:55 ` [PATCH v5 3/6] media: mt9p031: Fix corrupted frame after restarting stream Stefan Riedmueller
2021-07-12  8:55 ` [PATCH v5 4/6] media: mt9p031: Use BIT macro Stefan Riedmueller
2021-07-12  8:55 ` [PATCH v5 5/6] media: dt-bindings: mt9p031: Convert bindings to yaml Stefan Riedmueller
2021-07-14  2:19   ` Rob Herring
2021-07-14 10:01     ` Stefan Riedmüller [this message]
2021-07-14 14:19       ` Rob Herring
2021-07-12  8:55 ` [PATCH v5 6/6] media: dt-bindings: mt9p031: Add missing required properties Stefan Riedmueller
2021-07-14  2:19   ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=99b0b3ad4eac3a5653e0e4630bf59fc63eef114d.camel@phytec.de \
    --to=s.riedmueller@phytec.de \
    --cc=devicetree@vger.kernel.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=robh@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.