All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: fsl-asoc-card: add cs4271 and cs4272 support
@ 2016-01-28 10:52 ` Felipe F. Tonello
  0 siblings, 0 replies; 6+ messages in thread
From: Felipe F. Tonello @ 2016-01-28 10:52 UTC (permalink / raw)
  To: alsa-devel
  Cc: linux-kernel, devicetree, Mark Brown, Takashi Iwai, Nicolin Chen,
	Rob Herring

add cs4271 and cs42727 support for fsl-asoc-card

Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
---
 .../devicetree/bindings/sound/imx-audio-cs427x.txt | 47 ++++++++++++++++++++++
 sound/soc/fsl/Kconfig                              |  4 +-
 sound/soc/fsl/fsl-asoc-card.c                      |  7 ++++
 3 files changed, 56 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt

diff --git a/Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt b/Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt
new file mode 100644
index 000000000000..295f60b19418
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt
@@ -0,0 +1,47 @@
+Freescale i.MX audio complex with CS4271 or CS4272 codec
+
+Required properties:
+
+  - compatible		: "fsl,imx-audio-cs427x"
+
+  - model		: The user-visible name of this sound complex
+
+  - ssi-controller	: The phandle of the i.MX SSI controller
+
+  - audio-codec	: The phandle of the CS4271 audio codec
+
+  - audio-routing	: A list of the connections between audio components.
+			  Each entry is a pair of strings, the first being the
+			  connection's sink, the second being the connection's
+			  source. Valid names could be power supplies, CS427x
+			  pins, and the jacks on the board:
+
+			  Board connectors:
+			   * Mic Jack
+			   * Headphone Jack
+
+  - mux-int-port	: The internal port of the i.MX audio muxer (AUDMUX)
+
+  - mux-ext-port	: The external port of the i.MX audio muxer
+
+Note: The AUDMUX port numbering should start at 1, which is consistent with
+hardware manual.
+
+Example:
+
+sound {
+	compatible = "fsl,imx6-rex-cs427x",
+		"fsl,imx-audio-cs427x";
+	model = "audio-cs427x";
+	ssi-controller = <&ssi1>;
+	audio-codec = <&cs4271>;
+	audio-routing =
+		"Mic Jack", "AINA",
+		"Mic Jack", "AINB",
+		"Headphone Jack", "AOUTA+",
+		"Headphone Jack", "AOUTA-",
+		"Headphone Jack", "AOUTB+",
+		"Headphone Jack", "AOUTB-";
+	mux-int-port = <1>;
+	mux-ext-port = <3>;
+};
diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig
index 14dfdee05fd5..35aabf9dc503 100644
--- a/sound/soc/fsl/Kconfig
+++ b/sound/soc/fsl/Kconfig
@@ -292,8 +292,8 @@ config SND_SOC_FSL_ASOC_CARD
 	select SND_SOC_FSL_SSI
 	help
 	 ALSA SoC Audio support with ASRC feature for Freescale SoCs that have
-	 ESAI/SAI/SSI and connect with external CODECs such as WM8962, CS42888
-	 and SGTL5000.
+	 ESAI/SAI/SSI and connect with external CODECs such as WM8962, CS42888,
+	 CS4271, CS4272 and SGTL5000.
 	 Say Y if you want to add support for Freescale Generic ASoC Sound Card.
 
 endif # SND_IMX_SOC
diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 562b3bd22d9a..56b6b07d1922 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -28,6 +28,8 @@
 #include "../codecs/wm8962.h"
 #include "../codecs/wm8960.h"
 
+#define CS427x_SYSCLK_MCLK 0
+
 #define RX 0
 #define TX 1
 
@@ -528,6 +530,10 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
 		priv->cpu_priv.sysclk_dir[RX] = SND_SOC_CLOCK_OUT;
 		priv->cpu_priv.slot_width = 32;
 		priv->dai_fmt |= SND_SOC_DAIFMT_CBS_CFS;
+	} else if (of_device_is_compatible(np, "fsl,imx-audio-cs427x")) {
+		codec_dai_name = "cs4271-hifi";
+		priv->codec_priv.mclk_id = CS427x_SYSCLK_MCLK;
+		priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM;
 	} else if (of_device_is_compatible(np, "fsl,imx-audio-sgtl5000")) {
 		codec_dai_name = "sgtl5000";
 		priv->codec_priv.mclk_id = SGTL5000_SYSCLK;
@@ -681,6 +687,7 @@ fail:
 static const struct of_device_id fsl_asoc_card_dt_ids[] = {
 	{ .compatible = "fsl,imx-audio-ac97", },
 	{ .compatible = "fsl,imx-audio-cs42888", },
+	{ .compatible = "fsl,imx-audio-cs427x", },
 	{ .compatible = "fsl,imx-audio-sgtl5000", },
 	{ .compatible = "fsl,imx-audio-wm8962", },
 	{ .compatible = "fsl,imx-audio-wm8960", },
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] ASoC: fsl-asoc-card: add cs4271 and cs4272 support
@ 2016-01-28 10:52 ` Felipe F. Tonello
  0 siblings, 0 replies; 6+ messages in thread
From: Felipe F. Tonello @ 2016-01-28 10:52 UTC (permalink / raw)
  To: alsa-devel
  Cc: devicetree, Rob Herring, linux-kernel, Takashi Iwai,
	Nicolin Chen, Mark Brown

add cs4271 and cs42727 support for fsl-asoc-card

Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
---
 .../devicetree/bindings/sound/imx-audio-cs427x.txt | 47 ++++++++++++++++++++++
 sound/soc/fsl/Kconfig                              |  4 +-
 sound/soc/fsl/fsl-asoc-card.c                      |  7 ++++
 3 files changed, 56 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt

diff --git a/Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt b/Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt
new file mode 100644
index 000000000000..295f60b19418
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt
@@ -0,0 +1,47 @@
+Freescale i.MX audio complex with CS4271 or CS4272 codec
+
+Required properties:
+
+  - compatible		: "fsl,imx-audio-cs427x"
+
+  - model		: The user-visible name of this sound complex
+
+  - ssi-controller	: The phandle of the i.MX SSI controller
+
+  - audio-codec	: The phandle of the CS4271 audio codec
+
+  - audio-routing	: A list of the connections between audio components.
+			  Each entry is a pair of strings, the first being the
+			  connection's sink, the second being the connection's
+			  source. Valid names could be power supplies, CS427x
+			  pins, and the jacks on the board:
+
+			  Board connectors:
+			   * Mic Jack
+			   * Headphone Jack
+
+  - mux-int-port	: The internal port of the i.MX audio muxer (AUDMUX)
+
+  - mux-ext-port	: The external port of the i.MX audio muxer
+
+Note: The AUDMUX port numbering should start at 1, which is consistent with
+hardware manual.
+
+Example:
+
+sound {
+	compatible = "fsl,imx6-rex-cs427x",
+		"fsl,imx-audio-cs427x";
+	model = "audio-cs427x";
+	ssi-controller = <&ssi1>;
+	audio-codec = <&cs4271>;
+	audio-routing =
+		"Mic Jack", "AINA",
+		"Mic Jack", "AINB",
+		"Headphone Jack", "AOUTA+",
+		"Headphone Jack", "AOUTA-",
+		"Headphone Jack", "AOUTB+",
+		"Headphone Jack", "AOUTB-";
+	mux-int-port = <1>;
+	mux-ext-port = <3>;
+};
diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig
index 14dfdee05fd5..35aabf9dc503 100644
--- a/sound/soc/fsl/Kconfig
+++ b/sound/soc/fsl/Kconfig
@@ -292,8 +292,8 @@ config SND_SOC_FSL_ASOC_CARD
 	select SND_SOC_FSL_SSI
 	help
 	 ALSA SoC Audio support with ASRC feature for Freescale SoCs that have
-	 ESAI/SAI/SSI and connect with external CODECs such as WM8962, CS42888
-	 and SGTL5000.
+	 ESAI/SAI/SSI and connect with external CODECs such as WM8962, CS42888,
+	 CS4271, CS4272 and SGTL5000.
 	 Say Y if you want to add support for Freescale Generic ASoC Sound Card.
 
 endif # SND_IMX_SOC
diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 562b3bd22d9a..56b6b07d1922 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -28,6 +28,8 @@
 #include "../codecs/wm8962.h"
 #include "../codecs/wm8960.h"
 
+#define CS427x_SYSCLK_MCLK 0
+
 #define RX 0
 #define TX 1
 
@@ -528,6 +530,10 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
 		priv->cpu_priv.sysclk_dir[RX] = SND_SOC_CLOCK_OUT;
 		priv->cpu_priv.slot_width = 32;
 		priv->dai_fmt |= SND_SOC_DAIFMT_CBS_CFS;
+	} else if (of_device_is_compatible(np, "fsl,imx-audio-cs427x")) {
+		codec_dai_name = "cs4271-hifi";
+		priv->codec_priv.mclk_id = CS427x_SYSCLK_MCLK;
+		priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM;
 	} else if (of_device_is_compatible(np, "fsl,imx-audio-sgtl5000")) {
 		codec_dai_name = "sgtl5000";
 		priv->codec_priv.mclk_id = SGTL5000_SYSCLK;
@@ -681,6 +687,7 @@ fail:
 static const struct of_device_id fsl_asoc_card_dt_ids[] = {
 	{ .compatible = "fsl,imx-audio-ac97", },
 	{ .compatible = "fsl,imx-audio-cs42888", },
+	{ .compatible = "fsl,imx-audio-cs427x", },
 	{ .compatible = "fsl,imx-audio-sgtl5000", },
 	{ .compatible = "fsl,imx-audio-wm8962", },
 	{ .compatible = "fsl,imx-audio-wm8960", },
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ASoC: fsl-asoc-card: add cs4271 and cs4272 support
  2016-01-28 10:52 ` Felipe F. Tonello
  (?)
@ 2016-01-28 18:24 ` Nicolin Chen
  2016-01-29 10:34     ` Felipe Ferreri Tonello
  -1 siblings, 1 reply; 6+ messages in thread
From: Nicolin Chen @ 2016-01-28 18:24 UTC (permalink / raw)
  To: Felipe F. Tonello
  Cc: alsa-devel, linux-kernel, devicetree, Mark Brown, Takashi Iwai,
	Rob Herring

On Thu, Jan 28, 2016 at 10:52:35AM +0000, Felipe F. Tonello wrote:
> add cs4271 and cs42727 support for fsl-asoc-card
> 
> Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
> ---
>  .../devicetree/bindings/sound/imx-audio-cs427x.txt | 47 ++++++++++++++++++++++
>  sound/soc/fsl/Kconfig                              |  4 +-
>  sound/soc/fsl/fsl-asoc-card.c                      |  7 ++++
>  3 files changed, 56 insertions(+), 2 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt
> 
> diff --git a/Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt b/Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt
> new file mode 100644
> index 000000000000..295f60b19418
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt
> @@ -0,0 +1,47 @@
> +Freescale i.MX audio complex with CS4271 or CS4272 codec

I think it could be better to insert these into the fsl-asoc-card.txt
without those redundant property descriptions. At least it should be
added to the compatible list. And you may add a comment in (...) to
describe that it supports both 4271 and 4272.

> +  - mux-int-port	: The internal port of the i.MX audio muxer (AUDMUX)
> +
> +  - mux-ext-port	: The external port of the i.MX audio muxer
> +
> +Note: The AUDMUX port numbering should start at 1, which is consistent with
> +hardware manual.

These two properties are missing in the fsl-asoc-card binding docs.
So it could be nice to have them as well. But they should be optional
unless SSI is selected as a CPU DAI.

Thanks
Nicolin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ASoC: fsl-asoc-card: add cs4271 and cs4272 support
  2016-01-28 18:24 ` Nicolin Chen
@ 2016-01-29 10:34     ` Felipe Ferreri Tonello
  0 siblings, 0 replies; 6+ messages in thread
From: Felipe Ferreri Tonello @ 2016-01-29 10:34 UTC (permalink / raw)
  To: Nicolin Chen
  Cc: alsa-devel, linux-kernel, devicetree, Mark Brown, Takashi Iwai,
	Rob Herring

[-- Attachment #1: Type: text/plain, Size: 1699 bytes --]

Hi Nicolin,

On 28/01/16 18:24, Nicolin Chen wrote:
> On Thu, Jan 28, 2016 at 10:52:35AM +0000, Felipe F. Tonello wrote:
>> add cs4271 and cs42727 support for fsl-asoc-card
>>
>> Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
>> ---
>>  .../devicetree/bindings/sound/imx-audio-cs427x.txt | 47 ++++++++++++++++++++++
>>  sound/soc/fsl/Kconfig                              |  4 +-
>>  sound/soc/fsl/fsl-asoc-card.c                      |  7 ++++
>>  3 files changed, 56 insertions(+), 2 deletions(-)
>>  create mode 100644 Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt
>>
>> diff --git a/Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt b/Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt
>> new file mode 100644
>> index 000000000000..295f60b19418
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt
>> @@ -0,0 +1,47 @@
>> +Freescale i.MX audio complex with CS4271 or CS4272 codec
> 
> I think it could be better to insert these into the fsl-asoc-card.txt
> without those redundant property descriptions. At least it should be
> added to the compatible list. And you may add a comment in (...) to
> describe that it supports both 4271 and 4272.

I agree.

> 
>> +  - mux-int-port	: The internal port of the i.MX audio muxer (AUDMUX)
>> +
>> +  - mux-ext-port	: The external port of the i.MX audio muxer
>> +
>> +Note: The AUDMUX port numbering should start at 1, which is consistent with
>> +hardware manual.
> 
> These two properties are missing in the fsl-asoc-card binding docs.
> So it could be nice to have them as well. But they should be optional
> unless SSI is selected as a CPU DAI.

Ok.

Thanks

-- 
Felipe

[-- Attachment #2: 0x92698E6A.asc --]
[-- Type: application/pgp-keys, Size: 7195 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ASoC: fsl-asoc-card: add cs4271 and cs4272 support
@ 2016-01-29 10:34     ` Felipe Ferreri Tonello
  0 siblings, 0 replies; 6+ messages in thread
From: Felipe Ferreri Tonello @ 2016-01-29 10:34 UTC (permalink / raw)
  To: Nicolin Chen
  Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Mark Brown, Takashi Iwai,
	Rob Herring

[-- Attachment #1: Type: text/plain, Size: 1731 bytes --]

Hi Nicolin,

On 28/01/16 18:24, Nicolin Chen wrote:
> On Thu, Jan 28, 2016 at 10:52:35AM +0000, Felipe F. Tonello wrote:
>> add cs4271 and cs42727 support for fsl-asoc-card
>>
>> Signed-off-by: Felipe F. Tonello <eu-NLnRV5p3vwDxYxTyqlRmvgC/G2K4zDHf@public.gmane.org>
>> ---
>>  .../devicetree/bindings/sound/imx-audio-cs427x.txt | 47 ++++++++++++++++++++++
>>  sound/soc/fsl/Kconfig                              |  4 +-
>>  sound/soc/fsl/fsl-asoc-card.c                      |  7 ++++
>>  3 files changed, 56 insertions(+), 2 deletions(-)
>>  create mode 100644 Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt
>>
>> diff --git a/Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt b/Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt
>> new file mode 100644
>> index 000000000000..295f60b19418
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt
>> @@ -0,0 +1,47 @@
>> +Freescale i.MX audio complex with CS4271 or CS4272 codec
> 
> I think it could be better to insert these into the fsl-asoc-card.txt
> without those redundant property descriptions. At least it should be
> added to the compatible list. And you may add a comment in (...) to
> describe that it supports both 4271 and 4272.

I agree.

> 
>> +  - mux-int-port	: The internal port of the i.MX audio muxer (AUDMUX)
>> +
>> +  - mux-ext-port	: The external port of the i.MX audio muxer
>> +
>> +Note: The AUDMUX port numbering should start at 1, which is consistent with
>> +hardware manual.
> 
> These two properties are missing in the fsl-asoc-card binding docs.
> So it could be nice to have them as well. But they should be optional
> unless SSI is selected as a CPU DAI.

Ok.

Thanks

-- 
Felipe

[-- Attachment #2: 0x92698E6A.asc --]
[-- Type: application/pgp-keys, Size: 7195 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ASoC: fsl-asoc-card: add cs4271 and cs4272 support
  2016-01-28 10:52 ` Felipe F. Tonello
  (?)
  (?)
@ 2016-01-29 16:10 ` Rob Herring
  -1 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2016-01-29 16:10 UTC (permalink / raw)
  To: Felipe F. Tonello
  Cc: alsa-devel, linux-kernel, devicetree, Mark Brown, Takashi Iwai,
	Nicolin Chen

On Thu, Jan 28, 2016 at 10:52:35AM +0000, Felipe F. Tonello wrote:
> add cs4271 and cs42727 support for fsl-asoc-card
> 
> Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
> ---
>  .../devicetree/bindings/sound/imx-audio-cs427x.txt | 47 ++++++++++++++++++++++
>  sound/soc/fsl/Kconfig                              |  4 +-
>  sound/soc/fsl/fsl-asoc-card.c                      |  7 ++++
>  3 files changed, 56 insertions(+), 2 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/sound/imx-audio-cs427x.txt

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-01-29 16:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-28 10:52 [PATCH] ASoC: fsl-asoc-card: add cs4271 and cs4272 support Felipe F. Tonello
2016-01-28 10:52 ` Felipe F. Tonello
2016-01-28 18:24 ` Nicolin Chen
2016-01-29 10:34   ` Felipe Ferreri Tonello
2016-01-29 10:34     ` Felipe Ferreri Tonello
2016-01-29 16:10 ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.