Lines Matching refs:sdev
21 #define sof_ops(sdev) \ argument
22 ((sdev)->pdata->desc->ops)
27 static inline int snd_sof_probe(struct snd_sof_dev *sdev) in snd_sof_probe() argument
29 return sof_ops(sdev)->probe(sdev); in snd_sof_probe()
32 static inline int snd_sof_remove(struct snd_sof_dev *sdev) in snd_sof_remove() argument
34 if (sof_ops(sdev)->remove) in snd_sof_remove()
35 return sof_ops(sdev)->remove(sdev); in snd_sof_remove()
40 static inline int snd_sof_shutdown(struct snd_sof_dev *sdev) in snd_sof_shutdown() argument
42 if (sof_ops(sdev)->shutdown) in snd_sof_shutdown()
43 return sof_ops(sdev)->shutdown(sdev); in snd_sof_shutdown()
54 static inline int snd_sof_dsp_run(struct snd_sof_dev *sdev) in snd_sof_dsp_run() argument
56 return sof_ops(sdev)->run(sdev); in snd_sof_dsp_run()
59 static inline int snd_sof_dsp_stall(struct snd_sof_dev *sdev, unsigned int core_mask) in snd_sof_dsp_stall() argument
61 if (sof_ops(sdev)->stall) in snd_sof_dsp_stall()
62 return sof_ops(sdev)->stall(sdev, core_mask); in snd_sof_dsp_stall()
67 static inline int snd_sof_dsp_reset(struct snd_sof_dev *sdev) in snd_sof_dsp_reset() argument
69 if (sof_ops(sdev)->reset) in snd_sof_dsp_reset()
70 return sof_ops(sdev)->reset(sdev); in snd_sof_dsp_reset()
76 static inline int snd_sof_dsp_core_power_up(struct snd_sof_dev *sdev, in snd_sof_dsp_core_power_up() argument
81 core_mask &= ~sdev->enabled_cores_mask; in snd_sof_dsp_core_power_up()
82 if (sof_ops(sdev)->core_power_up && core_mask) { in snd_sof_dsp_core_power_up()
83 ret = sof_ops(sdev)->core_power_up(sdev, core_mask); in snd_sof_dsp_core_power_up()
85 sdev->enabled_cores_mask |= core_mask; in snd_sof_dsp_core_power_up()
91 static inline int snd_sof_dsp_core_power_down(struct snd_sof_dev *sdev, in snd_sof_dsp_core_power_down() argument
96 core_mask &= sdev->enabled_cores_mask; in snd_sof_dsp_core_power_down()
97 if (sof_ops(sdev)->core_power_down && core_mask) { in snd_sof_dsp_core_power_down()
98 ret = sof_ops(sdev)->core_power_down(sdev, core_mask); in snd_sof_dsp_core_power_down()
100 sdev->enabled_cores_mask &= ~core_mask; in snd_sof_dsp_core_power_down()
107 static inline int snd_sof_dsp_pre_fw_run(struct snd_sof_dev *sdev) in snd_sof_dsp_pre_fw_run() argument
109 if (sof_ops(sdev)->pre_fw_run) in snd_sof_dsp_pre_fw_run()
110 return sof_ops(sdev)->pre_fw_run(sdev); in snd_sof_dsp_pre_fw_run()
115 static inline int snd_sof_dsp_post_fw_run(struct snd_sof_dev *sdev) in snd_sof_dsp_post_fw_run() argument
117 if (sof_ops(sdev)->post_fw_run) in snd_sof_dsp_post_fw_run()
118 return sof_ops(sdev)->post_fw_run(sdev); in snd_sof_dsp_post_fw_run()
124 static inline int snd_sof_dsp_parse_platform_ext_manifest(struct snd_sof_dev *sdev, in snd_sof_dsp_parse_platform_ext_manifest() argument
127 if (sof_ops(sdev)->parse_platform_ext_manifest) in snd_sof_dsp_parse_platform_ext_manifest()
128 return sof_ops(sdev)->parse_platform_ext_manifest(sdev, hdr); in snd_sof_dsp_parse_platform_ext_manifest()
144 static inline int snd_sof_dsp_get_bar_index(struct snd_sof_dev *sdev, u32 type) in snd_sof_dsp_get_bar_index() argument
146 if (sof_ops(sdev)->get_bar_index) in snd_sof_dsp_get_bar_index()
147 return sof_ops(sdev)->get_bar_index(sdev, type); in snd_sof_dsp_get_bar_index()
149 return sdev->mmio_bar; in snd_sof_dsp_get_bar_index()
152 static inline int snd_sof_dsp_get_mailbox_offset(struct snd_sof_dev *sdev) in snd_sof_dsp_get_mailbox_offset() argument
154 if (sof_ops(sdev)->get_mailbox_offset) in snd_sof_dsp_get_mailbox_offset()
155 return sof_ops(sdev)->get_mailbox_offset(sdev); in snd_sof_dsp_get_mailbox_offset()
157 dev_err(sdev->dev, "error: %s not defined\n", __func__); in snd_sof_dsp_get_mailbox_offset()
161 static inline int snd_sof_dsp_get_window_offset(struct snd_sof_dev *sdev, in snd_sof_dsp_get_window_offset() argument
164 if (sof_ops(sdev)->get_window_offset) in snd_sof_dsp_get_window_offset()
165 return sof_ops(sdev)->get_window_offset(sdev, id); in snd_sof_dsp_get_window_offset()
167 dev_err(sdev->dev, "error: %s not defined\n", __func__); in snd_sof_dsp_get_window_offset()
171 static inline int snd_sof_dsp_resume(struct snd_sof_dev *sdev) in snd_sof_dsp_resume() argument
173 if (sof_ops(sdev)->resume) in snd_sof_dsp_resume()
174 return sof_ops(sdev)->resume(sdev); in snd_sof_dsp_resume()
179 static inline int snd_sof_dsp_suspend(struct snd_sof_dev *sdev, in snd_sof_dsp_suspend() argument
182 if (sof_ops(sdev)->suspend) in snd_sof_dsp_suspend()
183 return sof_ops(sdev)->suspend(sdev, target_state); in snd_sof_dsp_suspend()
188 static inline int snd_sof_dsp_runtime_resume(struct snd_sof_dev *sdev) in snd_sof_dsp_runtime_resume() argument
190 if (sof_ops(sdev)->runtime_resume) in snd_sof_dsp_runtime_resume()
191 return sof_ops(sdev)->runtime_resume(sdev); in snd_sof_dsp_runtime_resume()
196 static inline int snd_sof_dsp_runtime_suspend(struct snd_sof_dev *sdev) in snd_sof_dsp_runtime_suspend() argument
198 if (sof_ops(sdev)->runtime_suspend) in snd_sof_dsp_runtime_suspend()
199 return sof_ops(sdev)->runtime_suspend(sdev); in snd_sof_dsp_runtime_suspend()
204 static inline int snd_sof_dsp_runtime_idle(struct snd_sof_dev *sdev) in snd_sof_dsp_runtime_idle() argument
206 if (sof_ops(sdev)->runtime_idle) in snd_sof_dsp_runtime_idle()
207 return sof_ops(sdev)->runtime_idle(sdev); in snd_sof_dsp_runtime_idle()
212 static inline int snd_sof_dsp_hw_params_upon_resume(struct snd_sof_dev *sdev) in snd_sof_dsp_hw_params_upon_resume() argument
214 if (sof_ops(sdev)->set_hw_params_upon_resume) in snd_sof_dsp_hw_params_upon_resume()
215 return sof_ops(sdev)->set_hw_params_upon_resume(sdev); in snd_sof_dsp_hw_params_upon_resume()
219 static inline int snd_sof_dsp_set_clk(struct snd_sof_dev *sdev, u32 freq) in snd_sof_dsp_set_clk() argument
221 if (sof_ops(sdev)->set_clk) in snd_sof_dsp_set_clk()
222 return sof_ops(sdev)->set_clk(sdev, freq); in snd_sof_dsp_set_clk()
228 snd_sof_dsp_set_power_state(struct snd_sof_dev *sdev, in snd_sof_dsp_set_power_state() argument
233 mutex_lock(&sdev->power_state_access); in snd_sof_dsp_set_power_state()
235 if (sof_ops(sdev)->set_power_state) in snd_sof_dsp_set_power_state()
236 ret = sof_ops(sdev)->set_power_state(sdev, target_state); in snd_sof_dsp_set_power_state()
238 mutex_unlock(&sdev->power_state_access); in snd_sof_dsp_set_power_state()
244 static inline void snd_sof_dsp_dbg_dump(struct snd_sof_dev *sdev, u32 flags) in snd_sof_dsp_dbg_dump() argument
246 if (sof_ops(sdev)->dbg_dump) in snd_sof_dsp_dbg_dump()
247 sof_ops(sdev)->dbg_dump(sdev, flags); in snd_sof_dsp_dbg_dump()
250 static inline void snd_sof_ipc_dump(struct snd_sof_dev *sdev) in snd_sof_ipc_dump() argument
252 if (sof_ops(sdev)->ipc_dump) in snd_sof_ipc_dump()
253 sof_ops(sdev)->ipc_dump(sdev); in snd_sof_ipc_dump()
257 static inline void snd_sof_dsp_write(struct snd_sof_dev *sdev, u32 bar, in snd_sof_dsp_write() argument
260 if (sof_ops(sdev)->write) { in snd_sof_dsp_write()
261 sof_ops(sdev)->write(sdev, sdev->bar[bar] + offset, value); in snd_sof_dsp_write()
265 dev_err_ratelimited(sdev->dev, "error: %s not defined\n", __func__); in snd_sof_dsp_write()
268 static inline void snd_sof_dsp_write64(struct snd_sof_dev *sdev, u32 bar, in snd_sof_dsp_write64() argument
271 if (sof_ops(sdev)->write64) { in snd_sof_dsp_write64()
272 sof_ops(sdev)->write64(sdev, sdev->bar[bar] + offset, value); in snd_sof_dsp_write64()
276 dev_err_ratelimited(sdev->dev, "error: %s not defined\n", __func__); in snd_sof_dsp_write64()
279 static inline u32 snd_sof_dsp_read(struct snd_sof_dev *sdev, u32 bar, in snd_sof_dsp_read() argument
282 if (sof_ops(sdev)->read) in snd_sof_dsp_read()
283 return sof_ops(sdev)->read(sdev, sdev->bar[bar] + offset); in snd_sof_dsp_read()
285 dev_err(sdev->dev, "error: %s not defined\n", __func__); in snd_sof_dsp_read()
289 static inline u64 snd_sof_dsp_read64(struct snd_sof_dev *sdev, u32 bar, in snd_sof_dsp_read64() argument
292 if (sof_ops(sdev)->read64) in snd_sof_dsp_read64()
293 return sof_ops(sdev)->read64(sdev, sdev->bar[bar] + offset); in snd_sof_dsp_read64()
295 dev_err(sdev->dev, "error: %s not defined\n", __func__); in snd_sof_dsp_read64()
300 static inline void snd_sof_dsp_block_read(struct snd_sof_dev *sdev, u32 bar, in snd_sof_dsp_block_read() argument
303 sof_ops(sdev)->block_read(sdev, bar, offset, dest, bytes); in snd_sof_dsp_block_read()
306 static inline void snd_sof_dsp_block_write(struct snd_sof_dev *sdev, u32 bar, in snd_sof_dsp_block_write() argument
309 sof_ops(sdev)->block_write(sdev, bar, offset, src, bytes); in snd_sof_dsp_block_write()
313 static inline int snd_sof_dsp_send_msg(struct snd_sof_dev *sdev, in snd_sof_dsp_send_msg() argument
316 return sof_ops(sdev)->send_msg(sdev, msg); in snd_sof_dsp_send_msg()
320 static inline int snd_sof_dma_trace_init(struct snd_sof_dev *sdev, in snd_sof_dma_trace_init() argument
323 if (sof_ops(sdev)->trace_init) in snd_sof_dma_trace_init()
324 return sof_ops(sdev)->trace_init(sdev, stream_tag); in snd_sof_dma_trace_init()
329 static inline int snd_sof_dma_trace_release(struct snd_sof_dev *sdev) in snd_sof_dma_trace_release() argument
331 if (sof_ops(sdev)->trace_release) in snd_sof_dma_trace_release()
332 return sof_ops(sdev)->trace_release(sdev); in snd_sof_dma_trace_release()
337 static inline int snd_sof_dma_trace_trigger(struct snd_sof_dev *sdev, int cmd) in snd_sof_dma_trace_trigger() argument
339 if (sof_ops(sdev)->trace_trigger) in snd_sof_dma_trace_trigger()
340 return sof_ops(sdev)->trace_trigger(sdev, cmd); in snd_sof_dma_trace_trigger()
347 snd_sof_pcm_platform_open(struct snd_sof_dev *sdev, in snd_sof_pcm_platform_open() argument
350 if (sof_ops(sdev) && sof_ops(sdev)->pcm_open) in snd_sof_pcm_platform_open()
351 return sof_ops(sdev)->pcm_open(sdev, substream); in snd_sof_pcm_platform_open()
358 snd_sof_pcm_platform_close(struct snd_sof_dev *sdev, in snd_sof_pcm_platform_close() argument
361 if (sof_ops(sdev) && sof_ops(sdev)->pcm_close) in snd_sof_pcm_platform_close()
362 return sof_ops(sdev)->pcm_close(sdev, substream); in snd_sof_pcm_platform_close()
369 snd_sof_pcm_platform_hw_params(struct snd_sof_dev *sdev, in snd_sof_pcm_platform_hw_params() argument
374 if (sof_ops(sdev) && sof_ops(sdev)->pcm_hw_params) in snd_sof_pcm_platform_hw_params()
375 return sof_ops(sdev)->pcm_hw_params(sdev, substream, in snd_sof_pcm_platform_hw_params()
383 snd_sof_pcm_platform_hw_free(struct snd_sof_dev *sdev, in snd_sof_pcm_platform_hw_free() argument
386 if (sof_ops(sdev) && sof_ops(sdev)->pcm_hw_free) in snd_sof_pcm_platform_hw_free()
387 return sof_ops(sdev)->pcm_hw_free(sdev, substream); in snd_sof_pcm_platform_hw_free()
394 snd_sof_pcm_platform_trigger(struct snd_sof_dev *sdev, in snd_sof_pcm_platform_trigger() argument
397 if (sof_ops(sdev) && sof_ops(sdev)->pcm_trigger) in snd_sof_pcm_platform_trigger()
398 return sof_ops(sdev)->pcm_trigger(sdev, substream, cmd); in snd_sof_pcm_platform_trigger()
404 static inline void snd_sof_ipc_msg_data(struct snd_sof_dev *sdev, in snd_sof_ipc_msg_data() argument
408 sof_ops(sdev)->ipc_msg_data(sdev, substream, p, sz); in snd_sof_ipc_msg_data()
413 snd_sof_ipc_pcm_params(struct snd_sof_dev *sdev, in snd_sof_ipc_pcm_params() argument
417 return sof_ops(sdev)->ipc_pcm_params(sdev, substream, reply); in snd_sof_ipc_pcm_params()
422 snd_sof_pcm_platform_pointer(struct snd_sof_dev *sdev, in snd_sof_pcm_platform_pointer() argument
425 if (sof_ops(sdev) && sof_ops(sdev)->pcm_pointer) in snd_sof_pcm_platform_pointer()
426 return sof_ops(sdev)->pcm_pointer(sdev, substream); in snd_sof_pcm_platform_pointer()
433 snd_sof_probe_compr_assign(struct snd_sof_dev *sdev, in snd_sof_probe_compr_assign() argument
436 return sof_ops(sdev)->probe_assign(sdev, cstream, dai); in snd_sof_probe_compr_assign()
440 snd_sof_probe_compr_free(struct snd_sof_dev *sdev, in snd_sof_probe_compr_free() argument
443 return sof_ops(sdev)->probe_free(sdev, cstream, dai); in snd_sof_probe_compr_free()
447 snd_sof_probe_compr_set_params(struct snd_sof_dev *sdev, in snd_sof_probe_compr_set_params() argument
451 return sof_ops(sdev)->probe_set_params(sdev, cstream, params, dai); in snd_sof_probe_compr_set_params()
455 snd_sof_probe_compr_trigger(struct snd_sof_dev *sdev, in snd_sof_probe_compr_trigger() argument
459 return sof_ops(sdev)->probe_trigger(sdev, cstream, cmd, dai); in snd_sof_probe_compr_trigger()
463 snd_sof_probe_compr_pointer(struct snd_sof_dev *sdev, in snd_sof_probe_compr_pointer() argument
467 if (sof_ops(sdev) && sof_ops(sdev)->probe_pointer) in snd_sof_probe_compr_pointer()
468 return sof_ops(sdev)->probe_pointer(sdev, cstream, tstamp, dai); in snd_sof_probe_compr_pointer()
476 snd_sof_machine_register(struct snd_sof_dev *sdev, void *pdata) in snd_sof_machine_register() argument
478 if (sof_ops(sdev) && sof_ops(sdev)->machine_register) in snd_sof_machine_register()
479 return sof_ops(sdev)->machine_register(sdev, pdata); in snd_sof_machine_register()
485 snd_sof_machine_unregister(struct snd_sof_dev *sdev, void *pdata) in snd_sof_machine_unregister() argument
487 if (sof_ops(sdev) && sof_ops(sdev)->machine_unregister) in snd_sof_machine_unregister()
488 sof_ops(sdev)->machine_unregister(sdev, pdata); in snd_sof_machine_unregister()
492 snd_sof_machine_select(struct snd_sof_dev *sdev) in snd_sof_machine_select() argument
494 if (sof_ops(sdev) && sof_ops(sdev)->machine_select) in snd_sof_machine_select()
495 sof_ops(sdev)->machine_select(sdev); in snd_sof_machine_select()
500 struct snd_sof_dev *sdev) in snd_sof_set_mach_params() argument
502 if (sof_ops(sdev) && sof_ops(sdev)->set_mach_params) in snd_sof_set_mach_params()
503 sof_ops(sdev)->set_mach_params(mach, sdev); in snd_sof_set_mach_params()
539 #define snd_sof_dsp_read_poll_timeout(sdev, bar, offset, val, cond, sleep_us, timeout_us) \ argument
546 (val) = snd_sof_dsp_read(sdev, bar, offset); \
548 dev_dbg(sdev->dev, \
555 (val) = snd_sof_dsp_read(sdev, bar, offset); \
556 dev_dbg(sdev->dev, \
568 bool snd_sof_pci_update_bits(struct snd_sof_dev *sdev, u32 offset,
571 bool snd_sof_dsp_update_bits_unlocked(struct snd_sof_dev *sdev, u32 bar,
574 bool snd_sof_dsp_update_bits64_unlocked(struct snd_sof_dev *sdev, u32 bar,
577 bool snd_sof_dsp_update_bits(struct snd_sof_dev *sdev, u32 bar, u32 offset,
580 bool snd_sof_dsp_update_bits64(struct snd_sof_dev *sdev, u32 bar,
583 void snd_sof_dsp_update_bits_forced(struct snd_sof_dev *sdev, u32 bar,
586 int snd_sof_dsp_register_poll(struct snd_sof_dev *sdev, u32 bar, u32 offset,
590 void snd_sof_dsp_panic(struct snd_sof_dev *sdev, u32 offset);