diff mbox

[v2,1/2] ASoC: da7218: Add bindings documentation for DA7218 audio codec

Message ID 760d212f18efec816701f2b3e9fc549ca86d31ee.1447254553.git.Adam.Thomson.Opensource@diasemi.com (mailing list archive)
State New, archived
Headers show

Commit Message

Adam Thomson Nov. 11, 2015, 3:40 p.m. UTC
Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
---
 Documentation/devicetree/bindings/sound/da7218.txt | 106 +++++++++++++++++++++
 1 file changed, 106 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/da7218.txt

--
1.9.3

Comments

Rob Herring (Arm) Nov. 11, 2015, 8:19 p.m. UTC | #1
On Wed, Nov 11, 2015 at 03:40:22PM +0000, Adam Thomson wrote:
> Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
> ---
>  Documentation/devicetree/bindings/sound/da7218.txt | 106 +++++++++++++++++++++
>  1 file changed, 106 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/sound/da7218.txt
> 
> diff --git a/Documentation/devicetree/bindings/sound/da7218.txt b/Documentation/devicetree/bindings/sound/da7218.txt
> new file mode 100644
> index 0000000..35a53dd
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/da7218.txt
> @@ -0,0 +1,106 @@
> +Dialog Semiconductor DA7218 Audio Codec bindings
> +
> +DA7218 is an audio codec with HP detect feature.
> +
> +======
> +
> +Required properties:
> +- compatible : Should be "dlg,da7217" or "dlg,da7218"
> +- reg: Specifies the I2C slave address
> +
> +- VDD-supply: VDD power supply for the device
> +- VDDMIC-supply: VDDMIC power supply for the device
> +- VDDIO-supply: VDDIO power supply for the device
> +  (See Documentation/devicetree/bindings/regulator/regulator.txt for further
> +   information relating to regulators)
> +
> +Optional properties:
> +- interrupt-parent: Specifies the phandle of the interrupt controller to which
> +  the IRQs from DA7218 are delivered to.
> +- interrupts: IRQ line info for DA7218 chip.
> +  (See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt for
> +   further information relating to interrupt properties)
> +- interrupt-names : Name associated with interrupt line. Should be "wakeup" if
> +  interrupt is to be used to wake system, otherwise "irq" should be used.
> +- wakeup-source: Flag to indicate this device can wake system (suspend/resume).
> +
> +- clocks : phandle and clock specifier for codec MCLK.
> +- clock-names : Clock name string for 'clocks' attribute, should be "mclk".
> +
> +- dlg,micbias1-lvl : Voltage (mV) for Mic Bias 1
> +	[<1200>, <1600>, <1800>, <2000>, <2200>, <2400>, <2600>, <2800>, <3000>]
> +- dlg,micbias2-lvl : Voltage (mV) for Mic Bias 2
> +	[<1200>, <1600>, <1800>, <2000>, <2200>, <2400>, <2600>, <2800>, <3000>]

Units please (-microvolt).

> +- dlg,mic1-amp-in-sel : Mic1 input source type
> +	["diff", "se_p", "se_n"]
> +- dlg,mic2-amp-in-sel : Mic2 input source type
> +	["diff", "se_p", "se_n"]
> +- dlg,dmic1-data-sel : DMIC1 channel select based on clock edge.
> +	["lrise_rfall", "lfall_rrise"]
> +- dlg,dmic1-samplephase : When to sample audio from DMIC1.
> +	["on_clkedge", "between_clkedge"]
> +- dlg,dmic1-clkrate : DMic1 clock frequency (Hz).
> +	[<1500000>, <3000000>]
> +- dlg,dmic2-data-sel : DMic2 channel select based on clock edge.
> +	["lrise_rfall", "lfall_rrise"]
> +- dlg,dmic2-samplephase : When to sample audio from DMic2.
> +	["on_clkedge", "between_clkedge"]
> +- dlg,dmic2-clkrate : DMic2 clock frequency (Hz).
> +	[<1500000>, <3000000>]
> +- dlg,hp-diff-single-supply : Boolean flag, use single supply for HP
> +			      (DA7217 only)
> +
> +======
> +
> +Optional Child node - 'da7218_hpldet' (DA7218 only):
> +
> +Optional properties:
> +- dlg,jack-rate : Time between jack detect measurements (us)
> +	[<5>, <10>, <20>, <40>, <80>, <160>, <320>, <640>]

Units

Rob
Adam Thomson Nov. 17, 2015, 5:27 p.m. UTC | #2
On November 11, 2015 20:20, Rob Herring wrote:

> > +- dlg,micbias1-lvl : Voltage (mV) for Mic Bias 1
> > +	[<1200>, <1600>, <1800>, <2000>, <2200>, <2400>, <2600>, <2800>,
> <3000>]
> > +- dlg,micbias2-lvl : Voltage (mV) for Mic Bias 2
> > +	[<1200>, <1600>, <1800>, <2000>, <2200>, <2400>, <2600>, <2800>,
> <3000>]
> 
> Units please (-microvolt).

I refer back to our previous discussion (https://lkml.org/lkml/2015/10/8/661).
This doesn't add anything and makes the binding name unnecessarily long. Why is
this being enforced? Whoever uses the binding will have to look at the
documentation to understand which values are valid anyway, so this seems like
cruft.

> > +Optional properties:
> > +- dlg,jack-rate : Time between jack detect measurements (us)
> > +	[<5>, <10>, <20>, <40>, <80>, <160>, <320>, <640>]
> 
> Units

ditto.
Rob Herring (Arm) Nov. 17, 2015, 5:53 p.m. UTC | #3
On Tue, Nov 17, 2015 at 11:27 AM, Opensource [Adam Thomson]
<Adam.Thomson.Opensource@diasemi.com> wrote:
> On November 11, 2015 20:20, Rob Herring wrote:
>
>> > +- dlg,micbias1-lvl : Voltage (mV) for Mic Bias 1
>> > +   [<1200>, <1600>, <1800>, <2000>, <2200>, <2400>, <2600>, <2800>,
>> <3000>]
>> > +- dlg,micbias2-lvl : Voltage (mV) for Mic Bias 2
>> > +   [<1200>, <1600>, <1800>, <2000>, <2200>, <2400>, <2600>, <2800>,
>> <3000>]
>>
>> Units please (-microvolt).
>
> I refer back to our previous discussion (https://lkml.org/lkml/2015/10/8/661).
> This doesn't add anything and makes the binding name unnecessarily long. Why is
> this being enforced? Whoever uses the binding will have to look at the
> documentation to understand which values are valid anyway, so this seems like
> cruft.

It is simply standard, best practice for new bindings. Certainly there
are examples that don't follow this, but they are either old or
escaped review.

Drop the 'lvl' part if you are so concerned about length.

Rob
Adam Thomson Nov. 18, 2015, 11:23 a.m. UTC | #4
On November 17, 2015 17:54, Rob Herring wrote:

> >> > +- dlg,micbias1-lvl : Voltage (mV) for Mic Bias 1
> >> > +   [<1200>, <1600>, <1800>, <2000>, <2200>, <2400>, <2600>, <2800>,
> >> <3000>]
> >> > +- dlg,micbias2-lvl : Voltage (mV) for Mic Bias 2
> >> > +   [<1200>, <1600>, <1800>, <2000>, <2200>, <2400>, <2600>, <2800>,
> >> <3000>]
> >>
> >> Units please (-microvolt).
> >
> > I refer back to our previous discussion (https://lkml.org/lkml/2015/10/8/661).
> > This doesn't add anything and makes the binding name unnecessarily long. Why is
> > this being enforced? Whoever uses the binding will have to look at the
> > documentation to understand which values are valid anyway, so this seems like
> > cruft.
> 
> It is simply standard, best practice for new bindings. Certainly there
> are examples that don't follow this, but they are either old or
> escaped review.
> 
> Drop the 'lvl' part if you are so concerned about length.

If this is a standard, then maybe this should be explicitly documented and
pushed to all other maintainers so it isn't escaping review? Otherwise you're
left with a disparity which suggests it isn't standard at all. Personally I
stand by that for device specific bindings this shouldn't apply as it gains
nothing except achieving an overly long binding, or you end up cutting down the
descriptive part of the name to accommodate units at the end.
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/sound/da7218.txt b/Documentation/devicetree/bindings/sound/da7218.txt
new file mode 100644
index 0000000..35a53dd
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/da7218.txt
@@ -0,0 +1,106 @@ 
+Dialog Semiconductor DA7218 Audio Codec bindings
+
+DA7218 is an audio codec with HP detect feature.
+
+======
+
+Required properties:
+- compatible : Should be "dlg,da7217" or "dlg,da7218"
+- reg: Specifies the I2C slave address
+
+- VDD-supply: VDD power supply for the device
+- VDDMIC-supply: VDDMIC power supply for the device
+- VDDIO-supply: VDDIO power supply for the device
+  (See Documentation/devicetree/bindings/regulator/regulator.txt for further
+   information relating to regulators)
+
+Optional properties:
+- interrupt-parent: Specifies the phandle of the interrupt controller to which
+  the IRQs from DA7218 are delivered to.
+- interrupts: IRQ line info for DA7218 chip.
+  (See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt for
+   further information relating to interrupt properties)
+- interrupt-names : Name associated with interrupt line. Should be "wakeup" if
+  interrupt is to be used to wake system, otherwise "irq" should be used.
+- wakeup-source: Flag to indicate this device can wake system (suspend/resume).
+
+- clocks : phandle and clock specifier for codec MCLK.
+- clock-names : Clock name string for 'clocks' attribute, should be "mclk".
+
+- dlg,micbias1-lvl : Voltage (mV) for Mic Bias 1
+	[<1200>, <1600>, <1800>, <2000>, <2200>, <2400>, <2600>, <2800>, <3000>]
+- dlg,micbias2-lvl : Voltage (mV) for Mic Bias 2
+	[<1200>, <1600>, <1800>, <2000>, <2200>, <2400>, <2600>, <2800>, <3000>]
+- dlg,mic1-amp-in-sel : Mic1 input source type
+	["diff", "se_p", "se_n"]
+- dlg,mic2-amp-in-sel : Mic2 input source type
+	["diff", "se_p", "se_n"]
+- dlg,dmic1-data-sel : DMIC1 channel select based on clock edge.
+	["lrise_rfall", "lfall_rrise"]
+- dlg,dmic1-samplephase : When to sample audio from DMIC1.
+	["on_clkedge", "between_clkedge"]
+- dlg,dmic1-clkrate : DMic1 clock frequency (Hz).
+	[<1500000>, <3000000>]
+- dlg,dmic2-data-sel : DMic2 channel select based on clock edge.
+	["lrise_rfall", "lfall_rrise"]
+- dlg,dmic2-samplephase : When to sample audio from DMic2.
+	["on_clkedge", "between_clkedge"]
+- dlg,dmic2-clkrate : DMic2 clock frequency (Hz).
+	[<1500000>, <3000000>]
+- dlg,hp-diff-single-supply : Boolean flag, use single supply for HP
+			      (DA7217 only)
+
+======
+
+Optional Child node - 'da7218_hpldet' (DA7218 only):
+
+Optional properties:
+- dlg,jack-rate : Time between jack detect measurements (us)
+	[<5>, <10>, <20>, <40>, <80>, <160>, <320>, <640>]
+- dlg,jack-debounce : Number of debounce measurements taken for jack detect
+	[<0>, <2>, <3>, <4>]
+- dlg,jack-threshold : Threshold level for jack detection (% of VDD)
+	[<84>, <88>, <92>, <96>]
+- dlg,comp-inv : Boolean flag, invert comparator output
+- dlg,hyst : Boolean flag, enable hysteresis
+- dlg,discharge : Boolean flag, auto discharge of Mic Bias on jack removal
+
+======
+
+Example:
+
+	codec: da7218@1a {
+		compatible = "dlg,da7218";
+		reg = <0x1a>;
+		interrupt-parent = <&gpio6>;
+		interrupts = <11 IRQ_TYPE_LEVEL_HIGH>;
+		wakeup-source;
+
+		VDD-supply = <&reg_audio>;
+		VDDMIC-supply = <&reg_audio>;
+		VDDIO-supply = <&reg_audio>;
+
+		clocks = <&clks 201>;
+		clock-names = "mclk";
+
+		dlg,ldo-lvl = <1200>;
+
+		dlg,micbias1-lvl = <2600>;
+		dlg,micbias2-lvl = <2600>;
+		dlg,mic1-amp-in-sel = "diff";
+		dlg,mic2-amp-in-sel = "diff";
+
+		dlg,dmic1-data-sel = "lrise_rfall";
+		dlg,dmic1-samplephase = "on_clkedge";
+		dlg,dmic1-clkrate = <3000000>;
+		dlg,dmic2-data-sel = "lrise_rfall";
+		dlg,dmic2-samplephase = "on_clkedge";
+		dlg,dmic2-clkrate = <3000000>;
+
+		da7218_hpldet {
+			dlg,jack-rate = <40>;
+			dlg,jack-debounce = <2>;
+			dlg,jack-threshold = <84>;
+			dlg,hyst;
+		};
+	};