Lines Matching defs:cdev
101 catpt_stream_find(struct catpt_dev *cdev, u8 stream_hw_id)
105 spin_lock(&cdev->list_lock);
106 list_for_each_entry(pos, &cdev->stream_list, node) {
113 spin_unlock(&cdev->list_lock);
117 static u32 catpt_stream_read_position(struct catpt_dev *cdev,
122 memcpy_fromio(&pos, cdev->lpe_ba + stream->info.read_pos_regaddr,
127 static u32 catpt_stream_volume(struct catpt_dev *cdev,
136 memcpy_fromio(&volume, cdev->lpe_ba + offset, sizeof(volume));
140 static u32 catpt_mixer_volume(struct catpt_dev *cdev,
149 memcpy_fromio(&volume, cdev->lpe_ba + offset, sizeof(volume));
264 struct catpt_dev *cdev = dev_get_drvdata(dai->dev);
274 ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, cdev->dev, PAGE_SIZE,
279 res = catpt_request_region(&cdev->dram, template->persistent_size);
285 catpt_dsp_update_srampge(cdev, &cdev->dram, cdev->spec->dram_mask);
293 spin_lock(&cdev->list_lock);
294 list_add_tail(&stream->node, &cdev->stream_list);
295 spin_unlock(&cdev->list_lock);
310 struct catpt_dev *cdev = dev_get_drvdata(dai->dev);
314 spin_lock(&cdev->list_lock);
316 spin_unlock(&cdev->list_lock);
320 catpt_dsp_update_srampge(cdev, &cdev->dram, cdev->spec->dram_mask);
327 static int catpt_set_dspvol(struct catpt_dev *cdev, u8 stream_id, long *ctlvol);
334 struct catpt_dev *cdev = dev_get_drvdata(dai->dev);
366 return catpt_set_dspvol(cdev, id, (long *)pos->private_value);
367 ret = catpt_ipc_mute_loopback(cdev, id, *(bool *)pos->private_value);
382 struct catpt_dev *cdev = dev_get_drvdata(dai->dev);
408 ret = catpt_ipc_alloc_stream(cdev, stream->template->path_id,
414 cdev->scratch,
431 struct catpt_dev *cdev = dev_get_drvdata(dai->dev);
437 catpt_ipc_reset_stream(cdev, stream->info.stream_hw_id);
438 catpt_ipc_free_stream(cdev, stream->info.stream_hw_id);
448 struct catpt_dev *cdev = dev_get_drvdata(dai->dev);
455 ret = catpt_ipc_reset_stream(cdev, stream->info.stream_hw_id);
459 ret = catpt_ipc_pause_stream(cdev, stream->info.stream_hw_id);
472 struct catpt_dev *cdev = dev_get_drvdata(dai->dev);
489 ret = catpt_ipc_set_write_pos(cdev, stream->info.stream_hw_id,
497 catpt_dsp_update_lpclock(cdev);
498 ret = catpt_ipc_resume_stream(cdev, stream->info.stream_hw_id);
508 ret = catpt_ipc_pause_stream(cdev, stream->info.stream_hw_id);
509 catpt_dsp_update_lpclock(cdev);
521 void catpt_stream_update_position(struct catpt_dev *cdev,
546 ret = catpt_ipc_set_write_pos(cdev, stream->info.stream_hw_id,
550 dev_err(cdev->dev, "update position for stream %d failed: %d\n",
583 struct catpt_dev *cdev = dev_get_drvdata(component->dev);
586 cdev->dev,
610 struct catpt_dev *cdev = dev_get_drvdata(component->dev);
617 pos = catpt_stream_read_position(cdev, stream);
636 struct catpt_dev *cdev = dev_get_drvdata(dai->dev);
667 if (!memcmp(&cdev->devfmt[devfmt.iface], &devfmt, sizeof(devfmt)))
670 ret = pm_runtime_resume_and_get(cdev->dev);
674 ret = catpt_ipc_set_device_format(cdev, &devfmt);
676 pm_runtime_mark_last_busy(cdev->dev);
677 pm_runtime_put_autosuspend(cdev->dev);
683 memcpy(&cdev->devfmt[devfmt.iface], &devfmt, sizeof(devfmt));
813 static int catpt_set_dspvol(struct catpt_dev *cdev, u8 stream_id, long *ctlvol)
825 ret = catpt_ipc_set_volume(cdev, stream_id,
832 ret = catpt_ipc_set_volume(cdev, stream_id,
860 struct catpt_dev *cdev = dev_get_drvdata(component->dev);
865 ret = pm_runtime_resume_and_get(cdev->dev);
870 dspvol = catpt_mixer_volume(cdev, &cdev->mixer, i);
874 pm_runtime_mark_last_busy(cdev->dev);
875 pm_runtime_put_autosuspend(cdev->dev);
885 struct catpt_dev *cdev = dev_get_drvdata(component->dev);
888 ret = pm_runtime_resume_and_get(cdev->dev);
892 ret = catpt_set_dspvol(cdev, cdev->mixer.mixer_hw_id,
895 pm_runtime_mark_last_busy(cdev->dev);
896 pm_runtime_put_autosuspend(cdev->dev);
908 struct catpt_dev *cdev = dev_get_drvdata(component->dev);
914 stream = catpt_stream_find(cdev, pin_id);
921 ret = pm_runtime_resume_and_get(cdev->dev);
926 dspvol = catpt_stream_volume(cdev, stream, i);
930 pm_runtime_mark_last_busy(cdev->dev);
931 pm_runtime_put_autosuspend(cdev->dev);
943 struct catpt_dev *cdev = dev_get_drvdata(component->dev);
947 stream = catpt_stream_find(cdev, pin_id);
954 ret = pm_runtime_resume_and_get(cdev->dev);
958 ret = catpt_set_dspvol(cdev, stream->info.stream_hw_id,
961 pm_runtime_mark_last_busy(cdev->dev);
962 pm_runtime_put_autosuspend(cdev->dev);
1021 struct catpt_dev *cdev = dev_get_drvdata(component->dev);
1026 stream = catpt_stream_find(cdev, CATPT_PIN_ID_REFERENCE);
1032 ret = pm_runtime_resume_and_get(cdev->dev);
1036 ret = catpt_ipc_mute_loopback(cdev, stream->info.stream_hw_id, mute);
1038 pm_runtime_mark_last_busy(cdev->dev);
1039 pm_runtime_put_autosuspend(cdev->dev);
1143 int catpt_arm_stream_templates(struct catpt_dev *cdev)
1159 type = &cdev->modules[entry->module_id];
1173 res = catpt_request_region(&cdev->dram, scratch_size);
1176 cdev->scratch = res;
1182 int catpt_register_plat_component(struct catpt_dev *cdev)
1187 component = devm_kzalloc(cdev->dev, sizeof(*component), GFP_KERNEL);
1192 cdev->dev);