Skip to contentSkip to conversation

ASoC: pcm1792a: Remove empty capture DAI stub

PATCH In review Mark Brown 2 participants 4 messages Aug 13, 2013 – Aug 23, 2013

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

PATCH 1/2 ASoC: pcm1792a: Remove empty capture DAI stub

From: Mark Brown <[email protected]>

These intialisations are just what will be done for static data anyway so remove them.

---
 sound/soc/codecs/pcm1792a.c | 4 ----
 1 file changed, 4 deletions(-)
sound/soc/codecs/pcm1792a.c +0 -4
index 72cf835..c57d3a5 100644
@@ -162,10 +162,6 @@ static struct snd_soc_dai_driver pcm1792a_dai = {
 		.channels_max = 2,
 		.rates = PCM1792A_RATES,
 		.formats = PCM1792A_FORMATS, },
-	.capture = {
-		.channels_min = 0,
-		.channels_max = 0,
-	},
 	.ops = &pcm1792a_dai_ops,
 };
 
Signature · 1 line
1.8.4.rc2
author maintainer
#1 lore raw

PATCH 2/2 ASoC: pcm1792a: Add DAPM support

From: Mark Brown <[email protected]>

Provide DAPM for the device, ensuring operation with DAPM required by the core and making it easier to hook up external hardware to it.

---
 sound/soc/codecs/pcm1792a.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
sound/soc/codecs/pcm1792a.c +18 -0
index c57d3a5..2a8eccf 100644
@@ -154,6 +154,20 @@ static const struct snd_kcontrol_new pcm1792a_controls[] = {
 			 pcm1792a_dac_tlv),
 };
 
+static const struct snd_soc_dapm_widget pcm1792a_dapm_widgets[] = {
+SND_SOC_DAPM_OUTPUT("IOUTL+"),
+SND_SOC_DAPM_OUTPUT("IOUTL-"),
+SND_SOC_DAPM_OUTPUT("IOUTR+"),
+SND_SOC_DAPM_OUTPUT("IOUTR-"),
+};
+
+static const struct snd_soc_dapm_route pcm1792a_dapm_routes[] = {
+	{ "IOUTL+", NULL, "Playback" },
+	{ "IOUTL-", NULL, "Playback" },
+	{ "IOUTR+", NULL, "Playback" },
+	{ "IOUTR-", NULL, "Playback" },
+};
+
 static struct snd_soc_dai_driver pcm1792a_dai = {
 	.name = "pcm1792a-hifi",
 	.playback = {
@@ -184,6 +198,10 @@ static const struct regmap_config pcm1792a_regmap = {
 static struct snd_soc_codec_driver soc_codec_dev_pcm1792a = {
 	.controls		= pcm1792a_controls,
 	.num_controls		= ARRAY_SIZE(pcm1792a_controls),
+	.dapm_widgets		= pcm1792a_dapm_widgets,
+	.num_dapm_widgets	= ARRAY_SIZE(pcm1792a_dapm_widgets),
+	.dapm_routes		= pcm1792a_dapm_routes,
+	.num_dapm_routes	= ARRAY_SIZE(pcm1792a_dapm_routes),
 };
 
 static int pcm1792a_spi_probe(struct spi_device *spi)
Signature · 1 line
1.8.4.rc2
#2 lore raw

Re: [PATCH 2/2] ASoC: pcm1792a: Add DAPM support

Hi Mark

Quoted 15 lines · Mark Brown

From: Mark Brown <[email protected]>

Provide DAPM for the device, ensuring operation with DAPM required by the core and making it easier to hook up external hardware to it.

---
 sound/soc/codecs/pcm1792a.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
sound/soc/codecs/pcm1792a.c +0 -0
index c57d3a5..2a8eccf 100644

sound/soc/codecs/pcm1792a.c static const struct snd_kcontrol_new pcm1792a_controls[] = { · line 163

Quoted 10 lines
sound/soc/codecs/pcm1792a.c +7 -0
@@ -154,6 +154,20 @@ static const struct snd_kcontrol_new pcm1792a_controls[] = {
 			 pcm1792a_dac_tlv),
 };
 
+static const struct snd_soc_dapm_widget pcm1792a_dapm_widgets[] = {
+SND_SOC_DAPM_OUTPUT("IOUTL+"),
+SND_SOC_DAPM_OUTPUT("IOUTL-"),
+SND_SOC_DAPM_OUTPUT("IOUTR+"),
+SND_SOC_DAPM_OUTPUT("IOUTR-"),
+};
+

I'm working on support pcm1795 and pcm1796 too. They are registers compatible but different sample rate support. So the idea is three patches?

- rename pcm1792a to pcm179x (is it possible?)
- add three different dai for pcm1792a, pcm1795 and pcm1796
- use of_device_id data pointer to select the correct dai

Michael

Quoted 24 lines
sound/soc/codecs/pcm1792a.c +11 -0
+static const struct snd_soc_dapm_route pcm1792a_dapm_routes[] = {
+	{ "IOUTL+", NULL, "Playback" },
+	{ "IOUTL-", NULL, "Playback" },
+	{ "IOUTR+", NULL, "Playback" },
+	{ "IOUTR-", NULL, "Playback" },
+};
+
 static struct snd_soc_dai_driver pcm1792a_dai = {
 	.name = "pcm1792a-hifi",
 	.playback = {
@@ -184,6 +198,10 @@ static const struct regmap_config pcm1792a_regmap = {
 static struct snd_soc_codec_driver soc_codec_dev_pcm1792a = {
 	.controls		= pcm1792a_controls,
 	.num_controls		= ARRAY_SIZE(pcm1792a_controls),
+	.dapm_widgets		= pcm1792a_dapm_widgets,
+	.num_dapm_widgets	= ARRAY_SIZE(pcm1792a_dapm_widgets),
+	.dapm_routes		= pcm1792a_dapm_routes,
+	.num_dapm_routes	= ARRAY_SIZE(pcm1792a_dapm_routes),
 };
 
 static int pcm1792a_spi_probe(struct spi_device *spi)
Signature · 1 line
1.8.4.rc2
author maintainer
#3 lore raw

Re: [PATCH 2/2] ASoC: pcm1792a: Add DAPM support

Quoted 6 lines · Michael Trimarchi

I'm working on support pcm1795 and pcm1796 too. They are registers compatible but different sample rate support. So the idea is three patches?

- rename pcm1792a to pcm179x (is it possible?)
- add three different dai for pcm1792a, pcm1795 and pcm1796
- use of_device_id data pointer to select the correct dai

Yes, that seems like a good approach - no problem with the rename, just make sure the existing users are updated.