All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] ALSA: HDA: add stream params to hda core
@ 2015-04-17 12:28 Vinod Koul
  2015-04-17 12:28 ` [PATCH v3 1/2] ALSA: hda - add ASoC device type for " Vinod Koul
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vinod Koul @ 2015-04-17 12:28 UTC (permalink / raw)
  To: alsa-devel; +Cc: liam.r.girdwood, tiwai, broonie, Vinod Koul, patches.audio

This two patches are splut form the series v2 as they are specfic to HDAC.
First adds ASoC device type later to be used by ASOC driver and second for
the stream params.

Jeeja KP (1):
  ALSA: hda - add generic functions to set hdac stream params

Ramesh Babu (1):
  ALSA: hda - add ASoC device type for hda core

 include/sound/hdaudio.h |    3 +++
 sound/hda/hdac_stream.c |   38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+)

-- 
1.7.9.5

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

* [PATCH v3 1/2] ALSA: hda - add ASoC device type for hda core
  2015-04-17 12:28 [PATCH v3 0/2] ALSA: HDA: add stream params to hda core Vinod Koul
@ 2015-04-17 12:28 ` Vinod Koul
  2015-04-17 12:28 ` [PATCH v3 2/2] ALSA: hda - add generic functions to set hdac stream params Vinod Koul
  2015-04-17 12:39 ` [PATCH v3 0/2] ALSA: HDA: add stream params to hda core Takashi Iwai
  2 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2015-04-17 12:28 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, Ramesh Babu, patches.audio, liam.r.girdwood, Vinod Koul, broonie

From: Ramesh Babu <ramesh.babu@intel.com>

Add HDA_DEV_ASOC device/driver type to support
ASoC HDA drivers.

Signed-off-by: Ramesh Babu <ramesh.babu@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 include/sound/hdaudio.h |    1 +
 1 file changed, 1 insertion(+)

diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h
index dbeb195eb4e8..d05931fc6f28 100644
--- a/include/sound/hdaudio.h
+++ b/include/sound/hdaudio.h
@@ -90,6 +90,7 @@ struct hdac_device {
 enum {
 	HDA_DEV_CORE,
 	HDA_DEV_LEGACY,
+	HDA_DEV_ASOC,
 };
 
 /* direction */
-- 
1.7.9.5

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

* [PATCH v3 2/2] ALSA: hda - add generic functions to set hdac stream params
  2015-04-17 12:28 [PATCH v3 0/2] ALSA: HDA: add stream params to hda core Vinod Koul
  2015-04-17 12:28 ` [PATCH v3 1/2] ALSA: hda - add ASoC device type for " Vinod Koul
@ 2015-04-17 12:28 ` Vinod Koul
  2015-04-17 12:39 ` [PATCH v3 0/2] ALSA: HDA: add stream params to hda core Takashi Iwai
  2 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2015-04-17 12:28 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, liam.r.girdwood, patches.audio, broonie, Jeeja KP,
	Vinod Koul, Subhransu S. Prusty

From: Jeeja KP <jeeja.kp@intel.com>

This will be used by hda controller driver to
setup stream params in prepare. This function will
setup the bdl and periods.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 include/sound/hdaudio.h |    2 ++
 sound/hda/hdac_stream.c |   38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h
index d05931fc6f28..6a2e030c836c 100644
--- a/include/sound/hdaudio.h
+++ b/include/sound/hdaudio.h
@@ -418,6 +418,8 @@ void snd_hdac_stream_release(struct hdac_stream *azx_dev);
 int snd_hdac_stream_setup(struct hdac_stream *azx_dev);
 void snd_hdac_stream_cleanup(struct hdac_stream *azx_dev);
 int snd_hdac_stream_setup_periods(struct hdac_stream *azx_dev);
+int snd_hdac_stream_set_params(struct hdac_stream *azx_dev,
+				unsigned int format_val);
 void snd_hdac_stream_start(struct hdac_stream *azx_dev, bool fresh_start);
 void snd_hdac_stream_clear(struct hdac_stream *azx_dev);
 void snd_hdac_stream_stop(struct hdac_stream *azx_dev);
diff --git a/sound/hda/hdac_stream.c b/sound/hda/hdac_stream.c
index 9ffff6d9ba8e..1ba0462ef7ca 100644
--- a/sound/hda/hdac_stream.c
+++ b/sound/hda/hdac_stream.c
@@ -394,6 +394,44 @@ int snd_hdac_stream_setup_periods(struct hdac_stream *azx_dev)
 }
 EXPORT_SYMBOL_GPL(snd_hdac_stream_setup_periods);
 
+/* snd_hdac_stream_set_params - set stream parameters
+ * @azx_dev: HD-audio core stream for which parameters are to be set
+ * @format_val: format value parameter
+ *
+ * Setup the HD-audio core stream parameters from substream of the stream
+ * and passed format value
+ */
+int snd_hdac_stream_set_params(struct hdac_stream *azx_dev,
+				 unsigned int format_val)
+{
+
+	unsigned int bufsize, period_bytes;
+	struct snd_pcm_substream *substream = azx_dev->substream;
+	struct snd_pcm_runtime *runtime;
+	int err;
+
+	if (!substream)
+		return -EINVAL;
+	runtime = substream->runtime;
+	bufsize = snd_pcm_lib_buffer_bytes(substream);
+	period_bytes = snd_pcm_lib_period_bytes(substream);
+
+	if (bufsize != azx_dev->bufsize ||
+	    period_bytes != azx_dev->period_bytes ||
+	    format_val != azx_dev->format_val ||
+	    runtime->no_period_wakeup != azx_dev->no_period_wakeup) {
+		azx_dev->bufsize = bufsize;
+		azx_dev->period_bytes = period_bytes;
+		azx_dev->format_val = format_val;
+		azx_dev->no_period_wakeup = runtime->no_period_wakeup;
+		err = snd_hdac_stream_setup_periods(azx_dev);
+		if (err < 0)
+			return err;
+	}
+	return 0;
+}
+EXPORT_SYMBOL_GPL(snd_hdac_stream_set_params);
+
 static cycle_t azx_cc_read(const struct cyclecounter *cc)
 {
 	struct hdac_stream *azx_dev = container_of(cc, struct hdac_stream, cc);
-- 
1.7.9.5

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

* Re: [PATCH v3 0/2] ALSA: HDA: add stream params to hda core
  2015-04-17 12:28 [PATCH v3 0/2] ALSA: HDA: add stream params to hda core Vinod Koul
  2015-04-17 12:28 ` [PATCH v3 1/2] ALSA: hda - add ASoC device type for " Vinod Koul
  2015-04-17 12:28 ` [PATCH v3 2/2] ALSA: hda - add generic functions to set hdac stream params Vinod Koul
@ 2015-04-17 12:39 ` Takashi Iwai
  2 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2015-04-17 12:39 UTC (permalink / raw)
  To: Vinod Koul; +Cc: liam.r.girdwood, patches.audio, alsa-devel, broonie

At Fri, 17 Apr 2015 17:58:56 +0530,
Vinod Koul wrote:
> 
> This two patches are splut form the series v2 as they are specfic to HDAC.
> First adds ASoC device type later to be used by ASOC driver and second for
> the stream params.
> 
> Jeeja KP (1):
>   ALSA: hda - add generic functions to set hdac stream params
> 
> Ramesh Babu (1):
>   ALSA: hda - add ASoC device type for hda core

Applied both now.  Thanks.


Takashi

> 
>  include/sound/hdaudio.h |    3 +++
>  sound/hda/hdac_stream.c |   38 ++++++++++++++++++++++++++++++++++++++
>  2 files changed, 41 insertions(+)
> 
> -- 
> 1.7.9.5
> 

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

end of thread, other threads:[~2015-04-17 12:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-17 12:28 [PATCH v3 0/2] ALSA: HDA: add stream params to hda core Vinod Koul
2015-04-17 12:28 ` [PATCH v3 1/2] ALSA: hda - add ASoC device type for " Vinod Koul
2015-04-17 12:28 ` [PATCH v3 2/2] ALSA: hda - add generic functions to set hdac stream params Vinod Koul
2015-04-17 12:39 ` [PATCH v3 0/2] ALSA: HDA: add stream params to hda core Takashi Iwai

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.