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 void snd_sof_dsp_dbg_dump(struct snd_sof_dev *sdev, u32 flags);
246 static inline int snd_sof_debugfs_add_region_item(struct snd_sof_dev *sdev, in snd_sof_debugfs_add_region_item() argument
250 if (sof_ops(sdev) && sof_ops(sdev)->debugfs_add_region_item) in snd_sof_debugfs_add_region_item()
251 return sof_ops(sdev)->debugfs_add_region_item(sdev, blk_type, offset, in snd_sof_debugfs_add_region_item()
258 static inline void snd_sof_dsp_write(struct snd_sof_dev *sdev, u32 bar, in snd_sof_dsp_write() argument
261 if (sof_ops(sdev)->write) { in snd_sof_dsp_write()
262 sof_ops(sdev)->write(sdev, sdev->bar[bar] + offset, value); in snd_sof_dsp_write()
266 dev_err_ratelimited(sdev->dev, "error: %s not defined\n", __func__); in snd_sof_dsp_write()
269 static inline void snd_sof_dsp_write64(struct snd_sof_dev *sdev, u32 bar, in snd_sof_dsp_write64() argument
272 if (sof_ops(sdev)->write64) { in snd_sof_dsp_write64()
273 sof_ops(sdev)->write64(sdev, sdev->bar[bar] + offset, value); in snd_sof_dsp_write64()
277 dev_err_ratelimited(sdev->dev, "error: %s not defined\n", __func__); in snd_sof_dsp_write64()
280 static inline u32 snd_sof_dsp_read(struct snd_sof_dev *sdev, u32 bar, in snd_sof_dsp_read() argument
283 if (sof_ops(sdev)->read) in snd_sof_dsp_read()
284 return sof_ops(sdev)->read(sdev, sdev->bar[bar] + offset); in snd_sof_dsp_read()
286 dev_err(sdev->dev, "error: %s not defined\n", __func__); in snd_sof_dsp_read()
290 static inline u64 snd_sof_dsp_read64(struct snd_sof_dev *sdev, u32 bar, in snd_sof_dsp_read64() argument
293 if (sof_ops(sdev)->read64) in snd_sof_dsp_read64()
294 return sof_ops(sdev)->read64(sdev, sdev->bar[bar] + offset); in snd_sof_dsp_read64()
296 dev_err(sdev->dev, "error: %s not defined\n", __func__); in snd_sof_dsp_read64()
301 static inline int snd_sof_dsp_block_read(struct snd_sof_dev *sdev, in snd_sof_dsp_block_read() argument
305 return sof_ops(sdev)->block_read(sdev, blk_type, offset, dest, bytes); in snd_sof_dsp_block_read()
308 static inline int snd_sof_dsp_block_write(struct snd_sof_dev *sdev, in snd_sof_dsp_block_write() argument
312 return sof_ops(sdev)->block_write(sdev, blk_type, offset, src, bytes); in snd_sof_dsp_block_write()
316 static inline void snd_sof_dsp_mailbox_read(struct snd_sof_dev *sdev, in snd_sof_dsp_mailbox_read() argument
319 if (sof_ops(sdev)->mailbox_read) in snd_sof_dsp_mailbox_read()
320 sof_ops(sdev)->mailbox_read(sdev, offset, dest, bytes); in snd_sof_dsp_mailbox_read()
323 static inline void snd_sof_dsp_mailbox_write(struct snd_sof_dev *sdev, in snd_sof_dsp_mailbox_write() argument
326 if (sof_ops(sdev)->mailbox_write) in snd_sof_dsp_mailbox_write()
327 sof_ops(sdev)->mailbox_write(sdev, offset, src, bytes); in snd_sof_dsp_mailbox_write()
331 static inline int snd_sof_dsp_send_msg(struct snd_sof_dev *sdev, in snd_sof_dsp_send_msg() argument
334 return sof_ops(sdev)->send_msg(sdev, msg); in snd_sof_dsp_send_msg()
338 static inline int snd_sof_dma_trace_init(struct snd_sof_dev *sdev, in snd_sof_dma_trace_init() argument
341 if (sof_ops(sdev)->trace_init) in snd_sof_dma_trace_init()
342 return sof_ops(sdev)->trace_init(sdev, stream_tag); in snd_sof_dma_trace_init()
347 static inline int snd_sof_dma_trace_release(struct snd_sof_dev *sdev) in snd_sof_dma_trace_release() argument
349 if (sof_ops(sdev)->trace_release) in snd_sof_dma_trace_release()
350 return sof_ops(sdev)->trace_release(sdev); in snd_sof_dma_trace_release()
355 static inline int snd_sof_dma_trace_trigger(struct snd_sof_dev *sdev, int cmd) in snd_sof_dma_trace_trigger() argument
357 if (sof_ops(sdev)->trace_trigger) in snd_sof_dma_trace_trigger()
358 return sof_ops(sdev)->trace_trigger(sdev, cmd); in snd_sof_dma_trace_trigger()
365 snd_sof_pcm_platform_open(struct snd_sof_dev *sdev, in snd_sof_pcm_platform_open() argument
368 if (sof_ops(sdev) && sof_ops(sdev)->pcm_open) in snd_sof_pcm_platform_open()
369 return sof_ops(sdev)->pcm_open(sdev, substream); in snd_sof_pcm_platform_open()
376 snd_sof_pcm_platform_close(struct snd_sof_dev *sdev, in snd_sof_pcm_platform_close() argument
379 if (sof_ops(sdev) && sof_ops(sdev)->pcm_close) in snd_sof_pcm_platform_close()
380 return sof_ops(sdev)->pcm_close(sdev, substream); in snd_sof_pcm_platform_close()
387 snd_sof_pcm_platform_hw_params(struct snd_sof_dev *sdev, in snd_sof_pcm_platform_hw_params() argument
392 if (sof_ops(sdev) && sof_ops(sdev)->pcm_hw_params) in snd_sof_pcm_platform_hw_params()
393 return sof_ops(sdev)->pcm_hw_params(sdev, substream, in snd_sof_pcm_platform_hw_params()
401 snd_sof_pcm_platform_hw_free(struct snd_sof_dev *sdev, in snd_sof_pcm_platform_hw_free() argument
404 if (sof_ops(sdev) && sof_ops(sdev)->pcm_hw_free) in snd_sof_pcm_platform_hw_free()
405 return sof_ops(sdev)->pcm_hw_free(sdev, substream); in snd_sof_pcm_platform_hw_free()
412 snd_sof_pcm_platform_trigger(struct snd_sof_dev *sdev, in snd_sof_pcm_platform_trigger() argument
415 if (sof_ops(sdev) && sof_ops(sdev)->pcm_trigger) in snd_sof_pcm_platform_trigger()
416 return sof_ops(sdev)->pcm_trigger(sdev, substream, cmd); in snd_sof_pcm_platform_trigger()
422 static inline int snd_sof_load_firmware(struct snd_sof_dev *sdev) in snd_sof_load_firmware() argument
424 dev_dbg(sdev->dev, "loading firmware\n"); in snd_sof_load_firmware()
426 return sof_ops(sdev)->load_firmware(sdev); in snd_sof_load_firmware()
430 static inline int snd_sof_ipc_msg_data(struct snd_sof_dev *sdev, in snd_sof_ipc_msg_data() argument
434 return sof_ops(sdev)->ipc_msg_data(sdev, substream, p, sz); in snd_sof_ipc_msg_data()
439 snd_sof_ipc_pcm_params(struct snd_sof_dev *sdev, in snd_sof_ipc_pcm_params() argument
443 return sof_ops(sdev)->ipc_pcm_params(sdev, substream, reply); in snd_sof_ipc_pcm_params()
448 snd_sof_pcm_platform_pointer(struct snd_sof_dev *sdev, in snd_sof_pcm_platform_pointer() argument
451 if (sof_ops(sdev) && sof_ops(sdev)->pcm_pointer) in snd_sof_pcm_platform_pointer()
452 return sof_ops(sdev)->pcm_pointer(sdev, substream); in snd_sof_pcm_platform_pointer()
459 snd_sof_probe_compr_assign(struct snd_sof_dev *sdev, in snd_sof_probe_compr_assign() argument
462 return sof_ops(sdev)->probe_assign(sdev, cstream, dai); in snd_sof_probe_compr_assign()
466 snd_sof_probe_compr_free(struct snd_sof_dev *sdev, in snd_sof_probe_compr_free() argument
469 return sof_ops(sdev)->probe_free(sdev, cstream, dai); in snd_sof_probe_compr_free()
473 snd_sof_probe_compr_set_params(struct snd_sof_dev *sdev, in snd_sof_probe_compr_set_params() argument
477 return sof_ops(sdev)->probe_set_params(sdev, cstream, params, dai); in snd_sof_probe_compr_set_params()
481 snd_sof_probe_compr_trigger(struct snd_sof_dev *sdev, in snd_sof_probe_compr_trigger() argument
485 return sof_ops(sdev)->probe_trigger(sdev, cstream, cmd, dai); in snd_sof_probe_compr_trigger()
489 snd_sof_probe_compr_pointer(struct snd_sof_dev *sdev, in snd_sof_probe_compr_pointer() argument
493 if (sof_ops(sdev) && sof_ops(sdev)->probe_pointer) in snd_sof_probe_compr_pointer()
494 return sof_ops(sdev)->probe_pointer(sdev, cstream, tstamp, dai); in snd_sof_probe_compr_pointer()
502 snd_sof_machine_register(struct snd_sof_dev *sdev, void *pdata) in snd_sof_machine_register() argument
504 if (sof_ops(sdev) && sof_ops(sdev)->machine_register) in snd_sof_machine_register()
505 return sof_ops(sdev)->machine_register(sdev, pdata); in snd_sof_machine_register()
511 snd_sof_machine_unregister(struct snd_sof_dev *sdev, void *pdata) in snd_sof_machine_unregister() argument
513 if (sof_ops(sdev) && sof_ops(sdev)->machine_unregister) in snd_sof_machine_unregister()
514 sof_ops(sdev)->machine_unregister(sdev, pdata); in snd_sof_machine_unregister()
518 snd_sof_machine_select(struct snd_sof_dev *sdev) in snd_sof_machine_select() argument
520 if (sof_ops(sdev) && sof_ops(sdev)->machine_select) in snd_sof_machine_select()
521 sof_ops(sdev)->machine_select(sdev); in snd_sof_machine_select()
526 struct snd_sof_dev *sdev) in snd_sof_set_mach_params() argument
528 if (sof_ops(sdev) && sof_ops(sdev)->set_mach_params) in snd_sof_set_mach_params()
529 sof_ops(sdev)->set_mach_params(mach, sdev); in snd_sof_set_mach_params()
550 #define snd_sof_dsp_read_poll_timeout(sdev, bar, offset, val, cond, sleep_us, timeout_us) \ argument
557 (val) = snd_sof_dsp_read(sdev, bar, offset); \
559 dev_dbg(sdev->dev, \
566 (val) = snd_sof_dsp_read(sdev, bar, offset); \
567 dev_dbg(sdev->dev, \
579 bool snd_sof_pci_update_bits(struct snd_sof_dev *sdev, u32 offset,
582 bool snd_sof_dsp_update_bits_unlocked(struct snd_sof_dev *sdev, u32 bar,
585 bool snd_sof_dsp_update_bits64_unlocked(struct snd_sof_dev *sdev, u32 bar,
588 bool snd_sof_dsp_update_bits(struct snd_sof_dev *sdev, u32 bar, u32 offset,
591 bool snd_sof_dsp_update_bits64(struct snd_sof_dev *sdev, u32 bar,
594 void snd_sof_dsp_update_bits_forced(struct snd_sof_dev *sdev, u32 bar,
597 int snd_sof_dsp_register_poll(struct snd_sof_dev *sdev, u32 bar, u32 offset,
601 void snd_sof_dsp_panic(struct snd_sof_dev *sdev, u32 offset);