aboutsummaryrefslogtreecommitdiffstats
path: root/alsa-pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'alsa-pcm.c')
-rw-r--r--alsa-pcm.c34
1 files changed, 10 insertions, 24 deletions
diff --git a/alsa-pcm.c b/alsa-pcm.c
index 9e3471b..9b55a14 100644
--- a/alsa-pcm.c
+++ b/alsa-pcm.c
@@ -22,12 +22,19 @@
} \
} while (0)
+/*******************************************************************************
+ * ALSA PCM Callbacks
+ ******************************************************************************/
/**
- * configure_pcm - set up substream properties from user configuration
+ * pcm_open - Implements 'open' callback for PCM middle layer
* @substream: pointer to ALSA PCM substream
- * @return 0 on success or error code otherwise
+ *
+ * This is called when an ALSA PCM substream is opened. The substream device is
+ * configured here.
+ *
+ * Returns 0 on success or error code otherwise.
*/
-static int configure_pcm(struct snd_pcm_substream *substream)
+static int pcm_open(struct snd_pcm_substream *substream)
{
struct avirt_alsa_devconfig *config;
struct avirt_audiopath *audiopath;
@@ -74,27 +81,6 @@ static int configure_pcm(struct snd_pcm_substream *substream)
hw->period_bytes_min = blocksize * bytes_per_sample * config->channels;
hw->period_bytes_max = blocksize * bytes_per_sample * config->channels;
- return 0;
-}
-
-/*******************************************************************************
- * ALSA PCM Callbacks
- ******************************************************************************/
-/**
- * pcm_open - Implements 'open' callback for PCM middle layer
- * @substream: pointer to ALSA PCM substream
- *
- * This is called when an ALSA PCM substream is opened. The substream device is
- * configured here.
- *
- * Returns 0 on success or error code otherwise.
- */
-static int pcm_open(struct snd_pcm_substream *substream)
-{
- DINFO(AP_LOGNAME, "");
- // Setup the pcm device based on the configuration assigned
- CHK_ERR_V(configure_pcm(substream), "Failed to setup pcm device");
-
// Do additional Audio Path 'open' callback
DO_AUDIOPATH_CB(open, substream);