[v2,4/6] dt-bindings: misc: atmel-ssc: LRCLK from TF/RF pin option
diff mbox series

Message ID 9b85d5a7c7e788e9ed87d020323ad9292e3aeab7.1566677788.git.mirq-linux@rere.qmqm.pl
State Changes Requested
Headers show
Series
  • ] ASoC: atmel: extend SSC support
Related show

Checks

Context Check Description
robh/checkpatch success

Commit Message

Michał Mirosław Aug. 24, 2019, 8:26 p.m. UTC
Add single-pin LRCLK source options for Atmel SSC module.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>

---
  v2: split from implementation patch

---
 Documentation/devicetree/bindings/misc/atmel-ssc.txt | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Rob Herring Aug. 27, 2019, 10:37 p.m. UTC | #1
On Sat, Aug 24, 2019 at 10:26:55PM +0200, Michał Mirosław wrote:
> Add single-pin LRCLK source options for Atmel SSC module.
> 
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> 
> ---
>   v2: split from implementation patch
> 
> ---
>  Documentation/devicetree/bindings/misc/atmel-ssc.txt | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/misc/atmel-ssc.txt b/Documentation/devicetree/bindings/misc/atmel-ssc.txt
> index f9fb412642fe..c98e96dbec3a 100644
> --- a/Documentation/devicetree/bindings/misc/atmel-ssc.txt
> +++ b/Documentation/devicetree/bindings/misc/atmel-ssc.txt
> @@ -24,6 +24,11 @@ Optional properties:
>         this parameter to choose where the clock from.
>       - By default the clock is from TK pin, if the clock from RK pin, this
>         property is needed.
> +  - atmel,lrclk-from-tf-pin: bool property.
> +  - atmel,lrclk-from-rf-pin: bool property.
> +     - SSC in slave mode gets LRCLK from RF for receive and TF for transmit
> +       data direction. This property makes both use single TF (or RF) pin
> +       as LRCLK. At most one can be present.

A single property taking 1 of possible 2 values would prevent the error 
of more than 1 property present.

>    - #sound-dai-cells: Should contain <0>.
>       - This property makes the SSC into an automatically registered DAI.
>  
> -- 
> 2.20.1
>
Michał Mirosław Aug. 28, 2019, 1:02 p.m. UTC | #2
On Tue, Aug 27, 2019 at 05:37:16PM -0500, Rob Herring wrote:
> On Sat, Aug 24, 2019 at 10:26:55PM +0200, Michał Mirosław wrote:
> > Add single-pin LRCLK source options for Atmel SSC module.
> > 
> > Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> > 
> > ---
> >   v2: split from implementation patch
> > 
> > ---
> >  Documentation/devicetree/bindings/misc/atmel-ssc.txt | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/misc/atmel-ssc.txt b/Documentation/devicetree/bindings/misc/atmel-ssc.txt
> > index f9fb412642fe..c98e96dbec3a 100644
> > --- a/Documentation/devicetree/bindings/misc/atmel-ssc.txt
> > +++ b/Documentation/devicetree/bindings/misc/atmel-ssc.txt
> > @@ -24,6 +24,11 @@ Optional properties:
> >         this parameter to choose where the clock from.
> >       - By default the clock is from TK pin, if the clock from RK pin, this
> >         property is needed.
> > +  - atmel,lrclk-from-tf-pin: bool property.
> > +  - atmel,lrclk-from-rf-pin: bool property.
> > +     - SSC in slave mode gets LRCLK from RF for receive and TF for transmit
> > +       data direction. This property makes both use single TF (or RF) pin
> > +       as LRCLK. At most one can be present.
> 
> A single property taking 1 of possible 2 values would prevent the error 
> of more than 1 property present.

It still would need a validation check in the code, though: you
could put wrong value then.  It seems more consistent with the
existing parameters to have two bool properties.

Best Regards,
Michał Mirosław
Rob Herring Aug. 28, 2019, 6:34 p.m. UTC | #3
On Wed, Aug 28, 2019 at 8:03 AM Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:
>
> On Tue, Aug 27, 2019 at 05:37:16PM -0500, Rob Herring wrote:
> > On Sat, Aug 24, 2019 at 10:26:55PM +0200, Michał Mirosław wrote:
> > > Add single-pin LRCLK source options for Atmel SSC module.
> > >
> > > Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> > >
> > > ---
> > >   v2: split from implementation patch
> > >
> > > ---
> > >  Documentation/devicetree/bindings/misc/atmel-ssc.txt | 5 +++++
> > >  1 file changed, 5 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/misc/atmel-ssc.txt b/Documentation/devicetree/bindings/misc/atmel-ssc.txt
> > > index f9fb412642fe..c98e96dbec3a 100644
> > > --- a/Documentation/devicetree/bindings/misc/atmel-ssc.txt
> > > +++ b/Documentation/devicetree/bindings/misc/atmel-ssc.txt
> > > @@ -24,6 +24,11 @@ Optional properties:
> > >         this parameter to choose where the clock from.
> > >       - By default the clock is from TK pin, if the clock from RK pin, this
> > >         property is needed.
> > > +  - atmel,lrclk-from-tf-pin: bool property.
> > > +  - atmel,lrclk-from-rf-pin: bool property.
> > > +     - SSC in slave mode gets LRCLK from RF for receive and TF for transmit
> > > +       data direction. This property makes both use single TF (or RF) pin
> > > +       as LRCLK. At most one can be present.
> >
> > A single property taking 1 of possible 2 values would prevent the error
> > of more than 1 property present.
>
> It still would need a validation check in the code, though: you
> could put wrong value then.  It seems more consistent with the
> existing parameters to have two bool properties.

It was validation using schema that I was thinking about. Expressing a
possible set of values for a property is easier than inter-property
constraints.

But if you really prefer as-is:

Reviewed-by: Rob Herring <robh@kernel.org>

Patch
diff mbox series

diff --git a/Documentation/devicetree/bindings/misc/atmel-ssc.txt b/Documentation/devicetree/bindings/misc/atmel-ssc.txt
index f9fb412642fe..c98e96dbec3a 100644
--- a/Documentation/devicetree/bindings/misc/atmel-ssc.txt
+++ b/Documentation/devicetree/bindings/misc/atmel-ssc.txt
@@ -24,6 +24,11 @@  Optional properties:
        this parameter to choose where the clock from.
      - By default the clock is from TK pin, if the clock from RK pin, this
        property is needed.
+  - atmel,lrclk-from-tf-pin: bool property.
+  - atmel,lrclk-from-rf-pin: bool property.
+     - SSC in slave mode gets LRCLK from RF for receive and TF for transmit
+       data direction. This property makes both use single TF (or RF) pin
+       as LRCLK. At most one can be present.
   - #sound-dai-cells: Should contain <0>.
      - This property makes the SSC into an automatically registered DAI.