blob: a4317144ab627d652296e963b82c2718580e736f [file] [log] [blame]
Kuninori Morimoto4ff1fef2019-07-26 13:49:48 +09001/* SPDX-License-Identifier: GPL-2.0
2 *
3 * soc-component.h
4 *
Kuninori Morimoto45108212020-06-04 17:08:24 +09005 * Copyright (C) 2019 Renesas Electronics Corp.
6 * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Kuninori Morimoto4ff1fef2019-07-26 13:49:48 +09007 */
8#ifndef __SOC_COMPONENT_H
9#define __SOC_COMPONENT_H
10
11#include <sound/soc.h>
12
13/*
14 * Component probe and remove ordering levels for components with runtime
15 * dependencies.
16 */
17#define SND_SOC_COMP_ORDER_FIRST -2
18#define SND_SOC_COMP_ORDER_EARLY -1
19#define SND_SOC_COMP_ORDER_NORMAL 0
20#define SND_SOC_COMP_ORDER_LATE 1
21#define SND_SOC_COMP_ORDER_LAST 2
22
23#define for_each_comp_order(order) \
24 for (order = SND_SOC_COMP_ORDER_FIRST; \
25 order <= SND_SOC_COMP_ORDER_LAST; \
26 order++)
27
28/* component interface */
Kuninori Morimotoc6cb5222020-04-20 16:07:50 +090029struct snd_compress_ops {
30 int (*open)(struct snd_soc_component *component,
31 struct snd_compr_stream *stream);
32 int (*free)(struct snd_soc_component *component,
33 struct snd_compr_stream *stream);
34 int (*set_params)(struct snd_soc_component *component,
35 struct snd_compr_stream *stream,
36 struct snd_compr_params *params);
37 int (*get_params)(struct snd_soc_component *component,
38 struct snd_compr_stream *stream,
39 struct snd_codec *params);
40 int (*set_metadata)(struct snd_soc_component *component,
41 struct snd_compr_stream *stream,
42 struct snd_compr_metadata *metadata);
43 int (*get_metadata)(struct snd_soc_component *component,
44 struct snd_compr_stream *stream,
45 struct snd_compr_metadata *metadata);
46 int (*trigger)(struct snd_soc_component *component,
47 struct snd_compr_stream *stream, int cmd);
48 int (*pointer)(struct snd_soc_component *component,
49 struct snd_compr_stream *stream,
50 struct snd_compr_tstamp *tstamp);
51 int (*copy)(struct snd_soc_component *component,
52 struct snd_compr_stream *stream, char __user *buf,
53 size_t count);
54 int (*mmap)(struct snd_soc_component *component,
55 struct snd_compr_stream *stream,
56 struct vm_area_struct *vma);
57 int (*ack)(struct snd_soc_component *component,
58 struct snd_compr_stream *stream, size_t bytes);
59 int (*get_caps)(struct snd_soc_component *component,
60 struct snd_compr_stream *stream,
61 struct snd_compr_caps *caps);
62 int (*get_codec_caps)(struct snd_soc_component *component,
63 struct snd_compr_stream *stream,
64 struct snd_compr_codec_caps *codec);
65};
66
Kuninori Morimoto4ff1fef2019-07-26 13:49:48 +090067struct snd_soc_component_driver {
68 const char *name;
69
70 /* Default control and setup, added after probe() is run */
71 const struct snd_kcontrol_new *controls;
72 unsigned int num_controls;
73 const struct snd_soc_dapm_widget *dapm_widgets;
74 unsigned int num_dapm_widgets;
75 const struct snd_soc_dapm_route *dapm_routes;
76 unsigned int num_dapm_routes;
77
78 int (*probe)(struct snd_soc_component *component);
79 void (*remove)(struct snd_soc_component *component);
80 int (*suspend)(struct snd_soc_component *component);
81 int (*resume)(struct snd_soc_component *component);
82
83 unsigned int (*read)(struct snd_soc_component *component,
84 unsigned int reg);
85 int (*write)(struct snd_soc_component *component,
86 unsigned int reg, unsigned int val);
87
88 /* pcm creation and destruction */
Kuninori Morimotoc64bfc92019-10-02 14:30:59 +090089 int (*pcm_construct)(struct snd_soc_component *component,
90 struct snd_soc_pcm_runtime *rtd);
91 void (*pcm_destruct)(struct snd_soc_component *component,
92 struct snd_pcm *pcm);
93
Kuninori Morimoto4ff1fef2019-07-26 13:49:48 +090094 /* component wide operations */
95 int (*set_sysclk)(struct snd_soc_component *component,
96 int clk_id, int source, unsigned int freq, int dir);
97 int (*set_pll)(struct snd_soc_component *component, int pll_id,
98 int source, unsigned int freq_in, unsigned int freq_out);
99 int (*set_jack)(struct snd_soc_component *component,
100 struct snd_soc_jack *jack, void *data);
101
102 /* DT */
103 int (*of_xlate_dai_name)(struct snd_soc_component *component,
Krzysztof Kozlowski933f98b2021-02-21 16:30:24 +0100104 const struct of_phandle_args *args,
Kuninori Morimoto4ff1fef2019-07-26 13:49:48 +0900105 const char **dai_name);
106 int (*of_xlate_dai_id)(struct snd_soc_component *comment,
107 struct device_node *endpoint);
108 void (*seq_notifier)(struct snd_soc_component *component,
109 enum snd_soc_dapm_type type, int subseq);
110 int (*stream_event)(struct snd_soc_component *component, int event);
111 int (*set_bias_level)(struct snd_soc_component *component,
112 enum snd_soc_bias_level level);
113
Kuninori Morimotoe2cb4a12019-10-02 14:30:48 +0900114 int (*open)(struct snd_soc_component *component,
115 struct snd_pcm_substream *substream);
116 int (*close)(struct snd_soc_component *component,
117 struct snd_pcm_substream *substream);
118 int (*ioctl)(struct snd_soc_component *component,
119 struct snd_pcm_substream *substream,
120 unsigned int cmd, void *arg);
121 int (*hw_params)(struct snd_soc_component *component,
122 struct snd_pcm_substream *substream,
123 struct snd_pcm_hw_params *params);
124 int (*hw_free)(struct snd_soc_component *component,
125 struct snd_pcm_substream *substream);
126 int (*prepare)(struct snd_soc_component *component,
127 struct snd_pcm_substream *substream);
128 int (*trigger)(struct snd_soc_component *component,
129 struct snd_pcm_substream *substream, int cmd);
Takashi Iwai1e5ddb62019-11-21 20:07:09 +0100130 int (*sync_stop)(struct snd_soc_component *component,
131 struct snd_pcm_substream *substream);
Kuninori Morimotoe2cb4a12019-10-02 14:30:48 +0900132 snd_pcm_uframes_t (*pointer)(struct snd_soc_component *component,
133 struct snd_pcm_substream *substream);
134 int (*get_time_info)(struct snd_soc_component *component,
Baolin Wangfcae40c2018-04-24 20:06:08 +0800135 struct snd_pcm_substream *substream, struct timespec64 *system_ts,
136 struct timespec64 *audio_ts,
Kuninori Morimotoe2cb4a12019-10-02 14:30:48 +0900137 struct snd_pcm_audio_tstamp_config *audio_tstamp_config,
138 struct snd_pcm_audio_tstamp_report *audio_tstamp_report);
139 int (*copy_user)(struct snd_soc_component *component,
140 struct snd_pcm_substream *substream, int channel,
141 unsigned long pos, void __user *buf,
142 unsigned long bytes);
143 struct page *(*page)(struct snd_soc_component *component,
144 struct snd_pcm_substream *substream,
145 unsigned long offset);
146 int (*mmap)(struct snd_soc_component *component,
147 struct snd_pcm_substream *substream,
148 struct vm_area_struct *vma);
Shengjiu Wang8bdfc042021-03-12 10:38:40 +0800149 int (*ack)(struct snd_soc_component *component,
150 struct snd_pcm_substream *substream);
Kuninori Morimotoe2cb4a12019-10-02 14:30:48 +0900151
Kuninori Morimotoc6cb5222020-04-20 16:07:50 +0900152 const struct snd_compress_ops *compress_ops;
Kuninori Morimoto4ff1fef2019-07-26 13:49:48 +0900153
154 /* probe ordering - for components with runtime dependencies */
155 int probe_order;
156 int remove_order;
157
158 /*
159 * signal if the module handling the component should not be removed
160 * if a pcm is open. Setting this would prevent the module
161 * refcount being incremented in probe() but allow it be incremented
162 * when a pcm is opened and decremented when it is closed.
163 */
164 unsigned int module_get_upon_open:1;
165
166 /* bits */
167 unsigned int idle_bias_on:1;
168 unsigned int suspend_bias_off:1;
169 unsigned int use_pmdown_time:1; /* care pmdown_time at stop */
170 unsigned int endianness:1;
171 unsigned int non_legacy_dai_naming:1;
172
173 /* this component uses topology and ignore machine driver FEs */
174 const char *ignore_machine;
175 const char *topology_name_prefix;
176 int (*be_hw_params_fixup)(struct snd_soc_pcm_runtime *rtd,
177 struct snd_pcm_hw_params *params);
178 bool use_dai_pcm_id; /* use DAI link PCM ID as PCM device number */
179 int be_pcm_base; /* base device ID for all BE PCMs */
180};
181
182struct snd_soc_component {
183 const char *name;
184 int id;
185 const char *name_prefix;
186 struct device *dev;
187 struct snd_soc_card *card;
188
189 unsigned int active;
190
191 unsigned int suspended:1; /* is in suspend PM state */
192
193 struct list_head list;
194 struct list_head card_aux_list; /* for auxiliary bound components */
195 struct list_head card_list;
196
197 const struct snd_soc_component_driver *driver;
198
199 struct list_head dai_list;
200 int num_dai;
201
202 struct regmap *regmap;
203 int val_bytes;
204
205 struct mutex io_mutex;
206
207 /* attached dynamic objects */
208 struct list_head dobj_list;
209
210 /*
211 * DO NOT use any of the fields below in drivers, they are temporary and
212 * are going to be removed again soon. If you use them in driver code
213 * the driver will be marked as BROKEN when these fields are removed.
214 */
215
216 /* Don't use these, use snd_soc_component_get_dapm() */
217 struct snd_soc_dapm_context dapm;
218
219 /* machine specific init */
220 int (*init)(struct snd_soc_component *component);
221
Kuninori Morimoto51aff912020-09-28 09:01:04 +0900222 /* function mark */
Peter Ujfalusia739fdc2021-09-01 12:52:54 +0300223 void *mark_module;
Kuninori Morimoto51aff912020-09-28 09:01:04 +0900224 struct snd_pcm_substream *mark_open;
Kuninori Morimoto3a36a642020-09-29 13:31:41 +0900225 struct snd_pcm_substream *mark_hw_params;
Kuninori Morimoto6374f492020-12-01 08:51:33 +0900226 struct snd_pcm_substream *mark_trigger;
Kuninori Morimotof94ba9a2020-11-19 08:50:09 +0900227 struct snd_compr_stream *mark_compr_open;
Kuninori Morimoto939a5cf2020-09-28 09:01:17 +0900228 void *mark_pm;
Kuninori Morimoto51aff912020-09-28 09:01:04 +0900229
Kuninori Morimoto4ff1fef2019-07-26 13:49:48 +0900230 struct dentry *debugfs_root;
231 const char *debugfs_prefix;
Kuninori Morimoto4ff1fef2019-07-26 13:49:48 +0900232};
233
234#define for_each_component_dais(component, dai)\
235 list_for_each_entry(dai, &(component)->dai_list, list)
236#define for_each_component_dais_safe(component, dai, _dai)\
237 list_for_each_entry_safe(dai, _dai, &(component)->dai_list, list)
238
239/**
240 * snd_soc_dapm_to_component() - Casts a DAPM context to the component it is
241 * embedded in
242 * @dapm: The DAPM context to cast to the component
243 *
244 * This function must only be used on DAPM contexts that are known to be part of
245 * a component (e.g. in a component driver). Otherwise the behavior is
246 * undefined.
247 */
248static inline struct snd_soc_component *snd_soc_dapm_to_component(
249 struct snd_soc_dapm_context *dapm)
250{
251 return container_of(dapm, struct snd_soc_component, dapm);
252}
253
254/**
255 * snd_soc_component_get_dapm() - Returns the DAPM context associated with a
256 * component
257 * @component: The component for which to get the DAPM context
258 */
259static inline struct snd_soc_dapm_context *snd_soc_component_get_dapm(
260 struct snd_soc_component *component)
261{
262 return &component->dapm;
263}
264
265/**
266 * snd_soc_component_init_bias_level() - Initialize COMPONENT DAPM bias level
267 * @component: The COMPONENT for which to initialize the DAPM bias level
268 * @level: The DAPM level to initialize to
269 *
270 * Initializes the COMPONENT DAPM bias level. See snd_soc_dapm_init_bias_level()
271 */
272static inline void
273snd_soc_component_init_bias_level(struct snd_soc_component *component,
274 enum snd_soc_bias_level level)
275{
276 snd_soc_dapm_init_bias_level(
277 snd_soc_component_get_dapm(component), level);
278}
279
280/**
281 * snd_soc_component_get_bias_level() - Get current COMPONENT DAPM bias level
282 * @component: The COMPONENT for which to get the DAPM bias level
283 *
284 * Returns: The current DAPM bias level of the COMPONENT.
285 */
286static inline enum snd_soc_bias_level
287snd_soc_component_get_bias_level(struct snd_soc_component *component)
288{
289 return snd_soc_dapm_get_bias_level(
290 snd_soc_component_get_dapm(component));
291}
292
293/**
294 * snd_soc_component_force_bias_level() - Set the COMPONENT DAPM bias level
295 * @component: The COMPONENT for which to set the level
296 * @level: The level to set to
297 *
298 * Forces the COMPONENT bias level to a specific state. See
299 * snd_soc_dapm_force_bias_level().
300 */
301static inline int
302snd_soc_component_force_bias_level(struct snd_soc_component *component,
303 enum snd_soc_bias_level level)
304{
305 return snd_soc_dapm_force_bias_level(
306 snd_soc_component_get_dapm(component),
307 level);
308}
309
310/**
311 * snd_soc_dapm_kcontrol_component() - Returns the component associated to a
312 * kcontrol
313 * @kcontrol: The kcontrol
314 *
315 * This function must only be used on DAPM contexts that are known to be part of
316 * a COMPONENT (e.g. in a COMPONENT driver). Otherwise the behavior is undefined
317 */
318static inline struct snd_soc_component *snd_soc_dapm_kcontrol_component(
319 struct snd_kcontrol *kcontrol)
320{
321 return snd_soc_dapm_to_component(snd_soc_dapm_kcontrol_dapm(kcontrol));
322}
323
324/**
325 * snd_soc_component_cache_sync() - Sync the register cache with the hardware
326 * @component: COMPONENT to sync
327 *
328 * Note: This function will call regcache_sync()
329 */
330static inline int snd_soc_component_cache_sync(
331 struct snd_soc_component *component)
332{
333 return regcache_sync(component->regmap);
334}
335
Kuninori Morimoto01e90ee2021-10-18 11:05:24 +0900336static inline int snd_soc_component_is_codec(struct snd_soc_component *component)
337{
338 return component->driver->non_legacy_dai_naming;
339}
340
Kuninori Morimoto257c4da2020-06-04 17:07:54 +0900341void snd_soc_component_set_aux(struct snd_soc_component *component,
342 struct snd_soc_aux_dev *aux);
343int snd_soc_component_init(struct snd_soc_component *component);
Kuninori Morimoto8f1a1682021-04-16 11:00:26 +0900344int snd_soc_component_is_dummy(struct snd_soc_component *component);
Kuninori Morimoto536aba12020-06-04 17:06:32 +0900345
Kuninori Morimoto4ff1fef2019-07-26 13:49:48 +0900346/* component IO */
Kuninori Morimotocf6e26c2020-06-16 14:19:41 +0900347unsigned int snd_soc_component_read(struct snd_soc_component *component,
Kuninori Morimoto4ff1fef2019-07-26 13:49:48 +0900348 unsigned int reg);
349int snd_soc_component_write(struct snd_soc_component *component,
350 unsigned int reg, unsigned int val);
351int snd_soc_component_update_bits(struct snd_soc_component *component,
352 unsigned int reg, unsigned int mask,
353 unsigned int val);
354int snd_soc_component_update_bits_async(struct snd_soc_component *component,
355 unsigned int reg, unsigned int mask,
356 unsigned int val);
357void snd_soc_component_async_complete(struct snd_soc_component *component);
358int snd_soc_component_test_bits(struct snd_soc_component *component,
359 unsigned int reg, unsigned int mask,
360 unsigned int value);
361
Srinivas Kandagatla1da0b982021-01-26 17:17:48 +0000362unsigned int snd_soc_component_read_field(struct snd_soc_component *component,
363 unsigned int reg, unsigned int mask);
364int snd_soc_component_write_field(struct snd_soc_component *component,
365 unsigned int reg, unsigned int mask,
366 unsigned int val);
367
Kuninori Morimoto4ff1fef2019-07-26 13:49:48 +0900368/* component wide operations */
369int snd_soc_component_set_sysclk(struct snd_soc_component *component,
370 int clk_id, int source,
371 unsigned int freq, int dir);
372int snd_soc_component_set_pll(struct snd_soc_component *component, int pll_id,
373 int source, unsigned int freq_in,
374 unsigned int freq_out);
375int snd_soc_component_set_jack(struct snd_soc_component *component,
376 struct snd_soc_jack *jack, void *data);
377
Kuninori Morimoto9d415fb2019-07-26 13:51:35 +0900378void snd_soc_component_seq_notifier(struct snd_soc_component *component,
379 enum snd_soc_dapm_type type, int subseq);
Kuninori Morimoto8e2a9902019-07-26 13:51:39 +0900380int snd_soc_component_stream_event(struct snd_soc_component *component,
381 int event);
Kuninori Morimoto7951b1462019-07-26 13:51:43 +0900382int snd_soc_component_set_bias_level(struct snd_soc_component *component,
383 enum snd_soc_bias_level level);
Kuninori Morimoto9d415fb2019-07-26 13:51:35 +0900384
Kuninori Morimotoc7d75b52020-06-04 17:06:22 +0900385void snd_soc_component_setup_regmap(struct snd_soc_component *component);
Kuninori Morimoto4ff1fef2019-07-26 13:49:48 +0900386#ifdef CONFIG_REGMAP
387void snd_soc_component_init_regmap(struct snd_soc_component *component,
388 struct regmap *regmap);
389void snd_soc_component_exit_regmap(struct snd_soc_component *component);
390#endif
391
Kuninori Morimoto4a81e8f2019-07-26 13:49:54 +0900392#define snd_soc_component_module_get_when_probe(component)\
Kuninori Morimoto51aff912020-09-28 09:01:04 +0900393 snd_soc_component_module_get(component, NULL, 0)
394#define snd_soc_component_module_get_when_open(component, substream) \
395 snd_soc_component_module_get(component, substream, 1)
Kuninori Morimoto4a81e8f2019-07-26 13:49:54 +0900396int snd_soc_component_module_get(struct snd_soc_component *component,
Peter Ujfalusia739fdc2021-09-01 12:52:54 +0300397 void *mark, int upon_open);
Kuninori Morimoto4a81e8f2019-07-26 13:49:54 +0900398#define snd_soc_component_module_put_when_remove(component) \
Kuninori Morimoto51aff912020-09-28 09:01:04 +0900399 snd_soc_component_module_put(component, NULL, 0, 0)
400#define snd_soc_component_module_put_when_close(component, substream, rollback) \
401 snd_soc_component_module_put(component, substream, 1, rollback)
Kuninori Morimoto4a81e8f2019-07-26 13:49:54 +0900402void snd_soc_component_module_put(struct snd_soc_component *component,
Peter Ujfalusia739fdc2021-09-01 12:52:54 +0300403 void *mark, int upon_open, int rollback);
Kuninori Morimoto4a81e8f2019-07-26 13:49:54 +0900404
Kuninori Morimoto4ff1fef2019-07-26 13:49:48 +0900405static inline void snd_soc_component_set_drvdata(struct snd_soc_component *c,
406 void *data)
407{
408 dev_set_drvdata(c->dev, data);
409}
410
411static inline void *snd_soc_component_get_drvdata(struct snd_soc_component *c)
412{
413 return dev_get_drvdata(c->dev);
414}
415
Kuninori Morimoto488b2ca2020-05-15 09:46:42 +0900416static inline unsigned int
417snd_soc_component_active(struct snd_soc_component *component)
418{
419 return component->active;
420}
421
Kuninori Morimoto4ff1fef2019-07-26 13:49:48 +0900422/* component pin */
423int snd_soc_component_enable_pin(struct snd_soc_component *component,
424 const char *pin);
425int snd_soc_component_enable_pin_unlocked(struct snd_soc_component *component,
426 const char *pin);
427int snd_soc_component_disable_pin(struct snd_soc_component *component,
428 const char *pin);
429int snd_soc_component_disable_pin_unlocked(struct snd_soc_component *component,
430 const char *pin);
431int snd_soc_component_nc_pin(struct snd_soc_component *component,
432 const char *pin);
433int snd_soc_component_nc_pin_unlocked(struct snd_soc_component *component,
434 const char *pin);
435int snd_soc_component_get_pin_status(struct snd_soc_component *component,
436 const char *pin);
437int snd_soc_component_force_enable_pin(struct snd_soc_component *component,
438 const char *pin);
439int snd_soc_component_force_enable_pin_unlocked(
440 struct snd_soc_component *component,
441 const char *pin);
442
Kuninori Morimotoae2f4842019-07-26 13:50:01 +0900443/* component driver ops */
444int snd_soc_component_open(struct snd_soc_component *component,
445 struct snd_pcm_substream *substream);
Kuninori Morimoto3672beb2019-07-26 13:50:07 +0900446int snd_soc_component_close(struct snd_soc_component *component,
Kuninori Morimoto51aff912020-09-28 09:01:04 +0900447 struct snd_pcm_substream *substream,
448 int rollback);
Kuninori Morimoto66c51572019-07-26 13:50:34 +0900449void snd_soc_component_suspend(struct snd_soc_component *component);
Kuninori Morimoto9a840cb2019-07-26 13:51:08 +0900450void snd_soc_component_resume(struct snd_soc_component *component);
Kuninori Morimotoe40fadb2019-07-26 13:51:13 +0900451int snd_soc_component_is_suspended(struct snd_soc_component *component);
Kuninori Morimoto08e837d2019-07-26 13:51:17 +0900452int snd_soc_component_probe(struct snd_soc_component *component);
Kuninori Morimoto03b34dd2019-07-26 13:51:22 +0900453void snd_soc_component_remove(struct snd_soc_component *component);
Kuninori Morimoto2c7b1702019-07-26 13:51:26 +0900454int snd_soc_component_of_xlate_dai_id(struct snd_soc_component *component,
455 struct device_node *ep);
Kuninori Morimotoa2a34172019-07-26 13:51:31 +0900456int snd_soc_component_of_xlate_dai_name(struct snd_soc_component *component,
Krzysztof Kozlowski933f98b2021-02-21 16:30:24 +0100457 const struct of_phandle_args *args,
Kuninori Morimotoa2a34172019-07-26 13:51:31 +0900458 const char **dai_name);
Peter Ujfalusicd46f382021-09-01 12:52:55 +0300459int snd_soc_component_compr_open(struct snd_soc_component *component,
460 struct snd_compr_stream *cstream);
461void snd_soc_component_compr_free(struct snd_soc_component *component,
462 struct snd_compr_stream *cstream,
Kuninori Morimotof94ba9a2020-11-19 08:50:09 +0900463 int rollback);
Kuninori Morimoto08aee252020-11-13 13:15:33 +0900464int snd_soc_component_compr_trigger(struct snd_compr_stream *cstream, int cmd);
Kuninori Morimotoff08cf82020-11-13 13:15:49 +0900465int snd_soc_component_compr_set_params(struct snd_compr_stream *cstream,
466 struct snd_compr_params *params);
Kuninori Morimoto77c221e2020-11-13 13:15:56 +0900467int snd_soc_component_compr_get_params(struct snd_compr_stream *cstream,
468 struct snd_codec *params);
Kuninori Morimotod67fcb22020-11-13 13:16:03 +0900469int snd_soc_component_compr_get_caps(struct snd_compr_stream *cstream,
470 struct snd_compr_caps *caps);
Kuninori Morimoto0f6fe092020-11-13 13:16:11 +0900471int snd_soc_component_compr_get_codec_caps(struct snd_compr_stream *cstream,
472 struct snd_compr_codec_caps *codec);
Kuninori Morimoto0506b882020-11-13 13:16:17 +0900473int snd_soc_component_compr_ack(struct snd_compr_stream *cstream, size_t bytes);
Kuninori Morimoto03ecea62020-11-13 13:16:24 +0900474int snd_soc_component_compr_pointer(struct snd_compr_stream *cstream,
475 struct snd_compr_tstamp *tstamp);
Kuninori Morimotob5852e62020-11-13 13:16:30 +0900476int snd_soc_component_compr_copy(struct snd_compr_stream *cstream,
477 char __user *buf, size_t count);
Kuninori Morimoto1b308fb2020-11-13 13:16:36 +0900478int snd_soc_component_compr_set_metadata(struct snd_compr_stream *cstream,
479 struct snd_compr_metadata *metadata);
Kuninori Morimotobab78c22020-11-13 13:16:41 +0900480int snd_soc_component_compr_get_metadata(struct snd_compr_stream *cstream,
481 struct snd_compr_metadata *metadata);
Kuninori Morimotoae2f4842019-07-26 13:50:01 +0900482
Kuninori Morimoto0035e252019-07-26 13:51:47 +0900483int snd_soc_pcm_component_pointer(struct snd_pcm_substream *substream);
Kuninori Morimoto96a47902019-07-26 13:51:51 +0900484int snd_soc_pcm_component_ioctl(struct snd_pcm_substream *substream,
485 unsigned int cmd, void *arg);
Takashi Iwai1e5ddb62019-11-21 20:07:09 +0100486int snd_soc_pcm_component_sync_stop(struct snd_pcm_substream *substream);
Kuninori Morimoto82d81f52019-07-26 13:51:56 +0900487int snd_soc_pcm_component_copy_user(struct snd_pcm_substream *substream,
488 int channel, unsigned long pos,
489 void __user *buf, unsigned long bytes);
Kuninori Morimoto9c712e42019-07-26 13:52:00 +0900490struct page *snd_soc_pcm_component_page(struct snd_pcm_substream *substream,
491 unsigned long offset);
Kuninori Morimoto205875e2019-07-26 13:52:04 +0900492int snd_soc_pcm_component_mmap(struct snd_pcm_substream *substream,
493 struct vm_area_struct *vma);
Kuninori Morimotob2b2afb2019-11-18 10:50:32 +0900494int snd_soc_pcm_component_new(struct snd_soc_pcm_runtime *rtd);
495void snd_soc_pcm_component_free(struct snd_soc_pcm_runtime *rtd);
Kuninori Morimoto4f395142020-06-04 17:06:58 +0900496int snd_soc_pcm_component_prepare(struct snd_pcm_substream *substream);
Kuninori Morimotoe1bafa82020-06-04 17:07:11 +0900497int snd_soc_pcm_component_hw_params(struct snd_pcm_substream *substream,
Kuninori Morimoto3a36a642020-09-29 13:31:41 +0900498 struct snd_pcm_hw_params *params);
Kuninori Morimoto04751112020-06-04 17:07:24 +0900499void snd_soc_pcm_component_hw_free(struct snd_pcm_substream *substream,
Kuninori Morimoto3a36a642020-09-29 13:31:41 +0900500 int rollback);
Kuninori Morimoto32fd1202020-06-04 17:07:40 +0900501int snd_soc_pcm_component_trigger(struct snd_pcm_substream *substream,
Kuninori Morimoto6374f492020-12-01 08:51:33 +0900502 int cmd, int rollback);
Kuninori Morimoto939a5cf2020-09-28 09:01:17 +0900503int snd_soc_pcm_component_pm_runtime_get(struct snd_soc_pcm_runtime *rtd,
504 void *stream);
505void snd_soc_pcm_component_pm_runtime_put(struct snd_soc_pcm_runtime *rtd,
506 void *stream, int rollback);
Shengjiu Wang8bdfc042021-03-12 10:38:40 +0800507int snd_soc_pcm_component_ack(struct snd_pcm_substream *substream);
Kuninori Morimoto0035e252019-07-26 13:51:47 +0900508
Kuninori Morimoto4ff1fef2019-07-26 13:49:48 +0900509#endif /* __SOC_COMPONENT_H */