diff mbox

[2/3] ASoC: core: add a dapm sink widget

Message ID 1448293951-32071-3-git-send-email-vinod.koul@intel.com (mailing list archive)
State Accepted
Commit 56b4437f15ed2003413b857e08740576332e72d7
Headers show

Commit Message

Vinod Koul Nov. 23, 2015, 3:52 p.m. UTC
DAPM models various widgets but lacks a sink widget.
DSPs can have modules which take audio data, process it and are
capable of generating events thus acting as a sink of data.

To make the dapm graph complete for such paths we need a dapm
sink widget for these modules, so add a SND_SOC_DAPM_SINK to
declare such a widget.
This widget will be treated as SND_SOC_DAPM_EP_SINK endpoint in
the dapm graph

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 include/sound/soc-dapm.h | 4 ++++
 sound/soc/soc-dapm.c     | 5 +++++
 2 files changed, 9 insertions(+)

Comments

Lars-Peter Clausen Nov. 24, 2015, 9:48 a.m. UTC | #1
On 11/23/2015 04:52 PM, Vinod Koul wrote:
> DAPM models various widgets but lacks a sink widget.
> DSPs can have modules which take audio data, process it and are
> capable of generating events thus acting as a sink of data.
> 
> To make the dapm graph complete for such paths we need a dapm
> sink widget for these modules, so add a SND_SOC_DAPM_SINK to
> declare such a widget.
> This widget will be treated as SND_SOC_DAPM_EP_SINK endpoint in
> the dapm graph

Except for the strange formating of the commit message this looks good.

Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Vinod Koul Nov. 24, 2015, 10:19 a.m. UTC | #2
On Tue, Nov 24, 2015 at 10:48:42AM +0100, Lars-Peter Clausen wrote:
> On 11/23/2015 04:52 PM, Vinod Koul wrote:
> > DAPM models various widgets but lacks a sink widget.
> > DSPs can have modules which take audio data, process it and are
> > capable of generating events thus acting as a sink of data.
> > 
> > To make the dapm graph complete for such paths we need a dapm
> > sink widget for these modules, so add a SND_SOC_DAPM_SINK to
> > declare such a widget.
> > This widget will be treated as SND_SOC_DAPM_EP_SINK endpoint in
> > the dapm graph
> 
> Except for the strange formating of the commit message this looks good.

Checkpath now seems to warn if commit message > 65chars so have set it for
commit message

> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>

Thanks
Mark Brown Nov. 25, 2015, 12:51 p.m. UTC | #3
On Tue, Nov 24, 2015 at 03:49:07PM +0530, Vinod Koul wrote:
> On Tue, Nov 24, 2015 at 10:48:42AM +0100, Lars-Peter Clausen wrote:
> > On 11/23/2015 04:52 PM, Vinod Koul wrote:

> > > To make the dapm graph complete for such paths we need a dapm
> > > sink widget for these modules, so add a SND_SOC_DAPM_SINK to
> > > declare such a widget.
> > > This widget will be treated as SND_SOC_DAPM_EP_SINK endpoint in
> > > the dapm graph

> > Except for the strange formating of the commit message this looks good.

> Checkpath now seems to warn if commit message > 65chars so have set it for
> commit message

I think it's more the random wrapping above - it looks like those are
either two paragraphs or one paragraph with random word wrapping within
it.
diff mbox

Patch

diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 7855cfe46b69..fe19dd3abb00 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -49,6 +49,9 @@  struct device;
 #define SND_SOC_DAPM_SIGGEN(wname) \
 {	.id = snd_soc_dapm_siggen, .name = wname, .kcontrol_news = NULL, \
 	.num_kcontrols = 0, .reg = SND_SOC_NOPM }
+#define SND_SOC_DAPM_SINK(wname) \
+{	.id = snd_soc_dapm_sink, .name = wname, .kcontrol_news = NULL, \
+	.num_kcontrols = 0, .reg = SND_SOC_NOPM }
 #define SND_SOC_DAPM_INPUT(wname) \
 {	.id = snd_soc_dapm_input, .name = wname, .kcontrol_news = NULL, \
 	.num_kcontrols = 0, .reg = SND_SOC_NOPM }
@@ -484,6 +487,7 @@  enum snd_soc_dapm_type {
 	snd_soc_dapm_aif_in,		/* audio interface input */
 	snd_soc_dapm_aif_out,		/* audio interface output */
 	snd_soc_dapm_siggen,		/* signal generator */
+	snd_soc_dapm_sink,
 	snd_soc_dapm_dai_in,		/* link to DAI structure */
 	snd_soc_dapm_dai_out,
 	snd_soc_dapm_dai_link,		/* link between two DAI structures */
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 3eba72c6f9dd..506677b12787 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3351,6 +3351,11 @@  snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm,
 		w->is_ep = SND_SOC_DAPM_EP_SOURCE;
 		w->power_check = dapm_always_on_check_power;
 		break;
+	case snd_soc_dapm_sink:
+		w->is_ep = SND_SOC_DAPM_EP_SINK;
+		w->power_check = dapm_always_on_check_power;
+		break;
+
 	case snd_soc_dapm_mux:
 	case snd_soc_dapm_demux:
 	case snd_soc_dapm_switch: