All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Baluta <daniel.baluta@oss.nxp.com>
To: alsa-devel@alsa-project.org, broonie@kernel.org
Cc: linux-imx@nxp.com, linux-kernel@vger.kernel.org,
	festevam@gmail.com, shengjiu.wang@nxp.com
Subject: [PATCH 2/7] ASoC: SOF: imx: Use ARRAY_SIZE instead of hardcoded value
Date: Mon, 20 Jul 2020 10:20:41 +0300	[thread overview]
Message-ID: <20200720072046.8152-3-daniel.baluta@oss.nxp.com> (raw)
In-Reply-To: <20200720072046.8152-1-daniel.baluta@oss.nxp.com>

From: Daniel Baluta <daniel.baluta@nxp.com>

With this change we no longer need to update num_drv when adding
new DAI driver.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
---
 sound/soc/sof/imx/imx8.c  | 4 ++--
 sound/soc/sof/imx/imx8m.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c
index b558132bb609..c7aab646cb8e 100644
--- a/sound/soc/sof/imx/imx8.c
+++ b/sound/soc/sof/imx/imx8.c
@@ -415,7 +415,7 @@ struct snd_sof_dsp_ops sof_imx8_ops = {
 
 	/* DAI drivers */
 	.drv = imx8_dai,
-	.num_drv = 1, /* we have only 1 ESAI interface on i.MX8 */
+	.num_drv = ARRAY_SIZE(imx8_dai),
 
 	/* ALSA HW info flags */
 	.hw_info =	SNDRV_PCM_INFO_MMAP |
@@ -455,7 +455,7 @@ struct snd_sof_dsp_ops sof_imx8x_ops = {
 
 	/* DAI drivers */
 	.drv = imx8_dai,
-	.num_drv = 1, /* we have only 1 ESAI interface on i.MX8 */
+	.num_drv = ARRAY_SIZE(imx8_dai),
 
 	/* ALSA HW info flags */
 	.hw_info =	SNDRV_PCM_INFO_MMAP |
diff --git a/sound/soc/sof/imx/imx8m.c b/sound/soc/sof/imx/imx8m.c
index 287114a37688..067d2424c682 100644
--- a/sound/soc/sof/imx/imx8m.c
+++ b/sound/soc/sof/imx/imx8m.c
@@ -280,7 +280,7 @@ struct snd_sof_dsp_ops sof_imx8m_ops = {
 
 	/* DAI drivers */
 	.drv = imx8m_dai,
-	.num_drv = 1, /* we have only 1 SAI interface on i.MX8M */
+	.num_drv = ARRAY_SIZE(imx8m_dai),
 
 	.hw_info = SNDRV_PCM_INFO_MMAP |
 		SNDRV_PCM_INFO_MMAP_VALID |
-- 
2.17.1


WARNING: multiple messages have this Message-ID (diff)
From: Daniel Baluta <daniel.baluta@oss.nxp.com>
To: alsa-devel@alsa-project.org, broonie@kernel.org
Cc: shengjiu.wang@nxp.com, festevam@gmail.com, linux-imx@nxp.com,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/7] ASoC: SOF: imx: Use ARRAY_SIZE instead of hardcoded value
Date: Mon, 20 Jul 2020 10:20:41 +0300	[thread overview]
Message-ID: <20200720072046.8152-3-daniel.baluta@oss.nxp.com> (raw)
In-Reply-To: <20200720072046.8152-1-daniel.baluta@oss.nxp.com>

From: Daniel Baluta <daniel.baluta@nxp.com>

With this change we no longer need to update num_drv when adding
new DAI driver.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
---
 sound/soc/sof/imx/imx8.c  | 4 ++--
 sound/soc/sof/imx/imx8m.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c
index b558132bb609..c7aab646cb8e 100644
--- a/sound/soc/sof/imx/imx8.c
+++ b/sound/soc/sof/imx/imx8.c
@@ -415,7 +415,7 @@ struct snd_sof_dsp_ops sof_imx8_ops = {
 
 	/* DAI drivers */
 	.drv = imx8_dai,
-	.num_drv = 1, /* we have only 1 ESAI interface on i.MX8 */
+	.num_drv = ARRAY_SIZE(imx8_dai),
 
 	/* ALSA HW info flags */
 	.hw_info =	SNDRV_PCM_INFO_MMAP |
@@ -455,7 +455,7 @@ struct snd_sof_dsp_ops sof_imx8x_ops = {
 
 	/* DAI drivers */
 	.drv = imx8_dai,
-	.num_drv = 1, /* we have only 1 ESAI interface on i.MX8 */
+	.num_drv = ARRAY_SIZE(imx8_dai),
 
 	/* ALSA HW info flags */
 	.hw_info =	SNDRV_PCM_INFO_MMAP |
diff --git a/sound/soc/sof/imx/imx8m.c b/sound/soc/sof/imx/imx8m.c
index 287114a37688..067d2424c682 100644
--- a/sound/soc/sof/imx/imx8m.c
+++ b/sound/soc/sof/imx/imx8m.c
@@ -280,7 +280,7 @@ struct snd_sof_dsp_ops sof_imx8m_ops = {
 
 	/* DAI drivers */
 	.drv = imx8m_dai,
-	.num_drv = 1, /* we have only 1 SAI interface on i.MX8M */
+	.num_drv = ARRAY_SIZE(imx8m_dai),
 
 	.hw_info = SNDRV_PCM_INFO_MMAP |
 		SNDRV_PCM_INFO_MMAP_VALID |
-- 
2.17.1


  parent reply	other threads:[~2020-07-20  7:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20  7:20 [PATCH 0/7] SOF IMX fixes Daniel Baluta
2020-07-20  7:20 ` Daniel Baluta
2020-07-20  7:20 ` [PATCH 1/7] ASoC: SOF: define INFO_ flags in dsp_ops for imx8 Daniel Baluta
2020-07-20  7:20   ` Daniel Baluta
2020-07-20  7:20 ` Daniel Baluta [this message]
2020-07-20  7:20   ` [PATCH 2/7] ASoC: SOF: imx: Use ARRAY_SIZE instead of hardcoded value Daniel Baluta
2020-07-20  7:20 ` [PATCH 3/7] ASoC: SOF: imx8: Fix ESAI DAI driver name for i.MX8/iMX8X Daniel Baluta
2020-07-20  7:20   ` Daniel Baluta
2020-07-20  7:20 ` [PATCH 4/7] ASoC: SOF: imx8m: Fix SAI DAI driver for i.MX8M Daniel Baluta
2020-07-20  7:20   ` Daniel Baluta
2020-07-20  7:20 ` [PATCH 5/7] ASoC: SOF: imx8: Add SAI dai driver for i.MX/i.MX8X Daniel Baluta
2020-07-20  7:20   ` Daniel Baluta
2020-07-20  7:20 ` [PATCH 6/7] ASoC: SOF: topology: Update SAI config bclk/fsync rate Daniel Baluta
2020-07-20  7:20   ` Daniel Baluta
2020-07-20  7:20 ` [PATCH 7/7] ASoC: SOF: pcm: Update rate/channels for SAI/ESAI DAIs Daniel Baluta
2020-07-20  7:20   ` Daniel Baluta
2020-07-22 13:44 ` [PATCH 0/7] SOF IMX fixes Mark Brown
2020-07-22 13:44   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200720072046.8152-3-daniel.baluta@oss.nxp.com \
    --to=daniel.baluta@oss.nxp.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=festevam@gmail.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shengjiu.wang@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.