All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brent Lu <brent.lu@intel.com>
To: alsa-devel@alsa-project.org
Cc: Cezary Rojewski <cezary.rojewski@intel.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	Jie Yang <yang.jie@linux.intel.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>, Brent Lu <brent.lu@intel.com>,
	Rander Wang <rander.wang@intel.com>,
	Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>,
	linux-kernel@vger.kernel.org,
	Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Dharageswari R <dharageswari.r@intel.com>,
	Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>,
	Bard Liao <yung-chuan.liao@linux.intel.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Naveen Manohar <naveen.m@intel.com>,
	Yong Zhi <yong.zhi@intel.com>,
	Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>,
	Fred Oh <fred.oh@linux.intel.com>,
	Tzung-Bi Shih <tzungbi@google.com>
Subject: [PATCH 2/4] ASoC: Intel: maxim-common: support max98360a
Date: Sun,  6 Jun 2021 08:41:00 +0800	[thread overview]
Message-ID: <20210606004102.26190-3-brent.lu@intel.com> (raw)
In-Reply-To: <20210606004102.26190-1-brent.lu@intel.com>

Move max98360a code to this common module so it could be shared
between multiple SOF machine drivers. MAX98357A and MAX98360A are
sharing same codec driver so here we also share some function and
structures.

Signed-off-by: Brent Lu <brent.lu@intel.com>
---
 sound/soc/intel/boards/sof_maxim_common.c | 17 ++++++++++++++++-
 sound/soc/intel/boards/sof_maxim_common.h |  4 +++-
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/sound/soc/intel/boards/sof_maxim_common.c b/sound/soc/intel/boards/sof_maxim_common.c
index e9c52f8b6428..e66dfe666915 100644
--- a/sound/soc/intel/boards/sof_maxim_common.c
+++ b/sound/soc/intel/boards/sof_maxim_common.c
@@ -134,7 +134,7 @@ void max_98373_set_codec_conf(struct snd_soc_card *card)
 EXPORT_SYMBOL_NS(max_98373_set_codec_conf, SND_SOC_INTEL_SOF_MAXIM_COMMON);
 
 /*
- * Maxim MAX98357A
+ * Maxim MAX98357A/MAX98360A
  */
 static const struct snd_kcontrol_new max_98357a_kcontrols[] = {
 	SOC_DAPM_PIN_SWITCH("Spk"),
@@ -156,6 +156,13 @@ static struct snd_soc_dai_link_component max_98357a_components[] = {
 	}
 };
 
+static struct snd_soc_dai_link_component max_98360a_components[] = {
+	{
+		.name = MAX_98360A_DEV0_NAME,
+		.dai_name = MAX_98357A_CODEC_DAI,
+	}
+};
+
 static int max_98357a_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct snd_soc_card *card = rtd->card;
@@ -193,5 +200,13 @@ void max_98357a_dai_link(struct snd_soc_dai_link *link)
 }
 EXPORT_SYMBOL_NS(max_98357a_dai_link, SND_SOC_INTEL_SOF_MAXIM_COMMON);
 
+void max_98360a_dai_link(struct snd_soc_dai_link *link)
+{
+	link->codecs = max_98360a_components;
+	link->num_codecs = ARRAY_SIZE(max_98360a_components);
+	link->init = max_98357a_init;
+}
+EXPORT_SYMBOL_NS(max_98360a_dai_link, SND_SOC_INTEL_SOF_MAXIM_COMMON);
+
 MODULE_DESCRIPTION("ASoC Intel SOF Maxim helpers");
 MODULE_LICENSE("GPL");
diff --git a/sound/soc/intel/boards/sof_maxim_common.h b/sound/soc/intel/boards/sof_maxim_common.h
index 2674f1e373ef..3ff5e8fec4de 100644
--- a/sound/soc/intel/boards/sof_maxim_common.h
+++ b/sound/soc/intel/boards/sof_maxim_common.h
@@ -25,11 +25,13 @@ void max_98373_set_codec_conf(struct snd_soc_card *card);
 int max_98373_trigger(struct snd_pcm_substream *substream, int cmd);
 
 /*
- * Maxim MAX98357A
+ * Maxim MAX98357A/MAX98360A
  */
 #define MAX_98357A_CODEC_DAI	"HiFi"
 #define MAX_98357A_DEV0_NAME	"MX98357A:00"
+#define MAX_98360A_DEV0_NAME	"MX98360A:00"
 
 void max_98357a_dai_link(struct snd_soc_dai_link *link);
+void max_98360a_dai_link(struct snd_soc_dai_link *link);
 
 #endif /* __SOF_MAXIM_COMMON_H */
-- 
2.17.1


WARNING: multiple messages have this Message-ID (diff)
From: Brent Lu <brent.lu@intel.com>
To: alsa-devel@alsa-project.org
Cc: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>,
	Cezary Rojewski <cezary.rojewski@intel.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Rander Wang <rander.wang@intel.com>,
	Jie Yang <yang.jie@linux.intel.com>,
	Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	Bard Liao <yung-chuan.liao@linux.intel.com>,
	Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Fred Oh <fred.oh@linux.intel.com>,
	Tzung-Bi Shih <tzungbi@google.com>,
	Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
	Yong Zhi <yong.zhi@intel.com>,
	Dharageswari R <dharageswari.r@intel.com>,
	Mark Brown <broonie@kernel.org>,
	Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>,
	Naveen Manohar <naveen.m@intel.com>,
	Brent Lu <brent.lu@intel.com>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/4] ASoC: Intel: maxim-common: support max98360a
Date: Sun,  6 Jun 2021 08:41:00 +0800	[thread overview]
Message-ID: <20210606004102.26190-3-brent.lu@intel.com> (raw)
In-Reply-To: <20210606004102.26190-1-brent.lu@intel.com>

Move max98360a code to this common module so it could be shared
between multiple SOF machine drivers. MAX98357A and MAX98360A are
sharing same codec driver so here we also share some function and
structures.

Signed-off-by: Brent Lu <brent.lu@intel.com>
---
 sound/soc/intel/boards/sof_maxim_common.c | 17 ++++++++++++++++-
 sound/soc/intel/boards/sof_maxim_common.h |  4 +++-
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/sound/soc/intel/boards/sof_maxim_common.c b/sound/soc/intel/boards/sof_maxim_common.c
index e9c52f8b6428..e66dfe666915 100644
--- a/sound/soc/intel/boards/sof_maxim_common.c
+++ b/sound/soc/intel/boards/sof_maxim_common.c
@@ -134,7 +134,7 @@ void max_98373_set_codec_conf(struct snd_soc_card *card)
 EXPORT_SYMBOL_NS(max_98373_set_codec_conf, SND_SOC_INTEL_SOF_MAXIM_COMMON);
 
 /*
- * Maxim MAX98357A
+ * Maxim MAX98357A/MAX98360A
  */
 static const struct snd_kcontrol_new max_98357a_kcontrols[] = {
 	SOC_DAPM_PIN_SWITCH("Spk"),
@@ -156,6 +156,13 @@ static struct snd_soc_dai_link_component max_98357a_components[] = {
 	}
 };
 
+static struct snd_soc_dai_link_component max_98360a_components[] = {
+	{
+		.name = MAX_98360A_DEV0_NAME,
+		.dai_name = MAX_98357A_CODEC_DAI,
+	}
+};
+
 static int max_98357a_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct snd_soc_card *card = rtd->card;
@@ -193,5 +200,13 @@ void max_98357a_dai_link(struct snd_soc_dai_link *link)
 }
 EXPORT_SYMBOL_NS(max_98357a_dai_link, SND_SOC_INTEL_SOF_MAXIM_COMMON);
 
+void max_98360a_dai_link(struct snd_soc_dai_link *link)
+{
+	link->codecs = max_98360a_components;
+	link->num_codecs = ARRAY_SIZE(max_98360a_components);
+	link->init = max_98357a_init;
+}
+EXPORT_SYMBOL_NS(max_98360a_dai_link, SND_SOC_INTEL_SOF_MAXIM_COMMON);
+
 MODULE_DESCRIPTION("ASoC Intel SOF Maxim helpers");
 MODULE_LICENSE("GPL");
diff --git a/sound/soc/intel/boards/sof_maxim_common.h b/sound/soc/intel/boards/sof_maxim_common.h
index 2674f1e373ef..3ff5e8fec4de 100644
--- a/sound/soc/intel/boards/sof_maxim_common.h
+++ b/sound/soc/intel/boards/sof_maxim_common.h
@@ -25,11 +25,13 @@ void max_98373_set_codec_conf(struct snd_soc_card *card);
 int max_98373_trigger(struct snd_pcm_substream *substream, int cmd);
 
 /*
- * Maxim MAX98357A
+ * Maxim MAX98357A/MAX98360A
  */
 #define MAX_98357A_CODEC_DAI	"HiFi"
 #define MAX_98357A_DEV0_NAME	"MX98357A:00"
+#define MAX_98360A_DEV0_NAME	"MX98360A:00"
 
 void max_98357a_dai_link(struct snd_soc_dai_link *link);
+void max_98360a_dai_link(struct snd_soc_dai_link *link);
 
 #endif /* __SOF_MAXIM_COMMON_H */
-- 
2.17.1


  parent reply	other threads:[~2021-06-06  1:01 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-06  0:40 [PATCH 0/4] Support CS42L42 on JSL platform Brent Lu
2021-06-06  0:40 ` Brent Lu
2021-06-06  0:40 ` [PATCH 1/4] ASoC: Intel: sof_cs42l42: support JSL DAI link sequence Brent Lu
2021-06-06  0:40   ` Brent Lu
2021-06-07 13:32   ` Pierre-Louis Bossart
2021-06-07 13:32     ` Pierre-Louis Bossart
2021-06-07 14:23     ` Lu, Brent
2021-06-07 14:23       ` Lu, Brent
2021-06-07 20:49       ` Pierre-Louis Bossart
2021-06-07 20:49         ` Pierre-Louis Bossart
2021-06-06  0:41 ` Brent Lu [this message]
2021-06-06  0:41   ` [PATCH 2/4] ASoC: Intel: maxim-common: support max98360a Brent Lu
2021-06-06  0:41 ` [PATCH 3/4] ASoC: intel: sof_cs42l42: add support for jsl_cs4242_mx98360a Brent Lu
2021-06-06  0:41   ` Brent Lu
2021-06-07 13:40   ` Pierre-Louis Bossart
2021-06-07 13:40     ` Pierre-Louis Bossart
2021-06-07 14:29     ` Lu, Brent
2021-06-07 14:29       ` Lu, Brent
2021-06-07 14:43       ` Pierre-Louis Bossart
2021-06-07 14:43         ` Pierre-Louis Bossart
2021-06-07 16:28         ` Lu, Brent
2021-06-07 16:28           ` Lu, Brent
2021-06-07 18:32           ` Pierre-Louis Bossart
2021-06-07 18:32             ` Pierre-Louis Bossart
2021-06-06  0:41 ` [PATCH 4/4] ASoC: Intel: sof_rt5682: code refactor for max98360a Brent Lu
2021-06-06  0:41   ` Brent Lu

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=20210606004102.26190-3-brent.lu@intel.com \
    --to=brent.lu@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=dharageswari.r@intel.com \
    --cc=fred.oh@linux.intel.com \
    --cc=guennadi.liakhovetski@linux.intel.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naveen.m@intel.com \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=rander.wang@intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=sathyanarayana.nujella@intel.com \
    --cc=tiwai@suse.com \
    --cc=tzungbi@google.com \
    --cc=vamshi.krishna.gopal@intel.com \
    --cc=yang.jie@linux.intel.com \
    --cc=yong.zhi@intel.com \
    --cc=yung-chuan.liao@linux.intel.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.