Lines Matching +full:stream +full:- +full:match +full:- +full:mask

1 // SPDX-License-Identifier: GPL-2.0 OR MIT
4 * Xen para-virtual sound device
6 * Copyright (C) 2016-2018 EPAM Systems Inc.
23 unsigned int mask; member
28 { .name = "5512", .mask = SNDRV_PCM_RATE_5512, .value = 5512 },
29 { .name = "8000", .mask = SNDRV_PCM_RATE_8000, .value = 8000 },
30 { .name = "11025", .mask = SNDRV_PCM_RATE_11025, .value = 11025 },
31 { .name = "16000", .mask = SNDRV_PCM_RATE_16000, .value = 16000 },
32 { .name = "22050", .mask = SNDRV_PCM_RATE_22050, .value = 22050 },
33 { .name = "32000", .mask = SNDRV_PCM_RATE_32000, .value = 32000 },
34 { .name = "44100", .mask = SNDRV_PCM_RATE_44100, .value = 44100 },
35 { .name = "48000", .mask = SNDRV_PCM_RATE_48000, .value = 48000 },
36 { .name = "64000", .mask = SNDRV_PCM_RATE_64000, .value = 64000 },
37 { .name = "96000", .mask = SNDRV_PCM_RATE_96000, .value = 96000 },
38 { .name = "176400", .mask = SNDRV_PCM_RATE_176400, .value = 176400 },
39 { .name = "192000", .mask = SNDRV_PCM_RATE_192000, .value = 192000 },
44 u64 mask; member
50 .mask = SNDRV_PCM_FMTBIT_U8
54 .mask = SNDRV_PCM_FMTBIT_S8
58 .mask = SNDRV_PCM_FMTBIT_U16_LE
62 .mask = SNDRV_PCM_FMTBIT_U16_BE
66 .mask = SNDRV_PCM_FMTBIT_S16_LE
70 .mask = SNDRV_PCM_FMTBIT_S16_BE
74 .mask = SNDRV_PCM_FMTBIT_U24_LE
78 .mask = SNDRV_PCM_FMTBIT_U24_BE
82 .mask = SNDRV_PCM_FMTBIT_S24_LE
86 .mask = SNDRV_PCM_FMTBIT_S24_BE
90 .mask = SNDRV_PCM_FMTBIT_U32_LE
94 .mask = SNDRV_PCM_FMTBIT_U32_BE
98 .mask = SNDRV_PCM_FMTBIT_S32_LE
102 .mask = SNDRV_PCM_FMTBIT_S32_BE
106 .mask = SNDRV_PCM_FMTBIT_A_LAW
110 .mask = SNDRV_PCM_FMTBIT_MU_LAW
114 .mask = SNDRV_PCM_FMTBIT_FLOAT_LE
118 .mask = SNDRV_PCM_FMTBIT_FLOAT_BE
122 .mask = SNDRV_PCM_FMTBIT_FLOAT64_LE
126 .mask = SNDRV_PCM_FMTBIT_FLOAT64_BE
130 .mask = SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE
134 .mask = SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_BE
138 .mask = SNDRV_PCM_FMTBIT_IMA_ADPCM
142 .mask = SNDRV_PCM_FMTBIT_MPEG
146 .mask = SNDRV_PCM_FMTBIT_GSM
162 rate_min = -1; in cfg_hw_rates()
169 cur_mask = CFG_HW_SUPPORTED_RATES[i].mask; in cfg_hw_rates()
180 pcm_hw->rates = rates; in cfg_hw_rates()
181 pcm_hw->rate_min = rate_min; in cfg_hw_rates()
182 pcm_hw->rate_max = rate_max; in cfg_hw_rates()
199 formats |= CFG_HW_SUPPORTED_FORMATS[i].mask; in cfg_formats()
203 pcm_hw->formats = formats; in cfg_formats()
256 pcm_hw->channels_min = val; in cfg_read_pcm_hw()
260 pcm_hw->channels_max = val; in cfg_read_pcm_hw()
276 pcm_hw->buffer_bytes_max = buf_sz; in cfg_read_pcm_hw()
278 /* Update configuration to match new values. */ in cfg_read_pcm_hw()
279 if (pcm_hw->channels_min > pcm_hw->channels_max) in cfg_read_pcm_hw()
280 pcm_hw->channels_min = pcm_hw->channels_max; in cfg_read_pcm_hw()
282 if (pcm_hw->rate_min > pcm_hw->rate_max) in cfg_read_pcm_hw()
283 pcm_hw->rate_min = pcm_hw->rate_max; in cfg_read_pcm_hw()
285 pcm_hw->period_bytes_max = pcm_hw->buffer_bytes_max; in cfg_read_pcm_hw()
287 pcm_hw->periods_max = pcm_hw->period_bytes_max / in cfg_read_pcm_hw()
288 pcm_hw->period_bytes_min; in cfg_read_pcm_hw()
302 ret = -ENOMEM; in cfg_get_stream_type()
320 ret = -EINVAL; in cfg_get_stream_type()
338 struct xen_front_cfg_stream *stream; in cfg_stream() local
341 stream_path = devm_kasprintf(&front_info->xb_dev->dev, in cfg_stream()
344 ret = -ENOMEM; in cfg_stream()
357 stream = &pcm_instance->streams_pb[(*cur_pb)++]; in cfg_stream()
360 stream = &pcm_instance->streams_cap[(*cur_cap)++]; in cfg_stream()
362 ret = -EINVAL; in cfg_stream()
366 /* Get next stream index. */ in cfg_stream()
367 stream->index = (*stream_cnt)++; in cfg_stream()
368 stream->xenstore_path = stream_path; in cfg_stream()
370 * Check XenStore if PCM HW configuration exists for this stream in cfg_stream()
372 * but can still override some of the values for the stream. in cfg_stream()
374 cfg_read_pcm_hw(stream->xenstore_path, in cfg_stream()
375 &pcm_instance->pcm_hw, &stream->pcm_hw); in cfg_stream()
397 return -ENOMEM; in cfg_device()
401 strlcpy(pcm_instance->name, str, sizeof(pcm_instance->name)); in cfg_device()
405 pcm_instance->device_id = node_index; in cfg_device()
412 cfg_read_pcm_hw(device_path, parent_pcm_hw, &pcm_instance->pcm_hw); in cfg_device()
424 pcm_instance->num_streams_pb = 0; in cfg_device()
425 pcm_instance->num_streams_cap = 0; in cfg_device()
432 pcm_instance->num_streams_pb += num_pb; in cfg_device()
433 pcm_instance->num_streams_cap += num_cap; in cfg_device()
436 if (pcm_instance->num_streams_pb) { in cfg_device()
437 pcm_instance->streams_pb = in cfg_device()
438 devm_kcalloc(&front_info->xb_dev->dev, in cfg_device()
439 pcm_instance->num_streams_pb, in cfg_device()
442 if (!pcm_instance->streams_pb) { in cfg_device()
443 ret = -ENOMEM; in cfg_device()
448 if (pcm_instance->num_streams_cap) { in cfg_device()
449 pcm_instance->streams_cap = in cfg_device()
450 devm_kcalloc(&front_info->xb_dev->dev, in cfg_device()
451 pcm_instance->num_streams_cap, in cfg_device()
454 if (!pcm_instance->streams_cap) { in cfg_device()
455 ret = -ENOMEM; in cfg_device()
478 struct xenbus_device *xb_dev = front_info->xb_dev; in xen_snd_front_cfg_card()
479 struct xen_front_cfg_card *cfg = &front_info->cfg; in xen_snd_front_cfg_card()
487 if (!xenbus_exists(XBT_NIL, xb_dev->nodename, node)) in xen_snd_front_cfg_card()
494 dev_warn(&xb_dev->dev, in xen_snd_front_cfg_card()
496 xb_dev->nodename); in xen_snd_front_cfg_card()
497 return -ENODEV; in xen_snd_front_cfg_card()
501 cfg_read_pcm_hw(xb_dev->nodename, NULL, &cfg->pcm_hw); in xen_snd_front_cfg_card()
503 cfg->pcm_instances = in xen_snd_front_cfg_card()
504 devm_kcalloc(&front_info->xb_dev->dev, num_devices, in xen_snd_front_cfg_card()
507 if (!cfg->pcm_instances) in xen_snd_front_cfg_card()
508 return -ENOMEM; in xen_snd_front_cfg_card()
511 ret = cfg_device(front_info, &cfg->pcm_instances[i], in xen_snd_front_cfg_card()
512 &cfg->pcm_hw, xb_dev->nodename, i, stream_cnt); in xen_snd_front_cfg_card()
516 cfg->num_pcm_instances = num_devices; in xen_snd_front_cfg_card()