diff mbox series

dt-bindings: Nokia N9 audio support

Message ID 20180110085315.GA17841@amd
State Changes Requested, archived
Headers show
Series dt-bindings: Nokia N9 audio support | expand

Commit Message

Pavel Machek Jan. 10, 2018, 8:53 a.m. UTC
From: Filip Matijević <filip.matijevic.pz@gmail.com>

Add bindings for Nokia N9 audio components.

Signed-off-by: Filip Matijević <filip.matijevic.pz@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>

Comments

Sakari Ailus Jan. 10, 2018, 9:39 a.m. UTC | #1
Hi Pavel,

On Wed, Jan 10, 2018 at 09:53:15AM +0100, Pavel Machek wrote:
> From: Filip Matijević <filip.matijevic.pz@gmail.com>
> 
> Add bindings for Nokia N9 audio components.
> 
> Signed-off-by: Filip Matijević <filip.matijevic.pz@gmail.com>
> Signed-off-by: Pavel Machek <pavel@ucw.cz>
> 
> diff --git a/Documentation/devicetree/bindings/media/ti-wl1273.txt b/Documentation/devicetree/bindings/media/ti-wl1273.txt
> new file mode 100644
> index 0000000..21db389
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/ti-wl1273.txt
> @@ -0,0 +1,36 @@
> +Texas Instruments - wl1273 radio/bluetooth module
> +
> +Required properties:
> +
> +- compatible - "ti,wl1273-core"
> +- reg - I2C slave address
> +- interrupts       - The interrupt output from the device.
> +- interrupt-parent - The parent interrupt controller.
> +- power-gpio       - gpio pin to power the device.
> +
> +- wl1273radio child - compatible = "ti,wl1273-fm-radio";

I'd document this under a separate section, as the compatible property for
the other child node.

You use "property - description" here but "property: description" in the
file below. It'd be nice to be consistent, albeit it's separate files.

> +
> +Optional properties:
> +
> +- wl1273codec child - compatible = "ti,wl1273codec";

"ti,wl1273-codec"

> +
> +Example:
> +
> +wl1273core: wl1273core@22 {
> +		compatible = "ti,wl1273-core";
> +		reg = <0x22>;
> +
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&wl1273_gpio>;
> +
> +		interrupt-parent = <&gpio2>;
> +		interrupts = <11 2>; /* gpio_43, IRQF_TRIGGER_FALLING */
> +
> +		wl1273radio: wl1273radio {
> +			compatible = "ti,wl1273-fm-radio";
> +		};
> +
> +		wl1273codec: wl1273codec {
> +			compatible = "ti,wl1273-codec";
> +		};
> +	};
> diff --git a/Documentation/devicetree/bindings/sound/nokia,n9.txt b/Documentation/devicetree/bindings/sound/nokia,n9.txt
> new file mode 100644
> index 0000000..230b1eb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/nokia,n9.txt
> @@ -0,0 +1,32 @@
> +* Nokia N9/N950 audio setup
> +

A small description saying what this really is would be nice.

> +Required properties:
> +- compatible: "nokia,n9-audio"
> +
> +- nokia,twl4030-cpu-dai: phandle for the McBSP node connected to TWL4030
> +- nokia,tlv320dac33-cpu-dai: phandle for the McBSP node connected to TLV320DAC33
> +- nokia,wl1273-cpu-dai: phandle for the McBSP node connected to WL1273
> +
> +- nokia,twl4030-codec: phandle for the TWL4030 codec
> +- nokia,tlv320dac33-codec: phandle for the TLV320DAC33 codec
> +- nokia,wl1273-codec: phandle for the WL1273 codec
> +- nokia,headphone-amplifier: phandle for the TPA6130A2 node
> +
> +- nokia,speaker-amplifier-gpios: GPIO for speaker amplifier
> +
> +Example:
> +
> +sound: n9-audio {
> +	compatible = "nokia,n9-audio";
> +
> +	nokia,twl4030-cpu-dai = <&mcbsp3>;
> +	nokia,tlv320dac33-cpu-dai = <&mcbsp2>;
> +	nokia,wl1273-cpu-dai = <&mcbsp4>;
> +
> +	nokia,twl4030-codec = <&twl4030_audio>;
> +	nokia,tlv320dac33-codec = <&tlv320dac33>;
> +	nokia,wl1273-codec = <&wl1273codec>;
> +	nokia,headphone-amplifier = <&tpa6140a2>;
> +
> +	nokia,speaker-amplifier-gpios = <&twl_gpio 7 GPIO_ACTIVE_HIGH>;
> +};
> diff --git a/Documentation/devicetree/bindings/sound/tlv320dac33.txt b/Documentation/devicetree/bindings/sound/tlv320dac33.txt
> new file mode 100644
> index 0000000..8e981f7
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/tlv320dac33.txt
> @@ -0,0 +1,39 @@
> +Texas Instruments - tlv320dac33 Codec module
> +
> +The tlv320dac33 serial control bus communicates through I2C protocols.
> +
> +Required properties:
> +
> +- compatible - "ti,tlv320dac33"
> +- reg - I2C slave address
> +
> +Optional properties:
> +
> +- power-gpio - gpio pin to power the device
> +
> +- avdd-supply, dvdd-supply, iovdd-supply: power supplies for the device as covered
> +  in Documentation/devicetree/bindings/regulator/regulator.txt
> +
> +- interrupts       - The interrupt output from the device.
> +- interrupt-parent - The parent interrupt controller.
> +
> +- ti,keep-bclk 	- Keep the BCLK running in FIFO modes
> +- ti,burst-bclkdiv - BCLK divider value in burst mode
> +
> +Example:
> +
> +tlv320dac33: tlv320dac33@19 {
> +	compatible = "ti,tlv320dac33";
> +	reg = <0x19>;
> +
> +	avdd-supply = <&vaux4>;
> +	dvdd-supply = <&vio>;
> +	iovdd-supply = <&vio>;
> +
> +	interrupt-parent = <&gpio2>;
> +	interrupts = <21 1>; /* gpio_53, IRQF_TRIGGER_RISING */
> +	power-gpio = <&gpio2 28 0>; /* gpio_60 */
> +
> +	ti,keep-bclk;
> +	ti,burst-bclkdiv = /bits/ 8 <3>;
> +};
>
Pavel Machek Jan. 10, 2018, 11:31 a.m. UTC | #2
Hi!

> On Wed, Jan 10, 2018 at 09:53:15AM +0100, Pavel Machek wrote:
> > From: Filip Matijević <filip.matijevic.pz@gmail.com>
> > 
> > Add bindings for Nokia N9 audio components.
> > 
> > Signed-off-by: Filip Matijević <filip.matijevic.pz@gmail.com>
> > Signed-off-by: Pavel Machek <pavel@ucw.cz>
> > 
> > diff --git a/Documentation/devicetree/bindings/media/ti-wl1273.txt b/Documentation/devicetree/bindings/media/ti-wl1273.txt
> > new file mode 100644
> > index 0000000..21db389
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/ti-wl1273.txt
> > @@ -0,0 +1,36 @@
> > +Texas Instruments - wl1273 radio/bluetooth module
> > +
> > +Required properties:
> > +
> > +- compatible - "ti,wl1273-core"
> > +- reg - I2C slave address
> > +- interrupts       - The interrupt output from the device.
> > +- interrupt-parent - The parent interrupt controller.
> > +- power-gpio       - gpio pin to power the device.
> > +
> > +- wl1273radio child - compatible = "ti,wl1273-fm-radio";
> 
> I'd document this under a separate section, as the compatible property for
> the other child node.
> 
> You use "property - description" here but "property: description" in the
> file below. It'd be nice to be consistent, albeit it's separate
> files.

Heh. If we want to do consistency, it should be consistent in whole
documentation. I looked at cec-gpio.txt and it uses both
styles. Sampled few more files, and seems ":" is more common here.

> > +
> > +Optional properties:
> > +
> > +- wl1273codec child - compatible = "ti,wl1273codec";
> 
> "ti,wl1273-codec"

Ok.

> > diff --git a/Documentation/devicetree/bindings/sound/nokia,n9.txt b/Documentation/devicetree/bindings/sound/nokia,n9.txt
> > new file mode 100644
> > index 0000000..230b1eb
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/sound/nokia,n9.txt
> > @@ -0,0 +1,32 @@
> > +* Nokia N9/N950 audio setup
> > +
> 
> A small description saying what this really is would be nice.

I'm actually not sure what to say here. Suggestions?

Thanks,
									Pavel
Rob Herring Jan. 19, 2018, 8:15 p.m. UTC | #3
On Wed, Jan 10, 2018 at 09:53:15AM +0100, Pavel Machek wrote:
> From: Filip Matijević <filip.matijevic.pz@gmail.com>
> 
> Add bindings for Nokia N9 audio components.
> 
> Signed-off-by: Filip Matijević <filip.matijevic.pz@gmail.com>
> Signed-off-by: Pavel Machek <pavel@ucw.cz>
> 
> diff --git a/Documentation/devicetree/bindings/media/ti-wl1273.txt b/Documentation/devicetree/bindings/media/ti-wl1273.txt
> new file mode 100644
> index 0000000..21db389
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/ti-wl1273.txt
> @@ -0,0 +1,36 @@
> +Texas Instruments - wl1273 radio/bluetooth module

bluetooth chips have a binding location: bindings/net/bluetooth.

And we already have a WL1273 binding. Plus there's the one for the Nokia 
BT which I think can be TI chips with a different firmware and protocol. 
Is this related?

> +
> +Required properties:
> +
> +- compatible - "ti,wl1273-core"
> +- reg - I2C slave address
> +- interrupts       - The interrupt output from the device.
> +- interrupt-parent - The parent interrupt controller.
> +- power-gpio       - gpio pin to power the device.
> +
> +- wl1273radio child - compatible = "ti,wl1273-fm-radio";

AIUI, the FM radio is accessed thru the HCI interface aka shared 
transport via the UART. So it is already covered by the serial device 
binding for TI chips.

> +
> +Optional properties:
> +
> +- wl1273codec child - compatible = "ti,wl1273codec";

This is a codec or just BT audio I2S/PCM interface?

> +
> +Example:
> +
> +wl1273core: wl1273core@22 {
> +		compatible = "ti,wl1273-core";
> +		reg = <0x22>;
> +
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&wl1273_gpio>;
> +
> +		interrupt-parent = <&gpio2>;
> +		interrupts = <11 2>; /* gpio_43, IRQF_TRIGGER_FALLING */
> +
> +		wl1273radio: wl1273radio {
> +			compatible = "ti,wl1273-fm-radio";
> +		};
> +
> +		wl1273codec: wl1273codec {
> +			compatible = "ti,wl1273-codec";
> +		};
> +	};
> diff --git a/Documentation/devicetree/bindings/sound/nokia,n9.txt b/Documentation/devicetree/bindings/sound/nokia,n9.txt
> new file mode 100644
> index 0000000..230b1eb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/nokia,n9.txt
> @@ -0,0 +1,32 @@
> +* Nokia N9/N950 audio setup
> +
> +Required properties:
> +- compatible: "nokia,n9-audio"
> +
> +- nokia,twl4030-cpu-dai: phandle for the McBSP node connected to TWL4030
> +- nokia,tlv320dac33-cpu-dai: phandle for the McBSP node connected to TLV320DAC33
> +- nokia,wl1273-cpu-dai: phandle for the McBSP node connected to WL1273
> +
> +- nokia,twl4030-codec: phandle for the TWL4030 codec
> +- nokia,tlv320dac33-codec: phandle for the TLV320DAC33 codec
> +- nokia,wl1273-codec: phandle for the WL1273 codec

Both dais and codecs should just be lists with a defined order.

> +- nokia,headphone-amplifier: phandle for the TPA6130A2 node

The simple card or graph card binding don't work? At least follow them 
to the extent that they do work. 
> +
> +- nokia,speaker-amplifier-gpios: GPIO for speaker amplifier
> +
> +Example:
> +
> +sound: n9-audio {
> +	compatible = "nokia,n9-audio";
> +
> +	nokia,twl4030-cpu-dai = <&mcbsp3>;
> +	nokia,tlv320dac33-cpu-dai = <&mcbsp2>;
> +	nokia,wl1273-cpu-dai = <&mcbsp4>;
> +
> +	nokia,twl4030-codec = <&twl4030_audio>;
> +	nokia,tlv320dac33-codec = <&tlv320dac33>;
> +	nokia,wl1273-codec = <&wl1273codec>;
> +	nokia,headphone-amplifier = <&tpa6140a2>;
> +
> +	nokia,speaker-amplifier-gpios = <&twl_gpio 7 GPIO_ACTIVE_HIGH>;
> +};
> diff --git a/Documentation/devicetree/bindings/sound/tlv320dac33.txt b/Documentation/devicetree/bindings/sound/tlv320dac33.txt
> new file mode 100644
> index 0000000..8e981f7
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/tlv320dac33.txt
> @@ -0,0 +1,39 @@
> +Texas Instruments - tlv320dac33 Codec module
> +
> +The tlv320dac33 serial control bus communicates through I2C protocols.
> +
> +Required properties:
> +
> +- compatible - "ti,tlv320dac33"
> +- reg - I2C slave address
> +
> +Optional properties:
> +
> +- power-gpio - gpio pin to power the device

power-gpios.

Active high or low?

> +
> +- avdd-supply, dvdd-supply, iovdd-supply: power supplies for the device as covered
> +  in Documentation/devicetree/bindings/regulator/regulator.txt
> +
> +- interrupts       - The interrupt output from the device.
> +- interrupt-parent - The parent interrupt controller.
> +
> +- ti,keep-bclk 	- Keep the BCLK running in FIFO modes
> +- ti,burst-bclkdiv - BCLK divider value in burst mode
> +
> +Example:
> +
> +tlv320dac33: tlv320dac33@19 {

audio-codec@19

> +	compatible = "ti,tlv320dac33";
> +	reg = <0x19>;
> +
> +	avdd-supply = <&vaux4>;
> +	dvdd-supply = <&vio>;
> +	iovdd-supply = <&vio>;
> +
> +	interrupt-parent = <&gpio2>;
> +	interrupts = <21 1>; /* gpio_53, IRQF_TRIGGER_RISING */
> +	power-gpio = <&gpio2 28 0>; /* gpio_60 */
> +
> +	ti,keep-bclk;
> +	ti,burst-bclkdiv = /bits/ 8 <3>;
> +};
> 
> 
> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pavel Machek Jan. 29, 2018, 9:19 p.m. UTC | #4
Hi!

> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/ti-wl1273.txt
> > @@ -0,0 +1,36 @@
> > +Texas Instruments - wl1273 radio/bluetooth module
> 
> bluetooth chips have a binding location: bindings/net/bluetooth.
> 
> And we already have a WL1273 binding. Plus there's the one for the Nokia 
> BT which I think can be TI chips with a different firmware and protocol. 
> Is this related?

Ok, let me investigate wl1273 (and postpone it, audio is critical, FM
radio -- not so much).

> > index 0000000..230b1eb
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/sound/nokia,n9.txt
> > @@ -0,0 +1,32 @@
> > +* Nokia N9/N950 audio setup
> > +
> > +Required properties:
> > +- compatible: "nokia,n9-audio"
> > +
> > +- nokia,twl4030-cpu-dai: phandle for the McBSP node connected to TWL4030
> > +- nokia,tlv320dac33-cpu-dai: phandle for the McBSP node connected to TLV320DAC33
> > +- nokia,wl1273-cpu-dai: phandle for the McBSP node connected to WL1273
> > +
> > +- nokia,twl4030-codec: phandle for the TWL4030 codec
> > +- nokia,tlv320dac33-codec: phandle for the TLV320DAC33 codec
> > +- nokia,wl1273-codec: phandle for the WL1273 codec
> 
> Both dais and codecs should just be lists with a defined order.
> 
> > +- nokia,headphone-amplifier: phandle for the TPA6130A2 node
> 
> The simple card or graph card binding don't work? At least follow them 
> to the extent that they do work. 

Yep, that quite big changes for the driver... Thanks for pointers. I'm
not sure what features simple card / graph card miss. 

> > +Texas Instruments - tlv320dac33 Codec module
> > +
> > +The tlv320dac33 serial control bus communicates through I2C protocols.
> > +
> > +Required properties:
> > +
> > +- compatible - "ti,tlv320dac33"
> > +- reg - I2C slave address
> > +
> > +Optional properties:
> > +
> > +- power-gpio - gpio pin to power the device
> 
> power-gpios.
> 
> Active high or low?

Ok, this one can be fixed easily, and I guess tlv320dac33 driver might
be useful for someone else, so I'll try to merge it first.

Thanks for review,

> > +	ti,burst-bclkdiv = /bits/ 8 <3>;

Oh and I'll make this plain int. No need to play with bits.

Best regards
								Pavel
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/media/ti-wl1273.txt b/Documentation/devicetree/bindings/media/ti-wl1273.txt
new file mode 100644
index 0000000..21db389
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/ti-wl1273.txt
@@ -0,0 +1,36 @@ 
+Texas Instruments - wl1273 radio/bluetooth module
+
+Required properties:
+
+- compatible - "ti,wl1273-core"
+- reg - I2C slave address
+- interrupts       - The interrupt output from the device.
+- interrupt-parent - The parent interrupt controller.
+- power-gpio       - gpio pin to power the device.
+
+- wl1273radio child - compatible = "ti,wl1273-fm-radio";
+
+Optional properties:
+
+- wl1273codec child - compatible = "ti,wl1273codec";
+
+Example:
+
+wl1273core: wl1273core@22 {
+		compatible = "ti,wl1273-core";
+		reg = <0x22>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&wl1273_gpio>;
+
+		interrupt-parent = <&gpio2>;
+		interrupts = <11 2>; /* gpio_43, IRQF_TRIGGER_FALLING */
+
+		wl1273radio: wl1273radio {
+			compatible = "ti,wl1273-fm-radio";
+		};
+
+		wl1273codec: wl1273codec {
+			compatible = "ti,wl1273-codec";
+		};
+	};
diff --git a/Documentation/devicetree/bindings/sound/nokia,n9.txt b/Documentation/devicetree/bindings/sound/nokia,n9.txt
new file mode 100644
index 0000000..230b1eb
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/nokia,n9.txt
@@ -0,0 +1,32 @@ 
+* Nokia N9/N950 audio setup
+
+Required properties:
+- compatible: "nokia,n9-audio"
+
+- nokia,twl4030-cpu-dai: phandle for the McBSP node connected to TWL4030
+- nokia,tlv320dac33-cpu-dai: phandle for the McBSP node connected to TLV320DAC33
+- nokia,wl1273-cpu-dai: phandle for the McBSP node connected to WL1273
+
+- nokia,twl4030-codec: phandle for the TWL4030 codec
+- nokia,tlv320dac33-codec: phandle for the TLV320DAC33 codec
+- nokia,wl1273-codec: phandle for the WL1273 codec
+- nokia,headphone-amplifier: phandle for the TPA6130A2 node
+
+- nokia,speaker-amplifier-gpios: GPIO for speaker amplifier
+
+Example:
+
+sound: n9-audio {
+	compatible = "nokia,n9-audio";
+
+	nokia,twl4030-cpu-dai = <&mcbsp3>;
+	nokia,tlv320dac33-cpu-dai = <&mcbsp2>;
+	nokia,wl1273-cpu-dai = <&mcbsp4>;
+
+	nokia,twl4030-codec = <&twl4030_audio>;
+	nokia,tlv320dac33-codec = <&tlv320dac33>;
+	nokia,wl1273-codec = <&wl1273codec>;
+	nokia,headphone-amplifier = <&tpa6140a2>;
+
+	nokia,speaker-amplifier-gpios = <&twl_gpio 7 GPIO_ACTIVE_HIGH>;
+};
diff --git a/Documentation/devicetree/bindings/sound/tlv320dac33.txt b/Documentation/devicetree/bindings/sound/tlv320dac33.txt
new file mode 100644
index 0000000..8e981f7
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/tlv320dac33.txt
@@ -0,0 +1,39 @@ 
+Texas Instruments - tlv320dac33 Codec module
+
+The tlv320dac33 serial control bus communicates through I2C protocols.
+
+Required properties:
+
+- compatible - "ti,tlv320dac33"
+- reg - I2C slave address
+
+Optional properties:
+
+- power-gpio - gpio pin to power the device
+
+- avdd-supply, dvdd-supply, iovdd-supply: power supplies for the device as covered
+  in Documentation/devicetree/bindings/regulator/regulator.txt
+
+- interrupts       - The interrupt output from the device.
+- interrupt-parent - The parent interrupt controller.
+
+- ti,keep-bclk 	- Keep the BCLK running in FIFO modes
+- ti,burst-bclkdiv - BCLK divider value in burst mode
+
+Example:
+
+tlv320dac33: tlv320dac33@19 {
+	compatible = "ti,tlv320dac33";
+	reg = <0x19>;
+
+	avdd-supply = <&vaux4>;
+	dvdd-supply = <&vio>;
+	iovdd-supply = <&vio>;
+
+	interrupt-parent = <&gpio2>;
+	interrupts = <21 1>; /* gpio_53, IRQF_TRIGGER_RISING */
+	power-gpio = <&gpio2 28 0>; /* gpio_60 */
+
+	ti,keep-bclk;
+	ti,burst-bclkdiv = /bits/ 8 <3>;
+};