alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [alsa-devel] [PATCH 0/2] ASoC: Follow the recent ALSA core API changes
@ 2019-11-21 19:07 Takashi Iwai
  2019-11-21 19:07 ` [alsa-devel] [PATCH 1/2] ASoC: pcm: Make ioctl ops optional Takashi Iwai
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Takashi Iwai @ 2019-11-21 19:07 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel

Hi,

this is a follow-up patch set for ASoC to adapt the recent ALSA PCM
core changes.  It's merely a preliminary and this itself doesn't
change the current driver behavior.  The purpose of this submission is
to get the basic API changes done in 5.5-rc1, so that other trees can
apply the actual changes later individually.  The actual cleanups and
changes in the driver side will be submitted after 5.5 merge window.

Mark, if you are OK with this, please give ACK.  Then I'll merge them
into my tree for 5.5-rc1.


thanks,

Takashi

===

Takashi Iwai (2):
  ASoC: pcm: Make ioctl ops optional
  ASoC: component: Add sync_stop PCM ops

 include/sound/soc-component.h |  3 +++
 sound/soc/soc-component.c     | 19 +++++++++++++++++++
 sound/soc/soc-pcm.c           |  6 ++++--
 3 files changed, 26 insertions(+), 2 deletions(-)

-- 
2.16.4

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* [alsa-devel] [PATCH 1/2] ASoC: pcm: Make ioctl ops optional
  2019-11-21 19:07 [alsa-devel] [PATCH 0/2] ASoC: Follow the recent ALSA core API changes Takashi Iwai
@ 2019-11-21 19:07 ` Takashi Iwai
  2019-11-21 19:07 ` [alsa-devel] [PATCH 2/2] ASoC: component: Add sync_stop PCM ops Takashi Iwai
  2019-11-22 13:34 ` [alsa-devel] [PATCH 0/2] ASoC: Follow the recent ALSA core API changes Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2019-11-21 19:07 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel

Now PCM core accepts the NULL ioctl ops as default, and passing a proper
ioctl ops is no longer mandatory.  Adjust soc_new_pcm() to allow also
the NULL for component ioctl ops, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/soc-pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 493a2e80e893..4dd13c9249ab 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -3005,7 +3005,6 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
 		rtd->ops.hw_free	= dpcm_fe_dai_hw_free;
 		rtd->ops.close		= dpcm_fe_dai_close;
 		rtd->ops.pointer	= soc_pcm_pointer;
-		rtd->ops.ioctl		= snd_soc_pcm_component_ioctl;
 	} else {
 		rtd->ops.open		= soc_pcm_open;
 		rtd->ops.hw_params	= soc_pcm_hw_params;
@@ -3014,12 +3013,13 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
 		rtd->ops.hw_free	= soc_pcm_hw_free;
 		rtd->ops.close		= soc_pcm_close;
 		rtd->ops.pointer	= soc_pcm_pointer;
-		rtd->ops.ioctl		= snd_soc_pcm_component_ioctl;
 	}
 
 	for_each_rtd_components(rtd, rtdcom, component) {
 		const struct snd_soc_component_driver *drv = component->driver;
 
+		if (drv->ioctl)
+			rtd->ops.ioctl		= snd_soc_pcm_component_ioctl;
 		if (drv->copy_user)
 			rtd->ops.copy_user	= snd_soc_pcm_component_copy_user;
 		if (drv->page)
-- 
2.16.4

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* [alsa-devel] [PATCH 2/2] ASoC: component: Add sync_stop PCM ops
  2019-11-21 19:07 [alsa-devel] [PATCH 0/2] ASoC: Follow the recent ALSA core API changes Takashi Iwai
  2019-11-21 19:07 ` [alsa-devel] [PATCH 1/2] ASoC: pcm: Make ioctl ops optional Takashi Iwai
@ 2019-11-21 19:07 ` Takashi Iwai
  2019-11-22 13:34 ` [alsa-devel] [PATCH 0/2] ASoC: Follow the recent ALSA core API changes Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2019-11-21 19:07 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel

Add the support of the new PCM sync_stop ops in ASoC component.
It's optional and can be NULL unless you need the sync operation.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 include/sound/soc-component.h |  3 +++
 sound/soc/soc-component.c     | 19 +++++++++++++++++++
 sound/soc/soc-pcm.c           |  2 ++
 3 files changed, 24 insertions(+)

diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h
index 6aa3ecb7b6d3..d9dc8bcc96d0 100644
--- a/include/sound/soc-component.h
+++ b/include/sound/soc-component.h
@@ -88,6 +88,8 @@ struct snd_soc_component_driver {
 		       struct snd_pcm_substream *substream);
 	int (*trigger)(struct snd_soc_component *component,
 		       struct snd_pcm_substream *substream, int cmd);
+	int (*sync_stop)(struct snd_soc_component *component,
+			 struct snd_pcm_substream *substream);
 	snd_pcm_uframes_t (*pointer)(struct snd_soc_component *component,
 				     struct snd_pcm_substream *substream);
 	int (*get_time_info)(struct snd_soc_component *component,
@@ -405,6 +407,7 @@ int snd_soc_component_of_xlate_dai_name(struct snd_soc_component *component,
 int snd_soc_pcm_component_pointer(struct snd_pcm_substream *substream);
 int snd_soc_pcm_component_ioctl(struct snd_pcm_substream *substream,
 				unsigned int cmd, void *arg);
+int snd_soc_pcm_component_sync_stop(struct snd_pcm_substream *substream);
 int snd_soc_pcm_component_copy_user(struct snd_pcm_substream *substream,
 				    int channel, unsigned long pos,
 				    void __user *buf, unsigned long bytes);
diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c
index 98ef0666add2..58c1320a3521 100644
--- a/sound/soc/soc-component.c
+++ b/sound/soc/soc-component.c
@@ -444,6 +444,25 @@ int snd_soc_pcm_component_ioctl(struct snd_pcm_substream *substream,
 	return snd_pcm_lib_ioctl(substream, cmd, arg);
 }
 
+int snd_soc_pcm_component_sync_stop(struct snd_pcm_substream *substream)
+{
+	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_component *component;
+	struct snd_soc_rtdcom_list *rtdcom;
+	int ret;
+
+	for_each_rtd_components(rtd, rtdcom, component) {
+		if (component->driver->ioctl) {
+			ret = component->driver->sync_stop(component,
+							   substream);
+			if (ret < 0)
+				return ret;
+		}
+	}
+
+	return 0;
+}
+
 int snd_soc_pcm_component_copy_user(struct snd_pcm_substream *substream,
 				    int channel, unsigned long pos,
 				    void __user *buf, unsigned long bytes)
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 4dd13c9249ab..4457ac374a0e 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -3020,6 +3020,8 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
 
 		if (drv->ioctl)
 			rtd->ops.ioctl		= snd_soc_pcm_component_ioctl;
+		if (drv->sync_stop)
+			rtd->ops.sync_stop	= snd_soc_pcm_component_sync_stop;
 		if (drv->copy_user)
 			rtd->ops.copy_user	= snd_soc_pcm_component_copy_user;
 		if (drv->page)
-- 
2.16.4

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [alsa-devel] [PATCH 0/2] ASoC: Follow the recent ALSA core API changes
  2019-11-21 19:07 [alsa-devel] [PATCH 0/2] ASoC: Follow the recent ALSA core API changes Takashi Iwai
  2019-11-21 19:07 ` [alsa-devel] [PATCH 1/2] ASoC: pcm: Make ioctl ops optional Takashi Iwai
  2019-11-21 19:07 ` [alsa-devel] [PATCH 2/2] ASoC: component: Add sync_stop PCM ops Takashi Iwai
@ 2019-11-22 13:34 ` Mark Brown
  2019-11-22 13:41   ` Takashi Iwai
  2 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2019-11-22 13:34 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel


[-- Attachment #1.1: Type: text/plain, Size: 405 bytes --]

On Thu, Nov 21, 2019 at 08:07:07PM +0100, Takashi Iwai wrote:
> Hi,
> 
> this is a follow-up patch set for ASoC to adapt the recent ALSA PCM
> core changes.  It's merely a preliminary and this itself doesn't
> change the current driver behavior.  The purpose of this submission is
> to get the basic API changes done in 5.5-rc1, so that other trees can

Acked-by: Mark Brown <broonie@kernel.org>

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

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [alsa-devel] [PATCH 0/2] ASoC: Follow the recent ALSA core API changes
  2019-11-22 13:34 ` [alsa-devel] [PATCH 0/2] ASoC: Follow the recent ALSA core API changes Mark Brown
@ 2019-11-22 13:41   ` Takashi Iwai
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2019-11-22 13:41 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel

On Fri, 22 Nov 2019 14:34:32 +0100,
Mark Brown wrote:
> 
> On Thu, Nov 21, 2019 at 08:07:07PM +0100, Takashi Iwai wrote:
> > Hi,
> > 
> > this is a follow-up patch set for ASoC to adapt the recent ALSA PCM
> > core changes.  It's merely a preliminary and this itself doesn't
> > change the current driver behavior.  The purpose of this submission is
> > to get the basic API changes done in 5.5-rc1, so that other trees can
> 
> Acked-by: Mark Brown <broonie@kernel.org>

Thanks, now the patches are merged for 5.5-rc1.


Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

end of thread, other threads:[~2019-11-22 13:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-21 19:07 [alsa-devel] [PATCH 0/2] ASoC: Follow the recent ALSA core API changes Takashi Iwai
2019-11-21 19:07 ` [alsa-devel] [PATCH 1/2] ASoC: pcm: Make ioctl ops optional Takashi Iwai
2019-11-21 19:07 ` [alsa-devel] [PATCH 2/2] ASoC: component: Add sync_stop PCM ops Takashi Iwai
2019-11-22 13:34 ` [alsa-devel] [PATCH 0/2] ASoC: Follow the recent ALSA core API changes Mark Brown
2019-11-22 13:41   ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).