Lines Matching full:dai
3 * linux/sound/soc-dai.h -- ALSA SoC Layer
7 * Digital Audio Interface (DAI) API.
22 * DAI hardware audio formats.
56 * DAI Clock gating.
58 * DAI bit clocks can be gated (disabled) when the DAI is not
76 * DAI hardware signal polarity.
78 * Specifies whether the DAI can also support inverted clocks for the specified
110 * DAI hardware clock providers/consumers
171 int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id,
174 int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai,
177 int snd_soc_dai_set_pll(struct snd_soc_dai *dai,
180 int snd_soc_dai_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio);
184 u64 snd_soc_dai_get_fmt(struct snd_soc_dai *dai, int priority);
185 int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt);
187 int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai,
190 int snd_soc_dai_set_channel_map(struct snd_soc_dai *dai,
194 int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate);
197 int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute,
201 int snd_soc_dai_get_channel_map(struct snd_soc_dai *dai,
205 int snd_soc_dai_is_dummy(struct snd_soc_dai *dai);
207 int snd_soc_dai_hw_params(struct snd_soc_dai *dai,
210 void snd_soc_dai_hw_free(struct snd_soc_dai *dai,
213 int snd_soc_dai_startup(struct snd_soc_dai *dai,
215 void snd_soc_dai_shutdown(struct snd_soc_dai *dai,
217 void snd_soc_dai_suspend(struct snd_soc_dai *dai);
218 void snd_soc_dai_resume(struct snd_soc_dai *dai);
219 int snd_soc_dai_compress_new(struct snd_soc_dai *dai,
221 bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int stream);
223 void snd_soc_dai_action(struct snd_soc_dai *dai,
225 static inline void snd_soc_dai_activate(struct snd_soc_dai *dai, in snd_soc_dai_activate() argument
228 snd_soc_dai_action(dai, stream, 1); in snd_soc_dai_activate()
230 static inline void snd_soc_dai_deactivate(struct snd_soc_dai *dai, in snd_soc_dai_deactivate() argument
233 snd_soc_dai_action(dai, stream, -1); in snd_soc_dai_deactivate()
235 int snd_soc_dai_active(struct snd_soc_dai *dai);
248 int snd_soc_dai_compr_startup(struct snd_soc_dai *dai,
250 void snd_soc_dai_compr_shutdown(struct snd_soc_dai *dai,
253 int snd_soc_dai_compr_trigger(struct snd_soc_dai *dai,
255 int snd_soc_dai_compr_set_params(struct snd_soc_dai *dai,
258 int snd_soc_dai_compr_get_params(struct snd_soc_dai *dai,
261 int snd_soc_dai_compr_ack(struct snd_soc_dai *dai,
264 int snd_soc_dai_compr_pointer(struct snd_soc_dai *dai,
267 int snd_soc_dai_compr_set_metadata(struct snd_soc_dai *dai,
270 int snd_soc_dai_compr_get_metadata(struct snd_soc_dai *dai,
274 const char *snd_soc_dai_name_get(struct snd_soc_dai *dai);
277 /* DAI driver callbacks */
278 int (*probe)(struct snd_soc_dai *dai);
279 int (*remove)(struct snd_soc_dai *dai);
280 /* compress dai */
284 struct snd_soc_dai *dai);
287 * DAI clocking configuration, all optional.
290 int (*set_sysclk)(struct snd_soc_dai *dai,
292 int (*set_pll)(struct snd_soc_dai *dai, int pll_id, int source,
294 int (*set_clkdiv)(struct snd_soc_dai *dai, int div_id, int div);
295 int (*set_bclk_ratio)(struct snd_soc_dai *dai, unsigned int ratio);
298 * DAI format configuration
301 int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt);
304 int (*set_tdm_slot)(struct snd_soc_dai *dai,
307 int (*set_channel_map)(struct snd_soc_dai *dai,
310 int (*get_channel_map)(struct snd_soc_dai *dai,
313 int (*set_tristate)(struct snd_soc_dai *dai, int tristate);
315 int (*set_stream)(struct snd_soc_dai *dai,
317 void *(*get_stream)(struct snd_soc_dai *dai, int direction);
320 * DAI digital mute - optional.
323 int (*mute_stream)(struct snd_soc_dai *dai, int mute, int stream);
341 * compatible with the current state of the dai. For example this
403 * Describes the Digital Audio Interface in terms of its ALSA, DAI and AC97
405 * structure for every DAI they have.
411 /* DAI description */
422 /* DAI capabilities */
437 void *dma_data; /* DAI DMA data */
443 * Holds runtime data for a DAI.
453 /* DAI runtime info */
477 snd_soc_dai_get_pcm_stream(const struct snd_soc_dai *dai, int stream) in snd_soc_dai_get_pcm_stream() argument
480 &dai->driver->playback : &dai->driver->capture; in snd_soc_dai_get_pcm_stream()
483 #define snd_soc_dai_get_widget_playback(dai) snd_soc_dai_get_widget(dai, SNDRV_PCM_STREAM_PLAYBACK) argument
484 #define snd_soc_dai_get_widget_capture(dai) snd_soc_dai_get_widget(dai, SNDRV_PCM_STREAM_CAPTURE) argument
486 struct snd_soc_dapm_widget *snd_soc_dai_get_widget(struct snd_soc_dai *dai, int stream) in snd_soc_dai_get_widget() argument
488 return dai->stream[stream].widget; in snd_soc_dai_get_widget()
491 #define snd_soc_dai_set_widget_playback(dai, widget) snd_soc_dai_set_widget(dai, SNDRV_PCM_STREAM_P… argument
492 #define snd_soc_dai_set_widget_capture(dai, widget) snd_soc_dai_set_widget(dai, SNDRV_PCM_STREAM_C… argument
494 void snd_soc_dai_set_widget(struct snd_soc_dai *dai, int stream, struct snd_soc_dapm_widget *widget) in snd_soc_dai_set_widget() argument
496 dai->stream[stream].widget = widget; in snd_soc_dai_set_widget()
499 #define snd_soc_dai_dma_data_get_playback(dai) snd_soc_dai_dma_data_get(dai, SNDRV_PCM_STREAM_PLAYB… argument
500 #define snd_soc_dai_dma_data_get_capture(dai) snd_soc_dai_dma_data_get(dai, SNDRV_PCM_STREAM_CAPTUR… argument
501 #define snd_soc_dai_get_dma_data(dai, ss) snd_soc_dai_dma_data_get(dai, ss->stream) argument
502 static inline void *snd_soc_dai_dma_data_get(const struct snd_soc_dai *dai, int stream) in snd_soc_dai_dma_data_get() argument
504 return dai->stream[stream].dma_data; in snd_soc_dai_dma_data_get()
507 #define snd_soc_dai_dma_data_set_playback(dai, data) snd_soc_dai_dma_data_set(dai, SNDRV_PCM_STREAM… argument
508 #define snd_soc_dai_dma_data_set_capture(dai, data) snd_soc_dai_dma_data_set(dai, SNDRV_PCM_STREAM… argument
509 #define snd_soc_dai_set_dma_data(dai, ss, data) snd_soc_dai_dma_data_set(dai, ss->stream, data) argument
510 static inline void snd_soc_dai_dma_data_set(struct snd_soc_dai *dai, int stream, void *data) in snd_soc_dai_dma_data_set() argument
512 dai->stream[stream].dma_data = data; in snd_soc_dai_dma_data_set()
515 static inline void snd_soc_dai_init_dma_data(struct snd_soc_dai *dai, void *playback, void *capture) in snd_soc_dai_init_dma_data() argument
517 snd_soc_dai_dma_data_set_playback(dai, playback); in snd_soc_dai_init_dma_data()
518 snd_soc_dai_dma_data_set_capture(dai, capture); in snd_soc_dai_init_dma_data()
521 static inline unsigned int snd_soc_dai_tdm_mask_get(struct snd_soc_dai *dai, int stream) in snd_soc_dai_tdm_mask_get() argument
523 return dai->stream[stream].tdm_mask; in snd_soc_dai_tdm_mask_get()
526 static inline void snd_soc_dai_tdm_mask_set(struct snd_soc_dai *dai, int stream, in snd_soc_dai_tdm_mask_set() argument
529 dai->stream[stream].tdm_mask = tdm_mask; in snd_soc_dai_tdm_mask_set()
532 static inline unsigned int snd_soc_dai_stream_active(struct snd_soc_dai *dai, int stream) in snd_soc_dai_stream_active() argument
535 return dai->stream[stream].active; in snd_soc_dai_stream_active()
538 static inline void snd_soc_dai_set_drvdata(struct snd_soc_dai *dai, in snd_soc_dai_set_drvdata() argument
541 dev_set_drvdata(dai->dev, data); in snd_soc_dai_set_drvdata()
544 static inline void *snd_soc_dai_get_drvdata(struct snd_soc_dai *dai) in snd_soc_dai_get_drvdata() argument
546 return dev_get_drvdata(dai->dev); in snd_soc_dai_get_drvdata()
550 * snd_soc_dai_set_stream() - Configures a DAI for stream operation
551 * @dai: DAI
552 * @stream: STREAM (opaque structure depending on DAI type)
561 static inline int snd_soc_dai_set_stream(struct snd_soc_dai *dai, in snd_soc_dai_set_stream() argument
564 if (dai->driver->ops->set_stream) in snd_soc_dai_set_stream()
565 return dai->driver->ops->set_stream(dai, stream, direction); in snd_soc_dai_set_stream()
571 * snd_soc_dai_get_stream() - Retrieves stream from DAI
572 * @dai: DAI
581 static inline void *snd_soc_dai_get_stream(struct snd_soc_dai *dai, in snd_soc_dai_get_stream() argument
584 if (dai->driver->ops->get_stream) in snd_soc_dai_get_stream()
585 return dai->driver->ops->get_stream(dai, direction); in snd_soc_dai_get_stream()