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));
262 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);
309 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);
331 struct catpt_dev *cdev = dev_get_drvdata(dai->dev);
362 ret = catpt_ipc_alloc_stream(cdev, stream->template->path_id,
368 cdev->scratch,
380 struct catpt_dev *cdev = dev_get_drvdata(dai->dev);
387 catpt_ipc_reset_stream(cdev, stream->info.stream_hw_id);
388 catpt_ipc_free_stream(cdev, stream->info.stream_hw_id);
394 static int catpt_set_dspvol(struct catpt_dev *cdev, u8 stream_id, long *ctlvol);
399 struct catpt_dev *cdev = dev_get_drvdata(dai->dev);
435 return catpt_set_dspvol(cdev, id, (long *)kctl->private_value);
436 ret = catpt_ipc_mute_loopback(cdev, id, *(bool *)kctl->private_value);
445 struct catpt_dev *cdev = dev_get_drvdata(dai->dev);
453 ret = catpt_ipc_reset_stream(cdev, stream->info.stream_hw_id);
457 ret = catpt_ipc_pause_stream(cdev, stream->info.stream_hw_id);
472 struct catpt_dev *cdev = dev_get_drvdata(dai->dev);
491 ret = catpt_ipc_set_write_pos(cdev, stream->info.stream_hw_id,
499 catpt_dsp_update_lpclock(cdev);
500 ret = catpt_ipc_resume_stream(cdev, stream->info.stream_hw_id);
510 ret = catpt_ipc_pause_stream(cdev, stream->info.stream_hw_id);
511 catpt_dsp_update_lpclock(cdev);
523 void catpt_stream_update_position(struct catpt_dev *cdev,
548 ret = catpt_ipc_set_write_pos(cdev, stream->info.stream_hw_id,
552 dev_err(cdev->dev, "update position for stream %d failed: %d\n",
585 struct catpt_dev *cdev = dev_get_drvdata(component->dev);
588 cdev->dev,
610 struct catpt_dev *cdev = dev_get_drvdata(component->dev);
620 pos = catpt_stream_read_position(cdev, stream);
638 struct catpt_dev *cdev = dev_get_drvdata(dai->dev);
670 if (!memcmp(&cdev->devfmt[devfmt.iface], &devfmt, sizeof(devfmt)))
673 pm_runtime_get_sync(cdev->dev);
675 ret = catpt_ipc_set_device_format(cdev, &devfmt);
677 pm_runtime_mark_last_busy(cdev->dev);
678 pm_runtime_put_autosuspend(cdev->dev);
684 memcpy(&cdev->devfmt[devfmt.iface], &devfmt, sizeof(devfmt));
810 static int catpt_set_dspvol(struct catpt_dev *cdev, u8 stream_id, long *ctlvol)
822 ret = catpt_ipc_set_volume(cdev, stream_id,
829 ret = catpt_ipc_set_volume(cdev, stream_id,
857 struct catpt_dev *cdev = dev_get_drvdata(component->dev);
861 pm_runtime_get_sync(cdev->dev);
864 dspvol = catpt_mixer_volume(cdev, &cdev->mixer, i);
868 pm_runtime_mark_last_busy(cdev->dev);
869 pm_runtime_put_autosuspend(cdev->dev);
879 struct catpt_dev *cdev = dev_get_drvdata(component->dev);
882 pm_runtime_get_sync(cdev->dev);
884 ret = catpt_set_dspvol(cdev, cdev->mixer.mixer_hw_id,
887 pm_runtime_mark_last_busy(cdev->dev);
888 pm_runtime_put_autosuspend(cdev->dev);
899 struct catpt_dev *cdev = dev_get_drvdata(component->dev);
905 stream = catpt_stream_find(cdev, pin_id);
912 pm_runtime_get_sync(cdev->dev);
915 dspvol = catpt_stream_volume(cdev, stream, i);
919 pm_runtime_mark_last_busy(cdev->dev);
920 pm_runtime_put_autosuspend(cdev->dev);
931 struct catpt_dev *cdev = dev_get_drvdata(component->dev);
936 stream = catpt_stream_find(cdev, pin_id);
943 pm_runtime_get_sync(cdev->dev);
945 ret = catpt_set_dspvol(cdev, stream->info.stream_hw_id,
948 pm_runtime_mark_last_busy(cdev->dev);
949 pm_runtime_put_autosuspend(cdev->dev);
1007 struct catpt_dev *cdev = dev_get_drvdata(component->dev);
1013 stream = catpt_stream_find(cdev, CATPT_PIN_ID_REFERENCE);
1019 pm_runtime_get_sync(cdev->dev);
1021 ret = catpt_ipc_mute_loopback(cdev, stream->info.stream_hw_id, mute);
1023 pm_runtime_mark_last_busy(cdev->dev);
1024 pm_runtime_put_autosuspend(cdev->dev);
1128 int catpt_arm_stream_templates(struct catpt_dev *cdev)
1144 type = &cdev->modules[entry->module_id];
1158 res = catpt_request_region(&cdev->dram, scratch_size);
1161 cdev->scratch = res;
1167 int catpt_register_plat_component(struct catpt_dev *cdev)
1172 component = devm_kzalloc(cdev->dev, sizeof(*component), GFP_KERNEL);
1177 cdev->dev);