Lines Matching +full:pdm +full:- +full:fmt

1 // SPDX-License-Identifier: GPL-2.0
3 // test-component.c -- Test Audio Component driver
38 #define mile_stone(d) dev_info((d)->dev, "%s() : %s", __func__, (d)->driver->name)
64 static int test_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) in test_dai_set_fmt() argument
66 unsigned int format = fmt & SND_SOC_DAIFMT_FORMAT_MASK; in test_dai_set_fmt()
67 unsigned int clock = fmt & SND_SOC_DAIFMT_CLOCK_MASK; in test_dai_set_fmt()
68 unsigned int inv = fmt & SND_SOC_DAIFMT_INV_MASK; in test_dai_set_fmt()
69 unsigned int master = fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK; in test_dai_set_fmt()
72 dev_info(dai->dev, "name : %s", dai->name); in test_dai_set_fmt()
95 str = "pdm"; in test_dai_set_fmt()
98 dev_info(dai->dev, "format : %s", str); in test_dai_set_fmt()
104 dev_info(dai->dev, "clock : %s", str); in test_dai_set_fmt()
121 dev_info(dai->dev, "clock : codec is %s", str); in test_dai_set_fmt()
138 dev_info(dai->dev, "signal : %s", str); in test_dai_set_fmt()
280 rtd->pcm, in test_component_pcm_construct()
282 rtd->card->snd_card->dev, in test_component_pcm_construct()
360 if (!rtd->dai_link->no_pcm) in test_component_open()
410 cancel_delayed_work(&priv->dwork); in test_component_timer_stop()
415 schedule_delayed_work(&priv->dwork, msecs_to_jiffies(10)); in test_component_timer_start()
422 if (priv->substream) in test_component_dwork()
423 snd_pcm_period_elapsed(priv->substream); in test_component_dwork()
431 struct test_priv *priv = dev_get_drvdata(component->dev); in test_component_trigger()
438 priv->substream = substream; /* set substream later */ in test_component_trigger()
441 priv->substream = NULL; in test_component_trigger()
459 struct snd_pcm_runtime *runtime = substream->runtime; in test_component_pointer()
489 mile_stone_x(rtd->dev); in test_component_be_hw_params_fixup()
506 { .compatible = "test-cpu", .data = (void *)&test_cpu, },
507 { .compatible = "test-cpu-verbose", .data = (void *)&test_cpu_vv, },
508 { .compatible = "test-cpu-verbose-dai", .data = (void *)&test_cpu_nv, },
509 { .compatible = "test-cpu-verbose-component", .data = (void *)&test_cpu_vn, },
510 { .compatible = "test-codec", .data = (void *)&test_codec, },
511 { .compatible = "test-codec-verbose", .data = (void *)&test_codec_vv, },
512 { .compatible = "test-codec-verbose-dai", .data = (void *)&test_codec_nv, },
513 { .compatible = "test-codec-verbose-component", .data = (void *)&test_codec_vn, },
531 struct device *dev = &pdev->dev; in test_driver_probe()
532 struct device_node *node = dev->of_node; in test_driver_probe()
534 const struct test_adata *adata = of_device_get_match_data(&pdev->dev); in test_driver_probe()
544 return -EINVAL; in test_driver_probe()
552 return -EINVAL; in test_driver_probe()
554 priv->dev = dev; in test_driver_probe()
555 priv->component_driver = cdriv; in test_driver_probe()
556 priv->dai_driver = ddriv; in test_driver_probe()
557 priv->name = dname; in test_driver_probe()
559 INIT_DELAYED_WORK(&priv->dwork, test_component_dwork); in test_driver_probe()
562 if (adata->is_cpu) { in test_driver_probe()
563 cdriv->name = "test_cpu"; in test_driver_probe()
564 cdriv->pcm_construct = test_component_pcm_construct; in test_driver_probe()
565 cdriv->pointer = test_component_pointer; in test_driver_probe()
566 cdriv->trigger = test_component_trigger; in test_driver_probe()
567 cdriv->legacy_dai_naming = 1; in test_driver_probe()
569 cdriv->name = "test_codec"; in test_driver_probe()
570 cdriv->idle_bias_on = 1; in test_driver_probe()
571 cdriv->endianness = 1; in test_driver_probe()
574 cdriv->open = test_component_open; in test_driver_probe()
575 cdriv->dapm_widgets = widgets; in test_driver_probe()
576 cdriv->num_dapm_widgets = ARRAY_SIZE(widgets); in test_driver_probe()
578 if (adata->cmp_v) { in test_driver_probe()
579 cdriv->probe = test_component_probe; in test_driver_probe()
580 cdriv->remove = test_component_remove; in test_driver_probe()
581 cdriv->suspend = test_component_suspend; in test_driver_probe()
582 cdriv->resume = test_component_resume; in test_driver_probe()
583 cdriv->set_sysclk = test_component_set_sysclk; in test_driver_probe()
584 cdriv->set_pll = test_component_set_pll; in test_driver_probe()
585 cdriv->set_jack = test_component_set_jack; in test_driver_probe()
586 cdriv->seq_notifier = test_component_seq_notifier; in test_driver_probe()
587 cdriv->stream_event = test_component_stream_event; in test_driver_probe()
588 cdriv->set_bias_level = test_component_set_bias_level; in test_driver_probe()
589 cdriv->close = test_component_close; in test_driver_probe()
590 cdriv->ioctl = test_component_ioctl; in test_driver_probe()
591 cdriv->hw_params = test_component_hw_params; in test_driver_probe()
592 cdriv->hw_free = test_component_hw_free; in test_driver_probe()
593 cdriv->prepare = test_component_prepare; in test_driver_probe()
594 cdriv->sync_stop = test_component_sync_stop; in test_driver_probe()
595 cdriv->get_time_info = test_component_get_time_info; in test_driver_probe()
596 cdriv->be_hw_params_fixup = test_component_be_hw_params_fixup; in test_driver_probe()
598 if (adata->is_cpu) in test_driver_probe()
599 cdriv->pcm_destruct = test_component_pcm_destruct; in test_driver_probe()
604 snprintf(dname[i].name, TEST_NAME_LEN, "%s.%d", node->name, i); in test_driver_probe()
621 if (adata->dai_v) in test_driver_probe()
640 mile_stone_x(&pdev->dev); in test_driver_remove()
645 .name = "test-component",
653 MODULE_ALIAS("platform:asoc-test-component");