Lines Matching refs:sdev
21 #define sof_ops(sdev) \
22 ((sdev)->pdata->desc->ops)
27 static inline int snd_sof_probe(struct snd_sof_dev *sdev)
29 return sof_ops(sdev)->probe(sdev);
32 static inline int snd_sof_remove(struct snd_sof_dev *sdev)
34 if (sof_ops(sdev)->remove)
35 return sof_ops(sdev)->remove(sdev);
46 static inline int snd_sof_dsp_run(struct snd_sof_dev *sdev)
48 return sof_ops(sdev)->run(sdev);
51 static inline int snd_sof_dsp_stall(struct snd_sof_dev *sdev)
53 if (sof_ops(sdev)->stall)
54 return sof_ops(sdev)->stall(sdev);
59 static inline int snd_sof_dsp_reset(struct snd_sof_dev *sdev)
61 if (sof_ops(sdev)->reset)
62 return sof_ops(sdev)->reset(sdev);
68 static inline int snd_sof_dsp_core_power_up(struct snd_sof_dev *sdev,
71 if (sof_ops(sdev)->core_power_up)
72 return sof_ops(sdev)->core_power_up(sdev, core_mask);
77 static inline int snd_sof_dsp_core_power_down(struct snd_sof_dev *sdev,
80 if (sof_ops(sdev)->core_power_down)
81 return sof_ops(sdev)->core_power_down(sdev, core_mask);
87 static inline int snd_sof_dsp_pre_fw_run(struct snd_sof_dev *sdev)
89 if (sof_ops(sdev)->pre_fw_run)
90 return sof_ops(sdev)->pre_fw_run(sdev);
95 static inline int snd_sof_dsp_post_fw_run(struct snd_sof_dev *sdev)
97 if (sof_ops(sdev)->post_fw_run)
98 return sof_ops(sdev)->post_fw_run(sdev);
108 * @sdev: sof device
114 static inline int snd_sof_dsp_get_bar_index(struct snd_sof_dev *sdev, u32 type)
116 if (sof_ops(sdev)->get_bar_index)
117 return sof_ops(sdev)->get_bar_index(sdev, type);
119 return sdev->mmio_bar;
122 static inline int snd_sof_dsp_get_mailbox_offset(struct snd_sof_dev *sdev)
124 if (sof_ops(sdev)->get_mailbox_offset)
125 return sof_ops(sdev)->get_mailbox_offset(sdev);
127 dev_err(sdev->dev, "error: %s not defined\n", __func__);
131 static inline int snd_sof_dsp_get_window_offset(struct snd_sof_dev *sdev,
134 if (sof_ops(sdev)->get_window_offset)
135 return sof_ops(sdev)->get_window_offset(sdev, id);
137 dev_err(sdev->dev, "error: %s not defined\n", __func__);
141 static inline int snd_sof_dsp_resume(struct snd_sof_dev *sdev)
143 if (sof_ops(sdev)->resume)
144 return sof_ops(sdev)->resume(sdev);
149 static inline int snd_sof_dsp_suspend(struct snd_sof_dev *sdev,
152 if (sof_ops(sdev)->suspend)
153 return sof_ops(sdev)->suspend(sdev, target_state);
158 static inline int snd_sof_dsp_runtime_resume(struct snd_sof_dev *sdev)
160 if (sof_ops(sdev)->runtime_resume)
161 return sof_ops(sdev)->runtime_resume(sdev);
166 static inline int snd_sof_dsp_runtime_suspend(struct snd_sof_dev *sdev)
168 if (sof_ops(sdev)->runtime_suspend)
169 return sof_ops(sdev)->runtime_suspend(sdev);
174 static inline int snd_sof_dsp_runtime_idle(struct snd_sof_dev *sdev)
176 if (sof_ops(sdev)->runtime_idle)
177 return sof_ops(sdev)->runtime_idle(sdev);
182 static inline int snd_sof_dsp_hw_params_upon_resume(struct snd_sof_dev *sdev)
184 if (sof_ops(sdev)->set_hw_params_upon_resume)
185 return sof_ops(sdev)->set_hw_params_upon_resume(sdev);
189 static inline int snd_sof_dsp_set_clk(struct snd_sof_dev *sdev, u32 freq)
191 if (sof_ops(sdev)->set_clk)
192 return sof_ops(sdev)->set_clk(sdev, freq);
198 snd_sof_dsp_set_power_state(struct snd_sof_dev *sdev,
201 if (sof_ops(sdev)->set_power_state)
202 return sof_ops(sdev)->set_power_state(sdev, target_state);
209 static inline void snd_sof_dsp_dbg_dump(struct snd_sof_dev *sdev, u32 flags)
211 if (sof_ops(sdev)->dbg_dump)
212 return sof_ops(sdev)->dbg_dump(sdev, flags);
215 static inline void snd_sof_ipc_dump(struct snd_sof_dev *sdev)
217 if (sof_ops(sdev)->ipc_dump)
218 return sof_ops(sdev)->ipc_dump(sdev);
222 static inline void snd_sof_dsp_write(struct snd_sof_dev *sdev, u32 bar,
225 if (sof_ops(sdev)->write) {
226 sof_ops(sdev)->write(sdev, sdev->bar[bar] + offset, value);
230 dev_err_ratelimited(sdev->dev, "error: %s not defined\n", __func__);
233 static inline void snd_sof_dsp_write64(struct snd_sof_dev *sdev, u32 bar,
236 if (sof_ops(sdev)->write64) {
237 sof_ops(sdev)->write64(sdev, sdev->bar[bar] + offset, value);
241 dev_err_ratelimited(sdev->dev, "error: %s not defined\n", __func__);
244 static inline u32 snd_sof_dsp_read(struct snd_sof_dev *sdev, u32 bar,
247 if (sof_ops(sdev)->read)
248 return sof_ops(sdev)->read(sdev, sdev->bar[bar] + offset);
250 dev_err(sdev->dev, "error: %s not defined\n", __func__);
254 static inline u64 snd_sof_dsp_read64(struct snd_sof_dev *sdev, u32 bar,
257 if (sof_ops(sdev)->read64)
258 return sof_ops(sdev)->read64(sdev, sdev->bar[bar] + offset);
260 dev_err(sdev->dev, "error: %s not defined\n", __func__);
265 static inline void snd_sof_dsp_block_read(struct snd_sof_dev *sdev, u32 bar,
268 sof_ops(sdev)->block_read(sdev, bar, offset, dest, bytes);
271 static inline void snd_sof_dsp_block_write(struct snd_sof_dev *sdev, u32 bar,
274 sof_ops(sdev)->block_write(sdev, bar, offset, src, bytes);
278 static inline int snd_sof_dsp_send_msg(struct snd_sof_dev *sdev,
281 return sof_ops(sdev)->send_msg(sdev, msg);
285 static inline int snd_sof_dma_trace_init(struct snd_sof_dev *sdev,
288 if (sof_ops(sdev)->trace_init)
289 return sof_ops(sdev)->trace_init(sdev, stream_tag);
294 static inline int snd_sof_dma_trace_release(struct snd_sof_dev *sdev)
296 if (sof_ops(sdev)->trace_release)
297 return sof_ops(sdev)->trace_release(sdev);
302 static inline int snd_sof_dma_trace_trigger(struct snd_sof_dev *sdev, int cmd)
304 if (sof_ops(sdev)->trace_trigger)
305 return sof_ops(sdev)->trace_trigger(sdev, cmd);
312 snd_sof_pcm_platform_open(struct snd_sof_dev *sdev,
315 if (sof_ops(sdev) && sof_ops(sdev)->pcm_open)
316 return sof_ops(sdev)->pcm_open(sdev, substream);
323 snd_sof_pcm_platform_close(struct snd_sof_dev *sdev,
326 if (sof_ops(sdev) && sof_ops(sdev)->pcm_close)
327 return sof_ops(sdev)->pcm_close(sdev, substream);
334 snd_sof_pcm_platform_hw_params(struct snd_sof_dev *sdev,
339 if (sof_ops(sdev) && sof_ops(sdev)->pcm_hw_params)
340 return sof_ops(sdev)->pcm_hw_params(sdev, substream,
348 snd_sof_pcm_platform_hw_free(struct snd_sof_dev *sdev,
351 if (sof_ops(sdev) && sof_ops(sdev)->pcm_hw_free)
352 return sof_ops(sdev)->pcm_hw_free(sdev, substream);
359 snd_sof_pcm_platform_trigger(struct snd_sof_dev *sdev,
362 if (sof_ops(sdev) && sof_ops(sdev)->pcm_trigger)
363 return sof_ops(sdev)->pcm_trigger(sdev, substream, cmd);
369 static inline void snd_sof_ipc_msg_data(struct snd_sof_dev *sdev,
373 sof_ops(sdev)->ipc_msg_data(sdev, substream, p, sz);
378 snd_sof_ipc_pcm_params(struct snd_sof_dev *sdev,
382 return sof_ops(sdev)->ipc_pcm_params(sdev, substream, reply);
387 snd_sof_pcm_platform_pointer(struct snd_sof_dev *sdev,
390 if (sof_ops(sdev) && sof_ops(sdev)->pcm_pointer)
391 return sof_ops(sdev)->pcm_pointer(sdev, substream);
398 snd_sof_probe_compr_assign(struct snd_sof_dev *sdev,
401 return sof_ops(sdev)->probe_assign(sdev, cstream, dai);
405 snd_sof_probe_compr_free(struct snd_sof_dev *sdev,
408 return sof_ops(sdev)->probe_free(sdev, cstream, dai);
412 snd_sof_probe_compr_set_params(struct snd_sof_dev *sdev,
416 return sof_ops(sdev)->probe_set_params(sdev, cstream, params, dai);
420 snd_sof_probe_compr_trigger(struct snd_sof_dev *sdev,
424 return sof_ops(sdev)->probe_trigger(sdev, cstream, cmd, dai);
428 snd_sof_probe_compr_pointer(struct snd_sof_dev *sdev,
432 if (sof_ops(sdev) && sof_ops(sdev)->probe_pointer)
433 return sof_ops(sdev)->probe_pointer(sdev, cstream, tstamp, dai);
441 snd_sof_machine_register(struct snd_sof_dev *sdev, void *pdata)
443 if (sof_ops(sdev) && sof_ops(sdev)->machine_register)
444 return sof_ops(sdev)->machine_register(sdev, pdata);
450 snd_sof_machine_unregister(struct snd_sof_dev *sdev, void *pdata)
452 if (sof_ops(sdev) && sof_ops(sdev)->machine_unregister)
453 sof_ops(sdev)->machine_unregister(sdev, pdata);
457 snd_sof_machine_select(struct snd_sof_dev *sdev)
459 if (sof_ops(sdev) && sof_ops(sdev)->machine_select)
460 sof_ops(sdev)->machine_select(sdev);
467 struct snd_sof_dev *sdev = dev_get_drvdata(dev);
469 if (sof_ops(sdev) && sof_ops(sdev)->set_mach_params)
470 sof_ops(sdev)->set_mach_params(mach, dev);
506 #define snd_sof_dsp_read_poll_timeout(sdev, bar, offset, val, cond, sleep_us, timeout_us) \
513 (val) = snd_sof_dsp_read(sdev, bar, offset); \
515 dev_dbg(sdev->dev, \
521 (val) = snd_sof_dsp_read(sdev, bar, offset); \
522 dev_dbg(sdev->dev, \
533 bool snd_sof_pci_update_bits(struct snd_sof_dev *sdev, u32 offset,
536 bool snd_sof_dsp_update_bits_unlocked(struct snd_sof_dev *sdev, u32 bar,
539 bool snd_sof_dsp_update_bits64_unlocked(struct snd_sof_dev *sdev, u32 bar,
542 bool snd_sof_dsp_update_bits(struct snd_sof_dev *sdev, u32 bar, u32 offset,
545 bool snd_sof_dsp_update_bits64(struct snd_sof_dev *sdev, u32 bar,
548 void snd_sof_dsp_update_bits_forced(struct snd_sof_dev *sdev, u32 bar,
551 int snd_sof_dsp_register_poll(struct snd_sof_dev *sdev, u32 bar, u32 offset,
555 void snd_sof_dsp_panic(struct snd_sof_dev *sdev, u32 offset);