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()
46 static inline int snd_sof_dsp_run(struct snd_sof_dev *sdev) in snd_sof_dsp_run() argument
48 return sof_ops(sdev)->run(sdev); in snd_sof_dsp_run()
51 static inline int snd_sof_dsp_stall(struct snd_sof_dev *sdev) in snd_sof_dsp_stall() argument
53 if (sof_ops(sdev)->stall) in snd_sof_dsp_stall()
54 return sof_ops(sdev)->stall(sdev); in snd_sof_dsp_stall()
59 static inline int snd_sof_dsp_reset(struct snd_sof_dev *sdev) in snd_sof_dsp_reset() argument
61 if (sof_ops(sdev)->reset) in snd_sof_dsp_reset()
62 return sof_ops(sdev)->reset(sdev); in snd_sof_dsp_reset()
68 static inline int snd_sof_dsp_core_power_up(struct snd_sof_dev *sdev, in snd_sof_dsp_core_power_up() argument
71 if (sof_ops(sdev)->core_power_up) in snd_sof_dsp_core_power_up()
72 return sof_ops(sdev)->core_power_up(sdev, core_mask); in snd_sof_dsp_core_power_up()
77 static inline int snd_sof_dsp_core_power_down(struct snd_sof_dev *sdev, in snd_sof_dsp_core_power_down() argument
80 if (sof_ops(sdev)->core_power_down) in snd_sof_dsp_core_power_down()
81 return sof_ops(sdev)->core_power_down(sdev, core_mask); in snd_sof_dsp_core_power_down()
87 static inline int snd_sof_dsp_pre_fw_run(struct snd_sof_dev *sdev) in snd_sof_dsp_pre_fw_run() argument
89 if (sof_ops(sdev)->pre_fw_run) in snd_sof_dsp_pre_fw_run()
90 return sof_ops(sdev)->pre_fw_run(sdev); in snd_sof_dsp_pre_fw_run()
95 static inline int snd_sof_dsp_post_fw_run(struct snd_sof_dev *sdev) in snd_sof_dsp_post_fw_run() argument
97 if (sof_ops(sdev)->post_fw_run) in snd_sof_dsp_post_fw_run()
98 return sof_ops(sdev)->post_fw_run(sdev); in snd_sof_dsp_post_fw_run()
114 static inline int snd_sof_dsp_get_bar_index(struct snd_sof_dev *sdev, u32 type) in snd_sof_dsp_get_bar_index() argument
116 if (sof_ops(sdev)->get_bar_index) in snd_sof_dsp_get_bar_index()
117 return sof_ops(sdev)->get_bar_index(sdev, type); in snd_sof_dsp_get_bar_index()
119 return sdev->mmio_bar; in snd_sof_dsp_get_bar_index()
122 static inline int snd_sof_dsp_get_mailbox_offset(struct snd_sof_dev *sdev) in snd_sof_dsp_get_mailbox_offset() argument
124 if (sof_ops(sdev)->get_mailbox_offset) in snd_sof_dsp_get_mailbox_offset()
125 return sof_ops(sdev)->get_mailbox_offset(sdev); in snd_sof_dsp_get_mailbox_offset()
127 dev_err(sdev->dev, "error: %s not defined\n", __func__); in snd_sof_dsp_get_mailbox_offset()
131 static inline int snd_sof_dsp_get_window_offset(struct snd_sof_dev *sdev, in snd_sof_dsp_get_window_offset() argument
134 if (sof_ops(sdev)->get_window_offset) in snd_sof_dsp_get_window_offset()
135 return sof_ops(sdev)->get_window_offset(sdev, id); in snd_sof_dsp_get_window_offset()
137 dev_err(sdev->dev, "error: %s not defined\n", __func__); in snd_sof_dsp_get_window_offset()
141 static inline int snd_sof_dsp_resume(struct snd_sof_dev *sdev) in snd_sof_dsp_resume() argument
143 if (sof_ops(sdev)->resume) in snd_sof_dsp_resume()
144 return sof_ops(sdev)->resume(sdev); in snd_sof_dsp_resume()
149 static inline int snd_sof_dsp_suspend(struct snd_sof_dev *sdev) in snd_sof_dsp_suspend() argument
151 if (sof_ops(sdev)->suspend) in snd_sof_dsp_suspend()
152 return sof_ops(sdev)->suspend(sdev); in snd_sof_dsp_suspend()
157 static inline int snd_sof_dsp_runtime_resume(struct snd_sof_dev *sdev) in snd_sof_dsp_runtime_resume() argument
159 if (sof_ops(sdev)->runtime_resume) in snd_sof_dsp_runtime_resume()
160 return sof_ops(sdev)->runtime_resume(sdev); in snd_sof_dsp_runtime_resume()
165 static inline int snd_sof_dsp_runtime_suspend(struct snd_sof_dev *sdev) in snd_sof_dsp_runtime_suspend() argument
167 if (sof_ops(sdev)->runtime_suspend) in snd_sof_dsp_runtime_suspend()
168 return sof_ops(sdev)->runtime_suspend(sdev); in snd_sof_dsp_runtime_suspend()
173 static inline int snd_sof_dsp_runtime_idle(struct snd_sof_dev *sdev) in snd_sof_dsp_runtime_idle() argument
175 if (sof_ops(sdev)->runtime_idle) in snd_sof_dsp_runtime_idle()
176 return sof_ops(sdev)->runtime_idle(sdev); in snd_sof_dsp_runtime_idle()
181 static inline int snd_sof_dsp_hw_params_upon_resume(struct snd_sof_dev *sdev) in snd_sof_dsp_hw_params_upon_resume() argument
183 if (sof_ops(sdev)->set_hw_params_upon_resume) in snd_sof_dsp_hw_params_upon_resume()
184 return sof_ops(sdev)->set_hw_params_upon_resume(sdev); in snd_sof_dsp_hw_params_upon_resume()
188 static inline int snd_sof_dsp_set_clk(struct snd_sof_dev *sdev, u32 freq) in snd_sof_dsp_set_clk() argument
190 if (sof_ops(sdev)->set_clk) in snd_sof_dsp_set_clk()
191 return sof_ops(sdev)->set_clk(sdev, freq); in snd_sof_dsp_set_clk()
197 static inline void snd_sof_dsp_dbg_dump(struct snd_sof_dev *sdev, u32 flags) in snd_sof_dsp_dbg_dump() argument
199 if (sof_ops(sdev)->dbg_dump) in snd_sof_dsp_dbg_dump()
200 return sof_ops(sdev)->dbg_dump(sdev, flags); in snd_sof_dsp_dbg_dump()
203 static inline void snd_sof_ipc_dump(struct snd_sof_dev *sdev) in snd_sof_ipc_dump() argument
205 if (sof_ops(sdev)->ipc_dump) in snd_sof_ipc_dump()
206 return sof_ops(sdev)->ipc_dump(sdev); in snd_sof_ipc_dump()
210 static inline void snd_sof_dsp_write(struct snd_sof_dev *sdev, u32 bar, in snd_sof_dsp_write() argument
213 if (sof_ops(sdev)->write) { in snd_sof_dsp_write()
214 sof_ops(sdev)->write(sdev, sdev->bar[bar] + offset, value); in snd_sof_dsp_write()
218 dev_err_ratelimited(sdev->dev, "error: %s not defined\n", __func__); in snd_sof_dsp_write()
221 static inline void snd_sof_dsp_write64(struct snd_sof_dev *sdev, u32 bar, in snd_sof_dsp_write64() argument
224 if (sof_ops(sdev)->write64) { in snd_sof_dsp_write64()
225 sof_ops(sdev)->write64(sdev, sdev->bar[bar] + offset, value); in snd_sof_dsp_write64()
229 dev_err_ratelimited(sdev->dev, "error: %s not defined\n", __func__); in snd_sof_dsp_write64()
232 static inline u32 snd_sof_dsp_read(struct snd_sof_dev *sdev, u32 bar, in snd_sof_dsp_read() argument
235 if (sof_ops(sdev)->read) in snd_sof_dsp_read()
236 return sof_ops(sdev)->read(sdev, sdev->bar[bar] + offset); in snd_sof_dsp_read()
238 dev_err(sdev->dev, "error: %s not defined\n", __func__); in snd_sof_dsp_read()
242 static inline u64 snd_sof_dsp_read64(struct snd_sof_dev *sdev, u32 bar, in snd_sof_dsp_read64() argument
245 if (sof_ops(sdev)->read64) in snd_sof_dsp_read64()
246 return sof_ops(sdev)->read64(sdev, sdev->bar[bar] + offset); in snd_sof_dsp_read64()
248 dev_err(sdev->dev, "error: %s not defined\n", __func__); in snd_sof_dsp_read64()
253 static inline void snd_sof_dsp_block_read(struct snd_sof_dev *sdev, u32 bar, in snd_sof_dsp_block_read() argument
256 sof_ops(sdev)->block_read(sdev, bar, offset, dest, bytes); in snd_sof_dsp_block_read()
259 static inline void snd_sof_dsp_block_write(struct snd_sof_dev *sdev, u32 bar, in snd_sof_dsp_block_write() argument
262 sof_ops(sdev)->block_write(sdev, bar, offset, src, bytes); in snd_sof_dsp_block_write()
266 static inline int snd_sof_dsp_send_msg(struct snd_sof_dev *sdev, in snd_sof_dsp_send_msg() argument
269 return sof_ops(sdev)->send_msg(sdev, msg); in snd_sof_dsp_send_msg()
273 static inline int snd_sof_dma_trace_init(struct snd_sof_dev *sdev, in snd_sof_dma_trace_init() argument
276 if (sof_ops(sdev)->trace_init) in snd_sof_dma_trace_init()
277 return sof_ops(sdev)->trace_init(sdev, stream_tag); in snd_sof_dma_trace_init()
282 static inline int snd_sof_dma_trace_release(struct snd_sof_dev *sdev) in snd_sof_dma_trace_release() argument
284 if (sof_ops(sdev)->trace_release) in snd_sof_dma_trace_release()
285 return sof_ops(sdev)->trace_release(sdev); in snd_sof_dma_trace_release()
290 static inline int snd_sof_dma_trace_trigger(struct snd_sof_dev *sdev, int cmd) in snd_sof_dma_trace_trigger() argument
292 if (sof_ops(sdev)->trace_trigger) in snd_sof_dma_trace_trigger()
293 return sof_ops(sdev)->trace_trigger(sdev, cmd); in snd_sof_dma_trace_trigger()
300 snd_sof_pcm_platform_open(struct snd_sof_dev *sdev, in snd_sof_pcm_platform_open() argument
303 if (sof_ops(sdev) && sof_ops(sdev)->pcm_open) in snd_sof_pcm_platform_open()
304 return sof_ops(sdev)->pcm_open(sdev, substream); in snd_sof_pcm_platform_open()
311 snd_sof_pcm_platform_close(struct snd_sof_dev *sdev, in snd_sof_pcm_platform_close() argument
314 if (sof_ops(sdev) && sof_ops(sdev)->pcm_close) in snd_sof_pcm_platform_close()
315 return sof_ops(sdev)->pcm_close(sdev, substream); in snd_sof_pcm_platform_close()
322 snd_sof_pcm_platform_hw_params(struct snd_sof_dev *sdev, in snd_sof_pcm_platform_hw_params() argument
327 if (sof_ops(sdev) && sof_ops(sdev)->pcm_hw_params) in snd_sof_pcm_platform_hw_params()
328 return sof_ops(sdev)->pcm_hw_params(sdev, substream, in snd_sof_pcm_platform_hw_params()
336 snd_sof_pcm_platform_hw_free(struct snd_sof_dev *sdev, in snd_sof_pcm_platform_hw_free() argument
339 if (sof_ops(sdev) && sof_ops(sdev)->pcm_hw_free) in snd_sof_pcm_platform_hw_free()
340 return sof_ops(sdev)->pcm_hw_free(sdev, substream); in snd_sof_pcm_platform_hw_free()
347 snd_sof_pcm_platform_trigger(struct snd_sof_dev *sdev, in snd_sof_pcm_platform_trigger() argument
350 if (sof_ops(sdev) && sof_ops(sdev)->pcm_trigger) in snd_sof_pcm_platform_trigger()
351 return sof_ops(sdev)->pcm_trigger(sdev, substream, cmd); in snd_sof_pcm_platform_trigger()
357 static inline void snd_sof_ipc_msg_data(struct snd_sof_dev *sdev, in snd_sof_ipc_msg_data() argument
361 sof_ops(sdev)->ipc_msg_data(sdev, substream, p, sz); in snd_sof_ipc_msg_data()
366 snd_sof_ipc_pcm_params(struct snd_sof_dev *sdev, in snd_sof_ipc_pcm_params() argument
370 return sof_ops(sdev)->ipc_pcm_params(sdev, substream, reply); in snd_sof_ipc_pcm_params()
375 snd_sof_pcm_platform_pointer(struct snd_sof_dev *sdev, in snd_sof_pcm_platform_pointer() argument
378 if (sof_ops(sdev) && sof_ops(sdev)->pcm_pointer) in snd_sof_pcm_platform_pointer()
379 return sof_ops(sdev)->pcm_pointer(sdev, substream); in snd_sof_pcm_platform_pointer()
417 #define snd_sof_dsp_read_poll_timeout(sdev, bar, offset, val, cond, sleep_us, timeout_us) \ argument
424 (val) = snd_sof_dsp_read(sdev, bar, offset); \
426 dev_dbg(sdev->dev, \
432 (val) = snd_sof_dsp_read(sdev, bar, offset); \
433 dev_dbg(sdev->dev, \
444 bool snd_sof_pci_update_bits(struct snd_sof_dev *sdev, u32 offset,
447 bool snd_sof_dsp_update_bits_unlocked(struct snd_sof_dev *sdev, u32 bar,
450 bool snd_sof_dsp_update_bits64_unlocked(struct snd_sof_dev *sdev, u32 bar,
453 bool snd_sof_dsp_update_bits(struct snd_sof_dev *sdev, u32 bar, u32 offset,
456 bool snd_sof_dsp_update_bits64(struct snd_sof_dev *sdev, u32 bar,
459 void snd_sof_dsp_update_bits_forced(struct snd_sof_dev *sdev, u32 bar,
462 int snd_sof_dsp_register_poll(struct snd_sof_dev *sdev, u32 bar, u32 offset,
466 void snd_sof_dsp_panic(struct snd_sof_dev *sdev, u32 offset);