All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 1/3] ASoC: imx-card: Need special setting for ak4497 on i.MX8MQ
@ 2022-01-05  9:02 ` S.J. Wang
  0 siblings, 0 replies; 7+ messages in thread
From: S.J. Wang @ 2022-01-05  9:02 UTC (permalink / raw)
  To: Mark Brown
  Cc: timur, nicoleotsuka, Xiubo.Lee, festevam, perex, tiwai,
	alsa-devel, linuxppc-dev, linux-kernel

Hi

> 
> >  			/* sai may support mclk/bclk = 1 */
> > -			if (of_find_property(np, "fsl,mclk-equal-bclk", NULL))
> > +			if (of_find_property(np, "fsl,mclk-equal-bclk", NULL))
> {
> >  				link_data->one2one_ratio = true;
> > +			} else {
> > +				int i;
> > +
> > +				/*
> > +				 * i.MX8MQ don't support one2one ratio,
> then
> > +				 * with ak4497 only 16bit case is supported.
> > +				 */
> > +				for (i = 0; i < ARRAY_SIZE(ak4497_fs_mul); i++)
> {
> 
> Shouldn't this be keyed off checking that we are actually running with an
> ak4497?

No need. Here just update the ak4497_fs_mul table, before it is used the
codec type is checked.

Best regards
Wang Shengjiu

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

* Re: [PATCH 1/3] ASoC: imx-card: Need special setting for ak4497 on i.MX8MQ
@ 2022-01-05  9:02 ` S.J. Wang
  0 siblings, 0 replies; 7+ messages in thread
From: S.J. Wang @ 2022-01-05  9:02 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel, timur, Xiubo.Lee, linuxppc-dev, tiwai, nicoleotsuka,
	festevam, linux-kernel

Hi

> 
> >  			/* sai may support mclk/bclk = 1 */
> > -			if (of_find_property(np, "fsl,mclk-equal-bclk", NULL))
> > +			if (of_find_property(np, "fsl,mclk-equal-bclk", NULL))
> {
> >  				link_data->one2one_ratio = true;
> > +			} else {
> > +				int i;
> > +
> > +				/*
> > +				 * i.MX8MQ don't support one2one ratio,
> then
> > +				 * with ak4497 only 16bit case is supported.
> > +				 */
> > +				for (i = 0; i < ARRAY_SIZE(ak4497_fs_mul); i++)
> {
> 
> Shouldn't this be keyed off checking that we are actually running with an
> ak4497?

No need. Here just update the ak4497_fs_mul table, before it is used the
codec type is checked.

Best regards
Wang Shengjiu

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

* Re: [PATCH 1/3] ASoC: imx-card: Need special setting for ak4497 on i.MX8MQ
@ 2022-01-05  9:02 ` S.J. Wang
  0 siblings, 0 replies; 7+ messages in thread
From: S.J. Wang @ 2022-01-05  9:02 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel, timur, Xiubo.Lee, linuxppc-dev, tiwai, perex,
	nicoleotsuka, festevam, linux-kernel

Hi

> 
> >  			/* sai may support mclk/bclk = 1 */
> > -			if (of_find_property(np, "fsl,mclk-equal-bclk", NULL))
> > +			if (of_find_property(np, "fsl,mclk-equal-bclk", NULL))
> {
> >  				link_data->one2one_ratio = true;
> > +			} else {
> > +				int i;
> > +
> > +				/*
> > +				 * i.MX8MQ don't support one2one ratio,
> then
> > +				 * with ak4497 only 16bit case is supported.
> > +				 */
> > +				for (i = 0; i < ARRAY_SIZE(ak4497_fs_mul); i++)
> {
> 
> Shouldn't this be keyed off checking that we are actually running with an
> ak4497?

No need. Here just update the ak4497_fs_mul table, before it is used the
codec type is checked.

Best regards
Wang Shengjiu

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

* Re: [PATCH 1/3] ASoC: imx-card: Need special setting for ak4497 on i.MX8MQ
  2022-01-04 10:40 ` [PATCH 1/3] ASoC: imx-card: Need special setting for ak4497 on i.MX8MQ Shengjiu Wang
  2022-01-04 18:06     ` Mark Brown
@ 2022-01-04 18:06     ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2022-01-04 18:06 UTC (permalink / raw)
  To: Shengjiu Wang
  Cc: timur, nicoleotsuka, Xiubo.Lee, festevam, perex, tiwai,
	alsa-devel, linuxppc-dev, linux-kernel

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

On Tue, Jan 04, 2022 at 06:40:33PM +0800, Shengjiu Wang wrote:

>  			/* sai may support mclk/bclk = 1 */
> -			if (of_find_property(np, "fsl,mclk-equal-bclk", NULL))
> +			if (of_find_property(np, "fsl,mclk-equal-bclk", NULL)) {
>  				link_data->one2one_ratio = true;
> +			} else {
> +				int i;
> +
> +				/*
> +				 * i.MX8MQ don't support one2one ratio, then
> +				 * with ak4497 only 16bit case is supported.
> +				 */
> +				for (i = 0; i < ARRAY_SIZE(ak4497_fs_mul); i++) {

Shouldn't this be keyed off checking that we are actually running with
an ak4497?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 1/3] ASoC: imx-card: Need special setting for ak4497 on i.MX8MQ
@ 2022-01-04 18:06     ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2022-01-04 18:06 UTC (permalink / raw)
  To: Shengjiu Wang
  Cc: alsa-devel, timur, Xiubo.Lee, linuxppc-dev, tiwai, nicoleotsuka,
	festevam, linux-kernel

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

On Tue, Jan 04, 2022 at 06:40:33PM +0800, Shengjiu Wang wrote:

>  			/* sai may support mclk/bclk = 1 */
> -			if (of_find_property(np, "fsl,mclk-equal-bclk", NULL))
> +			if (of_find_property(np, "fsl,mclk-equal-bclk", NULL)) {
>  				link_data->one2one_ratio = true;
> +			} else {
> +				int i;
> +
> +				/*
> +				 * i.MX8MQ don't support one2one ratio, then
> +				 * with ak4497 only 16bit case is supported.
> +				 */
> +				for (i = 0; i < ARRAY_SIZE(ak4497_fs_mul); i++) {

Shouldn't this be keyed off checking that we are actually running with
an ak4497?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 1/3] ASoC: imx-card: Need special setting for ak4497 on i.MX8MQ
@ 2022-01-04 18:06     ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2022-01-04 18:06 UTC (permalink / raw)
  To: Shengjiu Wang
  Cc: alsa-devel, timur, Xiubo.Lee, linuxppc-dev, tiwai, perex,
	nicoleotsuka, festevam, linux-kernel

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

On Tue, Jan 04, 2022 at 06:40:33PM +0800, Shengjiu Wang wrote:

>  			/* sai may support mclk/bclk = 1 */
> -			if (of_find_property(np, "fsl,mclk-equal-bclk", NULL))
> +			if (of_find_property(np, "fsl,mclk-equal-bclk", NULL)) {
>  				link_data->one2one_ratio = true;
> +			} else {
> +				int i;
> +
> +				/*
> +				 * i.MX8MQ don't support one2one ratio, then
> +				 * with ak4497 only 16bit case is supported.
> +				 */
> +				for (i = 0; i < ARRAY_SIZE(ak4497_fs_mul); i++) {

Shouldn't this be keyed off checking that we are actually running with
an ak4497?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* [PATCH 1/3] ASoC: imx-card: Need special setting for ak4497 on i.MX8MQ
  2022-01-04 10:40 [PATCH 0/3] ASoC: imx-card: several improvement and fixes Shengjiu Wang
@ 2022-01-04 10:40 ` Shengjiu Wang
  2022-01-04 18:06     ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Shengjiu Wang @ 2022-01-04 10:40 UTC (permalink / raw)
  To: timur, nicoleotsuka, Xiubo.Lee, festevam, broonie, perex, tiwai,
	alsa-devel
  Cc: linuxppc-dev, linux-kernel

The SAI on i.MX8MQ don't support one2one ratio for mclk:bclk, so
the mclk frequency exceeds the supported range of codec for
the case that sample rate is larger than 705kHZ and format is
S32_LE. Update the supported width for such case.

Fixes: aa736700f42f ("ASoC: imx-card: Add imx-card machine driver")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 sound/soc/fsl/imx-card.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/sound/soc/fsl/imx-card.c b/sound/soc/fsl/imx-card.c
index e758c4f1b0bc..e0f3aa6d9501 100644
--- a/sound/soc/fsl/imx-card.c
+++ b/sound/soc/fsl/imx-card.c
@@ -553,8 +553,23 @@ static int imx_card_parse_of(struct imx_card_data *data)
 			link_data->cpu_sysclk_id = FSL_SAI_CLK_MAST1;
 
 			/* sai may support mclk/bclk = 1 */
-			if (of_find_property(np, "fsl,mclk-equal-bclk", NULL))
+			if (of_find_property(np, "fsl,mclk-equal-bclk", NULL)) {
 				link_data->one2one_ratio = true;
+			} else {
+				int i;
+
+				/*
+				 * i.MX8MQ don't support one2one ratio, then
+				 * with ak4497 only 16bit case is supported.
+				 */
+				for (i = 0; i < ARRAY_SIZE(ak4497_fs_mul); i++) {
+					if (ak4497_fs_mul[i].rmin == 705600 &&
+					    ak4497_fs_mul[i].rmax == 768000) {
+						ak4497_fs_mul[i].wmin = 32;
+						ak4497_fs_mul[i].wmax = 32;
+					}
+				}
+			}
 		}
 
 		link->cpus->of_node = args.np;
-- 
2.17.1


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

end of thread, other threads:[~2022-01-05  9:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-05  9:02 [PATCH 1/3] ASoC: imx-card: Need special setting for ak4497 on i.MX8MQ S.J. Wang
2022-01-05  9:02 ` S.J. Wang
2022-01-05  9:02 ` S.J. Wang
  -- strict thread matches above, loose matches on Subject: below --
2022-01-04 10:40 [PATCH 0/3] ASoC: imx-card: several improvement and fixes Shengjiu Wang
2022-01-04 10:40 ` [PATCH 1/3] ASoC: imx-card: Need special setting for ak4497 on i.MX8MQ Shengjiu Wang
2022-01-04 18:06   ` Mark Brown
2022-01-04 18:06     ` Mark Brown
2022-01-04 18:06     ` Mark Brown

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.