diff mbox

[RFC,14/14] ASoC: qcom: document apq8016 machine driver bindings

Message ID 1430414306-11469-1-git-send-email-srinivas.kandagatla@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Srinivas Kandagatla April 30, 2015, 5:18 p.m. UTC
This patch adds bindings for apq8016 machine driver.
On APQ8016 4 MI2S can be configured to different sinks like internal
codec/external codec, this connection is controlled via 2 iomux
registers.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 .../bindings/sound/qcom,apq8016-machine.txt        | 61 ++++++++++++++++++++++
 1 file changed, 61 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/qcom,apq8016-machine.txt

Comments

Kenneth Westfield May 3, 2015, 12:03 a.m. UTC | #1
On Thu, Apr 30, 2015 at 06:18:26PM +0100, Srinivas Kandagatla wrote:
> This patch adds bindings for apq8016 machine driver.
> On APQ8016 4 MI2S can be configured to different sinks like internal
> codec/external codec, this connection is controlled via 2 iomux
> registers.
> 
> +sound: sound {
> +	compatible = "qcom,apq8016-sndcard";
> +	reg = <0x07702000 0x4>, <0x07702004 0x4>;
> +	reg-names = "mic-iomux", "spkr-iomux";
> +	qcom,model = "DB410c";
> +
> +	/* I2S - Internal codec */
> +	internal-dai-link@0 {
> +		cpu { /* PRIMARY */
> +			sound-dai = <&lpass MI2S_PRIMARY>;
> +		};
> +		codec {
> +			sound-dai = <&wcd_codec 0>;
> +		};
> +	};
> +
> +	/* External Primary or External Secondary -ADV7533 HDMI */
> +	external-dai-link@0 {
> +		external;
> +		cpu { /* QUAT */
> +			sound-dai = <&lpass MI2S_QUATERNARY>;
> +		};
> +		codec {
> +			sound-dai = <&adv_bridge 0>;
> +		};
> +	};
> +};

OK, although I will need to double-check this with the spec, it seems
(from the patches) that there are 4 I2S ports, 2 of which are being
used.  Usually, multi-channel audio is sent to the primary dai (which
is MI2S), which then gets sent to the other ports by HW.  If that holds
true for this SOC, then the external cpu dai should be labelled I2S,
not MI2S.  If not, then both should be labelled as I2S (and the DAI
channel constraints should be reduced to 1-2).

Looking at patch 12, the internal DAI is labelled Headset and the
external DAI is labelled HDMI.  I will check the spec to see if the QUAT
I2S port can handle multi-channel.
Kenneth Westfield May 3, 2015, 3:59 a.m. UTC | #2
On Sat, May 02, 2015 at 05:03:07PM -0700, Kenneth Westfield wrote:
> On Thu, Apr 30, 2015 at 06:18:26PM +0100, Srinivas Kandagatla wrote:
> > This patch adds bindings for apq8016 machine driver.
> > On APQ8016 4 MI2S can be configured to different sinks like internal
> > codec/external codec, this connection is controlled via 2 iomux
> > registers.
> > 
> > +sound: sound {
> > +	compatible = "qcom,apq8016-sndcard";
> > +	reg = <0x07702000 0x4>, <0x07702004 0x4>;
> > +	reg-names = "mic-iomux", "spkr-iomux";
> > +	qcom,model = "DB410c";
> > +
> > +	/* I2S - Internal codec */
> > +	internal-dai-link@0 {
> > +		cpu { /* PRIMARY */
> > +			sound-dai = <&lpass MI2S_PRIMARY>;
> > +		};
> > +		codec {
> > +			sound-dai = <&wcd_codec 0>;
> > +		};
> > +	};
> > +
> > +	/* External Primary or External Secondary -ADV7533 HDMI */
> > +	external-dai-link@0 {
> > +		external;
> > +		cpu { /* QUAT */
> > +			sound-dai = <&lpass MI2S_QUATERNARY>;
> > +		};
> > +		codec {
> > +			sound-dai = <&adv_bridge 0>;
> > +		};
> > +	};
> > +};
> 
> OK, although I will need to double-check this with the spec, it seems
> (from the patches) that there are 4 I2S ports, 2 of which are being
> used.  Usually, multi-channel audio is sent to the primary dai (which
> is MI2S), which then gets sent to the other ports by HW.  If that holds
> true for this SOC, then the external cpu dai should be labelled I2S,
> not MI2S.  If not, then both should be labelled as I2S (and the DAI
> channel constraints should be reduced to 1-2).
> 
> Looking at patch 12, the internal DAI is labelled Headset and the
> external DAI is labelled HDMI.  I will check the spec to see if the QUAT
> I2S port can handle multi-channel.

Are you planning on supporting multi-channel audio playback on HDMI, or
just stereo/mono?
Srinivas Kandagatla May 5, 2015, 7:17 a.m. UTC | #3
On 03/05/15 01:03, Kenneth Westfield wrote:
> On Thu, Apr 30, 2015 at 06:18:26PM +0100, Srinivas Kandagatla wrote:
>> This patch adds bindings for apq8016 machine driver.
>> On APQ8016 4 MI2S can be configured to different sinks like internal
>> codec/external codec, this connection is controlled via 2 iomux
>> registers.
>>
>> +sound: sound {
>> +	compatible = "qcom,apq8016-sndcard";
>> +	reg = <0x07702000 0x4>, <0x07702004 0x4>;
>> +	reg-names = "mic-iomux", "spkr-iomux";
>> +	qcom,model = "DB410c";
>> +
>> +	/* I2S - Internal codec */
>> +	internal-dai-link@0 {
>> +		cpu { /* PRIMARY */
>> +			sound-dai = <&lpass MI2S_PRIMARY>;
>> +		};
>> +		codec {
>> +			sound-dai = <&wcd_codec 0>;
>> +		};
>> +	};
>> +
>> +	/* External Primary or External Secondary -ADV7533 HDMI */
>> +	external-dai-link@0 {
>> +		external;
>> +		cpu { /* QUAT */
>> +			sound-dai = <&lpass MI2S_QUATERNARY>;
>> +		};
>> +		codec {
>> +			sound-dai = <&adv_bridge 0>;
>> +		};
>> +	};
>> +};
>
> OK, although I will need to double-check this with the spec, it seems
> (from the patches) that there are 4 I2S ports, 2 of which are being
> used.  Usually, multi-channel audio is sent to the primary dai (which
> is MI2S), which then gets sent to the other ports by HW.  If that holds
> true for this SOC, then the external cpu dai should be labelled I2S,
> not MI2S.  If not, then both should be labelled as I2S (and the DAI
> channel constraints should be reduced to 1-2).
>
I have got very limited access to documentation, which obviously does 
not have any info related to channel capabilities. I was thinking that 
all the playback ports support multi-channel. I might be wrong though.

> Looking at patch 12, the internal DAI is labelled Headset and the
> external DAI is labelled HDMI.
This naming is very specific to the SBC board.

   I will check the spec to see if the QUAT
> I2S port can handle multi-channel.
External HDMI bridge on the other side only supports 2-channels, but if 
you can re-check on the channel capabilities would be good.

--srini

>
Kenneth Westfield May 6, 2015, 5:41 a.m. UTC | #4
On Tue, May 05, 2015 at 12:17:01AM -0700, Srinivas Kandagatla wrote:
> On 03/05/15 01:03, Kenneth Westfield wrote:
> >On Thu, Apr 30, 2015 at 06:18:26PM +0100, Srinivas Kandagatla wrote:
> >>This patch adds bindings for apq8016 machine driver.
> >>On APQ8016 4 MI2S can be configured to different sinks like internal
> >>codec/external codec, this connection is controlled via 2 iomux
> >>registers.
> >>
> >>+sound: sound {
> >>+	compatible = "qcom,apq8016-sndcard";
> >>+	reg = <0x07702000 0x4>, <0x07702004 0x4>;
> >>+	reg-names = "mic-iomux", "spkr-iomux";
> >>+	qcom,model = "DB410c";
> >>+
> >>+	/* I2S - Internal codec */
> >>+	internal-dai-link@0 {
> >>+		cpu { /* PRIMARY */
> >>+			sound-dai = <&lpass MI2S_PRIMARY>;
> >>+		};
> >>+		codec {
> >>+			sound-dai = <&wcd_codec 0>;
> >>+		};
> >>+	};
> >>+
> >>+	/* External Primary or External Secondary -ADV7533 HDMI */
> >>+	external-dai-link@0 {
> >>+		external;
> >>+		cpu { /* QUAT */
> >>+			sound-dai = <&lpass MI2S_QUATERNARY>;
> >>+		};
> >>+		codec {
> >>+			sound-dai = <&adv_bridge 0>;
> >>+		};
> >>+	};
> >>+};
> >
> >OK, although I will need to double-check this with the spec, it seems
> >(from the patches) that there are 4 I2S ports, 2 of which are being
> >used.  Usually, multi-channel audio is sent to the primary dai (which
> >is MI2S), which then gets sent to the other ports by HW.  If that holds
> >true for this SOC, then the external cpu dai should be labelled I2S,
> >not MI2S.  If not, then both should be labelled as I2S (and the DAI
> >channel constraints should be reduced to 1-2).
> >
> I have got very limited access to documentation, which obviously
> does not have any info related to channel capabilities. I was
> thinking that all the playback ports support multi-channel. I might
> be wrong though.

After checking the specs, the four playback DAIs are, in fact,
multi-channel.  Therefore, MI2S_ is the correct prefix for them.

> 
> >Looking at patch 12, the internal DAI is labelled Headset and the
> >external DAI is labelled HDMI.
> This naming is very specific to the SBC board.
> 
>   I will check the spec to see if the QUAT
> >I2S port can handle multi-channel.
> External HDMI bridge on the other side only supports 2-channels, but
> if you can re-check on the channel capabilities would be good.

Ah, ok.  Then no need to worry about multi-channel playback.  Just need
to ensure the codec drivers constrain the channels to mono/stereo.
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/sound/qcom,apq8016-machine.txt b/Documentation/devicetree/bindings/sound/qcom,apq8016-machine.txt
new file mode 100644
index 0000000..de697b8
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/qcom,apq8016-machine.txt
@@ -0,0 +1,61 @@ 
+* Qualcomm Technologies APQ8016 ASoC machine driver
+
+This node models the Qualcomm Technologies APQ8016 ASoC machine driver
+
+Required properties:
+
+- compatible		: "qcom,apq8016-sndcard"
+
+- pinctrl-N		: One property must exist for each entry in
+			  pinctrl-names.  See ../pinctrl/pinctrl-bindings.txt
+			  for details of the property values.
+- pinctrl-names		: Must contain a "default" entry.
+- reg			: Must contain an address for each entry in reg-names.
+- reg-names		: A list which must include the following entries:
+				* "mic-iomux"
+				* "spkr-iomux"
+- qcom,model		: Name of the sound card.
+
+Dai-link subnode properties and subnodes:
+
+Required dai-link subnodes:
+
+- cpu					: CPU   sub-node
+- codec					: CODEC sub-node
+
+Required CPU/CODEC subnodes properties:
+
+-sound-dai		: phandle and port of CPU/CODEC
+-capture-dai		: phandle and port of CPU/CODEC
+
+Optional CPU/CODEC subnodes properties:
+- external	: flag to indicate if the I2S is connected to external codec
+Example:
+
+sound: sound {
+	compatible = "qcom,apq8016-sndcard";
+	reg = <0x07702000 0x4>, <0x07702004 0x4>;
+	reg-names = "mic-iomux", "spkr-iomux";
+	qcom,model = "DB410c";
+
+	/* I2S - Internal codec */
+	internal-dai-link@0 {
+		cpu { /* PRIMARY */
+			sound-dai = <&lpass MI2S_PRIMARY>;
+		};
+		codec {
+			sound-dai = <&wcd_codec 0>;
+		};
+	};
+
+	/* External Primary or External Secondary -ADV7533 HDMI */
+	external-dai-link@0 {
+		external;
+		cpu { /* QUAT */
+			sound-dai = <&lpass MI2S_QUATERNARY>;
+		};
+		codec {
+			sound-dai = <&adv_bridge 0>;
+		};
+	};
+};