diff mbox

[v3,2/2] Documentation: dt: bindings: sound: Add bindings for CS35L32

Message ID 1407183077-23807-2-git-send-email-brian.austin@cirrus.com (mailing list archive)
State New, archived
Headers show

Commit Message

Austin, Brian Aug. 4, 2014, 8:11 p.m. UTC
The patch adds device tree bindings file for the Cirrus Logic CS35L32

Changes for v2:
- Remove Gain Manager from DT and move to driver kcontrol
- Add VP-Supply for regulator

Changes for v3:
- Add regulator disable for error return in i2c_probe

Signed-off-by: Brian Austin <brian.austin@cirrus.com>
---
 .../devicetree/bindings/sound/cs35l32.txt          |   62 ++++++++++++++++++++
 1 file changed, 62 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/cs35l32.txt

Comments

Varka Bhadram Aug. 5, 2014, 4:01 a.m. UTC | #1
On 08/05/2014 01:41 AM, Brian Austin wrote:
> The patch adds device tree bindings file for the Cirrus Logic CS35L32
>
> Changes for v2:
> - Remove Gain Manager from DT and move to driver kcontrol
> - Add VP-Supply for regulator
>
> Changes for v3:
> - Add regulator disable for error return in i2c_probe
>
> Signed-off-by: Brian Austin <brian.austin@cirrus.com>
> ---
>   .../devicetree/bindings/sound/cs35l32.txt          |   62 ++++++++++++++++++++
>   1 file changed, 62 insertions(+)
>   create mode 100644 Documentation/devicetree/bindings/sound/cs35l32.txt
>
> diff --git a/Documentation/devicetree/bindings/sound/cs35l32.txt b/Documentation/devicetree/bindings/sound/cs35l32.txt
> new file mode 100644
> index 0000000..1417d3f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/cs35l32.txt
> @@ -0,0 +1,62 @@
> +CS35L32 audio CODEC
> +
> +Required properties:
> +
> +  - compatible : "cirrus,cs35l32"
> +
> +  - reg : the I2C address of the device for I2C. Address is determined by the level
> +  of the AD0 pin. Level 0 is 0x40 while Level 1 is 0x41.
> +
> +  - VA-supply, VP-supply : power supplies for the device,
> +  as covered in Documentation/devicetree/bindings/regulator/regulator.txt.
> +
> +Optional properties:
> +
> +  - reset-gpios : a GPIO spec for the reset pin. If specified, it will be
> +  deasserted before communication to the codec starts.
> +
> +  - cirrus,boost-manager : Boost voltage control.
> +  0 = Automatically managed.  Boost-converter output voltage is the higher
> +  of the two: Class G or adaptive LED voltage.
> +  1 = Automatically managed irrespective of audio, adapting for low-power
> +  dissipation when LEDs are ON, and operating in Fixed-Boost Bypass Mode
> +  if LEDs are OFF (VBST = VP).
> +  2 = (Default) Boost voltage fixed in Bypass Mode (VBST = VP).
> +  3 = Boost voltage fixed at 5 V.
> +
> +  - cirrus,sdout-datacfg : Data configuration for dual CS35L32 applications only.
> +  Determines the data packed in a two-CS35L32 configuration.
> +  0 = Left/right channels VMON[11:0], IMON[11:0], VPMON[7:0].
> +  1 = Left/right channels VMON[11:0], IMON[11:0], STATUS.
> +  2 = (Default) left/right channels VMON[15:0], IMON [15:0].
> +  3 = Left/right channels VPMON[7:0], STATUS.
> +
> +  - cirrus,sdout-share : SDOUT sharing. Determines whether one or two CS35L32
> +  devices are on board sharing SDOUT.
> +  0 = (Default) One IC.
> +  1 = Two IC's.
> +
> +  - cirrus,battery-recovery : Low battery nominal recovery threshold, rising VP.
> +  0 = 3.1V
> +  1 = 3.2V
> +  2 = 3.3V (Default)
> +  3 = 3.4V
> +
> +  - cirrus,battery-threshold : Low battery nominal threshold, falling VP.
> +  0 = 3.1V
> +  1 = 3.2V
> +  2 = 3.3V
> +  3 = 3.4V (Default)
> +  4 = 3.5V
> +  5 = 3.6V
> +

Proper indentation for all the properties... These are not readable like this...

Required properties:
  - compatible:		"cirrus,cs35l32"
  - reg:			the I2C address of the device for I2C. Address is determined by the level
			of the AD0 pin. Level 0 is 0x40 while Level 1 is 0x41.
  - VA-supply,VP-supply:	power supplies for the device,
			as covered in Documentation/devicetree/bindings/regulator/regulator.txt.

Optional properties:
  - reset-gpios:		a GPIO spec for the reset pin. If specified, it will be
			deasserted before communication to the codec starts.
  - cirrus,boost-manager:Boost voltage control.
			0 = Automatically managed.
				Boost-converter output voltage is the higher
				of the two: Class G or adaptive LED voltage.
			1 = Automatically managed irrespective of audio, adapting for low-power

......

> +Example:
> +
> +codec: codec@40 {
> +	compatible = "cirrus,cs35l32";
> +	reg = <0x40>;
> +	reset-gpios = <&gpio 10 0>;
> +	cirrus,boost-manager = <0x03>;
> +	cirrus,sdout-datacfg = <0x02>;
> +	VA-supply = <&reg_audio>;
> +};
Austin, Brian Aug. 5, 2014, 2:28 p.m. UTC | #2
On Mon, 4 Aug 2014, Varka Bhadram wrote:
> > +  0 = Left/right channels VMON[11:0], IMON[11:0], VPMON[7:0].
> > +  1 = Left/right channels VMON[11:0], IMON[11:0], STATUS.
> > +  2 = (Default) left/right channels VMON[15:0], IMON [15:0].
> > +  3 = Left/right channels VPMON[7:0], STATUS.
> > +
> > +  - cirrus,sdout-share : SDOUT sharing. Determines whether one or two
> > CS35L32
> > +  devices are on board sharing SDOUT.
> > +  0 = (Default) One IC.
> > +  1 = Two IC's.
> > +
> > +  - cirrus,battery-recovery : Low battery nominal recovery threshold,
> > rising VP.
> > +  0 = 3.1V
> > +  1 = 3.2V
> > +  2 = 3.3V (Default)
> > +  3 = 3.4V
> > +
> > +  - cirrus,battery-threshold : Low battery nominal threshold, falling VP.
> > +  0 = 3.1V
> > +  1 = 3.2V
> > +  2 = 3.3V
> > +  3 = 3.4V (Default)
> > +  4 = 3.5V
> > +  5 = 3.6V
> > +
> 
> Proper indentation for all the properties... These are not readable like
> this...
> 
> Required properties:
>  - compatible:		"cirrus,cs35l32"
>  - reg:			the I2C address of the device for I2C. Address is
> determined by the level
> 			of the AD0 pin. Level 0 is 0x40 while Level 1 is 0x41.
>  - VA-supply,VP-supply:	power supplies for the device,
> 			as covered in
> Documentation/devicetree/bindings/regulator/regulator.txt.
> 
> Optional properties:
>  - reset-gpios:		a GPIO spec for the reset pin. If specified, it will
> be
> 			deasserted before communication to the codec starts.
>  - cirrus,boost-manager:Boost voltage control.
> 			0 = Automatically managed.
> 				Boost-converter output voltage is the higher
> 				of the two: Class G or adaptive LED voltage.
> 			1 = Automatically managed irrespective of audio,
> adapting for low-power
> 
> -- 
> Regards,
> Varka Bhadram.
> 
> 
Well when I look at your example that makes it more difficult for me to 
read ;)

I think if there is a mandatory style we are looking for I would expect it 
to be documented. Maybe I have missed that? I take my bindings file from 
examples already in the mainline and find this to be acceptable and 
readable for me.

Thanks,
Brian
Varka Bhadram Aug. 5, 2014, 2:36 p.m. UTC | #3
On Tuesday 05 August 2014 07:58 PM, Brian Austin wrote:
> On Mon, 4 Aug 2014, Varka Bhadram wrote:
>>> +  0 = Left/right channels VMON[11:0], IMON[11:0], VPMON[7:0].
>>> +  1 = Left/right channels VMON[11:0], IMON[11:0], STATUS.
>>> +  2 = (Default) left/right channels VMON[15:0], IMON [15:0].
>>> +  3 = Left/right channels VPMON[7:0], STATUS.
>>> +
>>> +  - cirrus,sdout-share : SDOUT sharing. Determines whether one or two
>>> CS35L32
>>> +  devices are on board sharing SDOUT.
>>> +  0 = (Default) One IC.
>>> +  1 = Two IC's.
>>> +
>>> +  - cirrus,battery-recovery : Low battery nominal recovery threshold,
>>> rising VP.
>>> +  0 = 3.1V
>>> +  1 = 3.2V
>>> +  2 = 3.3V (Default)
>>> +  3 = 3.4V
>>> +
>>> +  - cirrus,battery-threshold : Low battery nominal threshold, falling VP.
>>> +  0 = 3.1V
>>> +  1 = 3.2V
>>> +  2 = 3.3V
>>> +  3 = 3.4V (Default)
>>> +  4 = 3.5V
>>> +  5 = 3.6V
>>> +
>> Proper indentation for all the properties... These are not readable like
>> this...
>>
>> Required properties:
>>   - compatible:		"cirrus,cs35l32"
>>   - reg:			the I2C address of the device for I2C. Address is
>> determined by the level
>> 			of the AD0 pin. Level 0 is 0x40 while Level 1 is 0x41.
>>   - VA-supply,VP-supply:	power supplies for the device,
>> 			as covered in
>> Documentation/devicetree/bindings/regulator/regulator.txt.
>>
>> Optional properties:
>>   - reset-gpios:		a GPIO spec for the reset pin. If specified, it will
>> be
>> 			deasserted before communication to the codec starts.
>>   - cirrus,boost-manager:Boost voltage control.
>> 			0 = Automatically managed.
>> 				Boost-converter output voltage is the higher
>> 				of the two: Class G or adaptive LED voltage.
>> 			1 = Automatically managed irrespective of audio,
>> adapting for low-power
>>
>> -- 
>> Regards,
>> Varka Bhadram.
>>
>>
> Well when I look at your example that makes it more difficult for me to
> read ;)

sorry... this the problem due to my email client...

> I think if there is a mandatory style we are looking for I would expect it
> to be documented. Maybe I have missed that? I take my bindings file from
> examples already in the mainline and find this to be acceptable and
> readable for me.
>
see this ex:http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/sound/adi,adau1701.txt
Austin, Brian Aug. 5, 2014, 2:45 p.m. UTC | #4
On Tue, 5 Aug 2014, Varka Bhadram wrote:

> 
> On Tuesday 05 August 2014 07:58 PM, Brian Austin wrote:
> > On Mon, 4 Aug 2014, Varka Bhadram wrote:
> > > > +  0 = Left/right channels VMON[11:0], IMON[11:0], VPMON[7:0].
> > > > +  1 = Left/right channels VMON[11:0], IMON[11:0], STATUS.
> > > > +  2 = (Default) left/right channels VMON[15:0], IMON [15:0].
> > > > +  3 = Left/right channels VPMON[7:0], STATUS.
> > > > +
> > > > +  - cirrus,sdout-share : SDOUT sharing. Determines whether one or two
> > > > CS35L32
> > > > +  devices are on board sharing SDOUT.
> > > > +  0 = (Default) One IC.
> > > > +  1 = Two IC's.
> > > > +
> > > > +  - cirrus,battery-recovery : Low battery nominal recovery threshold,
> > > > rising VP.
> > > > +  0 = 3.1V
> > > > +  1 = 3.2V
> > > > +  2 = 3.3V (Default)
> > > > +  3 = 3.4V
> > > > +
> > > > +  - cirrus,battery-threshold : Low battery nominal threshold, falling
> > > > VP.
> > > > +  0 = 3.1V
> > > > +  1 = 3.2V
> > > > +  2 = 3.3V
> > > > +  3 = 3.4V (Default)
> > > > +  4 = 3.5V
> > > > +  5 = 3.6V
> > > > +
> > > Proper indentation for all the properties... These are not readable like
> > > this...
> > > 
> > > Required properties:
> > >   - compatible:		"cirrus,cs35l32"
> > >   - reg:			the I2C address of the device for I2C. Address
> > > is
> > > determined by the level
> > > 			of the AD0 pin. Level 0 is 0x40 while Level 1 is 0x41.
> > >   - VA-supply,VP-supply:	power supplies for the device,
> > > 			as covered in
> > > Documentation/devicetree/bindings/regulator/regulator.txt.
> > > 
> > > Optional properties:
> > >   - reset-gpios:		a GPIO spec for the reset pin. If specified,
> > > it will
> > > be
> > > 			deasserted before communication to the codec starts.
> > >   - cirrus,boost-manager:Boost voltage control.
> > > 			0 = Automatically managed.
> > > 				Boost-converter output voltage is the higher
> > > 				of the two: Class G or adaptive LED voltage.
> > > 			1 = Automatically managed irrespective of audio,
> > > adapting for low-power
> > > 
> > > -- 
> > > Regards,
> > > Varka Bhadram.
> > > 
> > > 
> > Well when I look at your example that makes it more difficult for me to
> > read ;)
> 
> sorry... this the problem due to my email client...
> 
> > I think if there is a mandatory style we are looking for I would expect it
> > to be documented. Maybe I have missed that? I take my bindings file from
> > examples already in the mainline and find this to be acceptable and
> > readable for me.
> > 
> see this
> ex:http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/sound/adi,adau1701.txt
> 
It looks nice of course, but IMO doesn't really make it any more readable 
for me. Again, if there is a certain style required I would expect it to 
be documented or caught by checkpatch. And most of the bindings files in 
the tree look similar to my format.

Thanks,
Brian
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/sound/cs35l32.txt b/Documentation/devicetree/bindings/sound/cs35l32.txt
new file mode 100644
index 0000000..1417d3f
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/cs35l32.txt
@@ -0,0 +1,62 @@ 
+CS35L32 audio CODEC
+
+Required properties:
+
+  - compatible : "cirrus,cs35l32"
+
+  - reg : the I2C address of the device for I2C. Address is determined by the level
+  of the AD0 pin. Level 0 is 0x40 while Level 1 is 0x41.
+
+  - VA-supply, VP-supply : power supplies for the device,
+  as covered in Documentation/devicetree/bindings/regulator/regulator.txt.
+
+Optional properties:
+
+  - reset-gpios : a GPIO spec for the reset pin. If specified, it will be
+  deasserted before communication to the codec starts.
+
+  - cirrus,boost-manager : Boost voltage control.
+  0 = Automatically managed.  Boost-converter output voltage is the higher
+  of the two: Class G or adaptive LED voltage.
+  1 = Automatically managed irrespective of audio, adapting for low-power
+  dissipation when LEDs are ON, and operating in Fixed-Boost Bypass Mode
+  if LEDs are OFF (VBST = VP).
+  2 = (Default) Boost voltage fixed in Bypass Mode (VBST = VP).
+  3 = Boost voltage fixed at 5 V.
+
+  - cirrus,sdout-datacfg : Data configuration for dual CS35L32 applications only.
+  Determines the data packed in a two-CS35L32 configuration.
+  0 = Left/right channels VMON[11:0], IMON[11:0], VPMON[7:0].
+  1 = Left/right channels VMON[11:0], IMON[11:0], STATUS.
+  2 = (Default) left/right channels VMON[15:0], IMON [15:0].
+  3 = Left/right channels VPMON[7:0], STATUS.
+
+  - cirrus,sdout-share : SDOUT sharing. Determines whether one or two CS35L32
+  devices are on board sharing SDOUT.
+  0 = (Default) One IC.
+  1 = Two IC's.
+
+  - cirrus,battery-recovery : Low battery nominal recovery threshold, rising VP.
+  0 = 3.1V
+  1 = 3.2V
+  2 = 3.3V (Default)
+  3 = 3.4V
+
+  - cirrus,battery-threshold : Low battery nominal threshold, falling VP.
+  0 = 3.1V
+  1 = 3.2V
+  2 = 3.3V
+  3 = 3.4V (Default)
+  4 = 3.5V
+  5 = 3.6V
+
+Example:
+
+codec: codec@40 {
+	compatible = "cirrus,cs35l32";
+	reg = <0x40>;
+	reset-gpios = <&gpio 10 0>;
+	cirrus,boost-manager = <0x03>;
+	cirrus,sdout-datacfg = <0x02>;
+	VA-supply = <&reg_audio>;
+};