From 36c3622306abd621584bef67f59926212af63c2e Mon Sep 17 00:00:00 2001 From: Takumi Sueda Date: Fri, 19 Feb 2021 21:08:22 +0900 Subject: [PATCH] drivers: soc: make dummy codec DT compatible --- .../devicetree/bindings/sound/snd-soc-dummy | 13 +++++++++++++ sound/soc/soc-utils.c | 10 ++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/snd-soc-dummy diff --git a/Documentation/devicetree/bindings/sound/snd-soc-dummy b/Documentation/devicetree/bindings/sound/snd-soc-dummy new file mode 100644 index 000000000000..ea3fe0c0ecef --- /dev/null +++ b/Documentation/devicetree/bindings/sound/snd-soc-dummy @@ -0,0 +1,13 @@ +snd-soc-dummy: + +ALSA SoC dummy codec. + +Required properties: + + - compatible : "alsa-soc-dummy" + +Example: + +sound_dummy { + compatible = "alsa-soc-dummy"; +}; diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c index 54dcece52b0c..9b7533dd651a 100644 --- a/sound/soc/soc-utils.c +++ b/sound/soc/soc-utils.c @@ -7,6 +7,8 @@ // Author: Mark Brown // Liam Girdwood +#include +#include #include #include #include @@ -112,14 +114,12 @@ static const struct snd_soc_component_driver dummy_codec = { static struct snd_soc_dai_driver dummy_dai = { .name = "snd-soc-dummy-dai", .playback = { - .stream_name = "Playback", .channels_min = 1, .channels_max = 384, .rates = STUB_RATES, .formats = STUB_FORMATS, }, .capture = { - .stream_name = "Capture", .channels_min = 1, .channels_max = 384, .rates = STUB_RATES, @@ -149,9 +149,15 @@ static int snd_soc_dummy_probe(struct platform_device *pdev) return ret; } +static struct of_device_id soc_dummy_of_match[] = { + { .compatible = "alsa-soc-dummy" }, + {}, +}; + static struct platform_driver soc_dummy_driver = { .driver = { .name = "snd-soc-dummy", + .of_match_table = soc_dummy_of_match, }, .probe = snd_soc_dummy_probe, };