Loading include/sound/pcm.h +3 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,9 @@ struct snd_pcm_ops { struct timespec *system_ts, struct timespec *audio_ts, struct snd_pcm_audio_tstamp_config *audio_tstamp_config, struct snd_pcm_audio_tstamp_report *audio_tstamp_report); int (*delay_blk)(struct snd_pcm_substream *substream); int (*wall_clock)(struct snd_pcm_substream *substream, struct timespec *audio_ts); int (*fill_silence)(struct snd_pcm_substream *substream, int channel, unsigned long pos, unsigned long bytes); int (*copy_user)(struct snd_pcm_substream *substream, int channel, Loading include/sound/soc.h +10 −0 Original line number Diff line number Diff line Loading @@ -807,6 +807,16 @@ struct snd_soc_component_driver { int (*set_bias_level)(struct snd_soc_component *component, enum snd_soc_bias_level level); /* * For platform-caused delay reporting, where the thread blocks waiting * for the delay amount to be determined. Defining this will cause the * ASoC core to skip calling the delay callbacks for all components in * the runtime. * Optional. */ snd_pcm_sframes_t (*delay_blk)(struct snd_pcm_substream *substream, struct snd_soc_dai *dai); const struct snd_pcm_ops *ops; const struct snd_compr_ops *compr_ops; Loading sound/soc/soc-pcm.c +25 −0 Original line number Diff line number Diff line Loading @@ -1271,6 +1271,9 @@ static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream) /* FIXME: use 1st pointer */ offset = component->driver->ops->pointer(substream); if (component->driver->delay_blk) return offset; break; } /* base delay if assigned in pointer callback */ Loading @@ -1293,6 +1296,26 @@ static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream) return offset; } static int soc_pcm_delay_blk(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; struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_sframes_t delay = 0; for_each_rtdcom(rtd, rtdcom) { component = rtdcom->component; if (component->driver->delay_blk) delay = component->driver->delay_blk(substream, rtd->codec_dais[0]); } runtime->delay = delay; return 0; } /* connect a FE and BE */ static int dpcm_be_connect(struct snd_soc_pcm_runtime *fe, struct snd_soc_pcm_runtime *be, int stream) Loading Loading @@ -3233,6 +3256,7 @@ 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.delay_blk = soc_pcm_delay_blk; rtd->ops.ioctl = soc_pcm_ioctl; rtd->ops.compat_ioctl = soc_pcm_compat_ioctl; } else { Loading @@ -3243,6 +3267,7 @@ 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.delay_blk = soc_pcm_delay_blk; rtd->ops.ioctl = soc_pcm_ioctl; rtd->ops.compat_ioctl = soc_pcm_compat_ioctl; } Loading Loading
include/sound/pcm.h +3 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,9 @@ struct snd_pcm_ops { struct timespec *system_ts, struct timespec *audio_ts, struct snd_pcm_audio_tstamp_config *audio_tstamp_config, struct snd_pcm_audio_tstamp_report *audio_tstamp_report); int (*delay_blk)(struct snd_pcm_substream *substream); int (*wall_clock)(struct snd_pcm_substream *substream, struct timespec *audio_ts); int (*fill_silence)(struct snd_pcm_substream *substream, int channel, unsigned long pos, unsigned long bytes); int (*copy_user)(struct snd_pcm_substream *substream, int channel, Loading
include/sound/soc.h +10 −0 Original line number Diff line number Diff line Loading @@ -807,6 +807,16 @@ struct snd_soc_component_driver { int (*set_bias_level)(struct snd_soc_component *component, enum snd_soc_bias_level level); /* * For platform-caused delay reporting, where the thread blocks waiting * for the delay amount to be determined. Defining this will cause the * ASoC core to skip calling the delay callbacks for all components in * the runtime. * Optional. */ snd_pcm_sframes_t (*delay_blk)(struct snd_pcm_substream *substream, struct snd_soc_dai *dai); const struct snd_pcm_ops *ops; const struct snd_compr_ops *compr_ops; Loading
sound/soc/soc-pcm.c +25 −0 Original line number Diff line number Diff line Loading @@ -1271,6 +1271,9 @@ static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream) /* FIXME: use 1st pointer */ offset = component->driver->ops->pointer(substream); if (component->driver->delay_blk) return offset; break; } /* base delay if assigned in pointer callback */ Loading @@ -1293,6 +1296,26 @@ static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream) return offset; } static int soc_pcm_delay_blk(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; struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_sframes_t delay = 0; for_each_rtdcom(rtd, rtdcom) { component = rtdcom->component; if (component->driver->delay_blk) delay = component->driver->delay_blk(substream, rtd->codec_dais[0]); } runtime->delay = delay; return 0; } /* connect a FE and BE */ static int dpcm_be_connect(struct snd_soc_pcm_runtime *fe, struct snd_soc_pcm_runtime *be, int stream) Loading Loading @@ -3233,6 +3256,7 @@ 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.delay_blk = soc_pcm_delay_blk; rtd->ops.ioctl = soc_pcm_ioctl; rtd->ops.compat_ioctl = soc_pcm_compat_ioctl; } else { Loading @@ -3243,6 +3267,7 @@ 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.delay_blk = soc_pcm_delay_blk; rtd->ops.ioctl = soc_pcm_ioctl; rtd->ops.compat_ioctl = soc_pcm_compat_ioctl; } Loading