Lines Matching refs:cdev
101 catpt_stream_find(struct catpt_dev *cdev, u8 stream_hw_id) in catpt_stream_find() argument
105 spin_lock(&cdev->list_lock); in catpt_stream_find()
106 list_for_each_entry(pos, &cdev->stream_list, node) { in catpt_stream_find()
113 spin_unlock(&cdev->list_lock); in catpt_stream_find()
117 static u32 catpt_stream_read_position(struct catpt_dev *cdev, in catpt_stream_read_position() argument
122 memcpy_fromio(&pos, cdev->lpe_ba + stream->info.read_pos_regaddr, in catpt_stream_read_position()
127 static u32 catpt_stream_volume(struct catpt_dev *cdev, in catpt_stream_volume() argument
136 memcpy_fromio(&volume, cdev->lpe_ba + offset, sizeof(volume)); in catpt_stream_volume()
140 static u32 catpt_mixer_volume(struct catpt_dev *cdev, in catpt_mixer_volume() argument
149 memcpy_fromio(&volume, cdev->lpe_ba + offset, sizeof(volume)); in catpt_mixer_volume()
262 struct catpt_dev *cdev = dev_get_drvdata(dai->dev); in catpt_dai_startup() local
274 ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, cdev->dev, PAGE_SIZE, in catpt_dai_startup()
279 res = catpt_request_region(&cdev->dram, template->persistent_size); in catpt_dai_startup()
285 catpt_dsp_update_srampge(cdev, &cdev->dram, cdev->spec->dram_mask); in catpt_dai_startup()
293 spin_lock(&cdev->list_lock); in catpt_dai_startup()
294 list_add_tail(&stream->node, &cdev->stream_list); in catpt_dai_startup()
295 spin_unlock(&cdev->list_lock); in catpt_dai_startup()
309 struct catpt_dev *cdev = dev_get_drvdata(dai->dev); in catpt_dai_shutdown() local
314 spin_lock(&cdev->list_lock); in catpt_dai_shutdown()
316 spin_unlock(&cdev->list_lock); in catpt_dai_shutdown()
320 catpt_dsp_update_srampge(cdev, &cdev->dram, cdev->spec->dram_mask); in catpt_dai_shutdown()
331 struct catpt_dev *cdev = dev_get_drvdata(dai->dev); in catpt_dai_hw_params() local
362 ret = catpt_ipc_alloc_stream(cdev, stream->template->path_id, in catpt_dai_hw_params()
368 cdev->scratch, in catpt_dai_hw_params()
380 struct catpt_dev *cdev = dev_get_drvdata(dai->dev); in catpt_dai_hw_free() local
387 catpt_ipc_reset_stream(cdev, stream->info.stream_hw_id); in catpt_dai_hw_free()
388 catpt_ipc_free_stream(cdev, stream->info.stream_hw_id); in catpt_dai_hw_free()
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); in catpt_dai_apply_usettings() local
435 return catpt_set_dspvol(cdev, id, (long *)kctl->private_value); in catpt_dai_apply_usettings()
436 ret = catpt_ipc_mute_loopback(cdev, id, *(bool *)kctl->private_value); in catpt_dai_apply_usettings()
445 struct catpt_dev *cdev = dev_get_drvdata(dai->dev); in catpt_dai_prepare() local
453 ret = catpt_ipc_reset_stream(cdev, stream->info.stream_hw_id); in catpt_dai_prepare()
457 ret = catpt_ipc_pause_stream(cdev, stream->info.stream_hw_id); in catpt_dai_prepare()
472 struct catpt_dev *cdev = dev_get_drvdata(dai->dev); in catpt_dai_trigger() local
491 ret = catpt_ipc_set_write_pos(cdev, stream->info.stream_hw_id, in catpt_dai_trigger()
499 catpt_dsp_update_lpclock(cdev); in catpt_dai_trigger()
500 ret = catpt_ipc_resume_stream(cdev, stream->info.stream_hw_id); in catpt_dai_trigger()
510 ret = catpt_ipc_pause_stream(cdev, stream->info.stream_hw_id); in catpt_dai_trigger()
511 catpt_dsp_update_lpclock(cdev); in catpt_dai_trigger()
523 void catpt_stream_update_position(struct catpt_dev *cdev, in catpt_stream_update_position() argument
548 ret = catpt_ipc_set_write_pos(cdev, stream->info.stream_hw_id, in catpt_stream_update_position()
552 dev_err(cdev->dev, "update position for stream %d failed: %d\n", in catpt_stream_update_position()
585 struct catpt_dev *cdev = dev_get_drvdata(component->dev); in catpt_component_pcm_construct() local
588 cdev->dev, in catpt_component_pcm_construct()
610 struct catpt_dev *cdev = dev_get_drvdata(component->dev); in catpt_component_pointer() local
620 pos = catpt_stream_read_position(cdev, stream); in catpt_component_pointer()
638 struct catpt_dev *cdev = dev_get_drvdata(dai->dev); in catpt_dai_pcm_new() local
670 if (!memcmp(&cdev->devfmt[devfmt.iface], &devfmt, sizeof(devfmt))) in catpt_dai_pcm_new()
673 pm_runtime_get_sync(cdev->dev); in catpt_dai_pcm_new()
675 ret = catpt_ipc_set_device_format(cdev, &devfmt); in catpt_dai_pcm_new()
677 pm_runtime_mark_last_busy(cdev->dev); in catpt_dai_pcm_new()
678 pm_runtime_put_autosuspend(cdev->dev); in catpt_dai_pcm_new()
684 memcpy(&cdev->devfmt[devfmt.iface], &devfmt, sizeof(devfmt)); in catpt_dai_pcm_new()
810 static int catpt_set_dspvol(struct catpt_dev *cdev, u8 stream_id, long *ctlvol) in catpt_set_dspvol() argument
822 ret = catpt_ipc_set_volume(cdev, stream_id, in catpt_set_dspvol()
829 ret = catpt_ipc_set_volume(cdev, stream_id, in catpt_set_dspvol()
857 struct catpt_dev *cdev = dev_get_drvdata(component->dev); in catpt_mixer_volume_get() local
861 pm_runtime_get_sync(cdev->dev); in catpt_mixer_volume_get()
864 dspvol = catpt_mixer_volume(cdev, &cdev->mixer, i); in catpt_mixer_volume_get()
868 pm_runtime_mark_last_busy(cdev->dev); in catpt_mixer_volume_get()
869 pm_runtime_put_autosuspend(cdev->dev); in catpt_mixer_volume_get()
879 struct catpt_dev *cdev = dev_get_drvdata(component->dev); in catpt_mixer_volume_put() local
882 pm_runtime_get_sync(cdev->dev); in catpt_mixer_volume_put()
884 ret = catpt_set_dspvol(cdev, cdev->mixer.mixer_hw_id, in catpt_mixer_volume_put()
887 pm_runtime_mark_last_busy(cdev->dev); in catpt_mixer_volume_put()
888 pm_runtime_put_autosuspend(cdev->dev); in catpt_mixer_volume_put()
899 struct catpt_dev *cdev = dev_get_drvdata(component->dev); in catpt_stream_volume_get() local
905 stream = catpt_stream_find(cdev, pin_id); in catpt_stream_volume_get()
912 pm_runtime_get_sync(cdev->dev); in catpt_stream_volume_get()
915 dspvol = catpt_stream_volume(cdev, stream, i); in catpt_stream_volume_get()
919 pm_runtime_mark_last_busy(cdev->dev); in catpt_stream_volume_get()
920 pm_runtime_put_autosuspend(cdev->dev); in catpt_stream_volume_get()
931 struct catpt_dev *cdev = dev_get_drvdata(component->dev); in catpt_stream_volume_put() local
936 stream = catpt_stream_find(cdev, pin_id); in catpt_stream_volume_put()
943 pm_runtime_get_sync(cdev->dev); in catpt_stream_volume_put()
945 ret = catpt_set_dspvol(cdev, stream->info.stream_hw_id, in catpt_stream_volume_put()
948 pm_runtime_mark_last_busy(cdev->dev); in catpt_stream_volume_put()
949 pm_runtime_put_autosuspend(cdev->dev); in catpt_stream_volume_put()
1007 struct catpt_dev *cdev = dev_get_drvdata(component->dev); in catpt_loopback_switch_put() local
1013 stream = catpt_stream_find(cdev, CATPT_PIN_ID_REFERENCE); in catpt_loopback_switch_put()
1019 pm_runtime_get_sync(cdev->dev); in catpt_loopback_switch_put()
1021 ret = catpt_ipc_mute_loopback(cdev, stream->info.stream_hw_id, mute); in catpt_loopback_switch_put()
1023 pm_runtime_mark_last_busy(cdev->dev); in catpt_loopback_switch_put()
1024 pm_runtime_put_autosuspend(cdev->dev); in catpt_loopback_switch_put()
1128 int catpt_arm_stream_templates(struct catpt_dev *cdev) in catpt_arm_stream_templates() argument
1144 type = &cdev->modules[entry->module_id]; in catpt_arm_stream_templates()
1158 res = catpt_request_region(&cdev->dram, scratch_size); in catpt_arm_stream_templates()
1161 cdev->scratch = res; in catpt_arm_stream_templates()
1167 int catpt_register_plat_component(struct catpt_dev *cdev) in catpt_register_plat_component() argument
1172 component = devm_kzalloc(cdev->dev, sizeof(*component), GFP_KERNEL); in catpt_register_plat_component()
1177 cdev->dev); in catpt_register_plat_component()