Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: spdif_receiver: Add DT support.

Add devicetree support for this dummy audio soc driver.

Signed-off-by: Michal Bachraty <michal.bachraty@streamunlimited.com>
Signed-off-by: Marek Belisko <marek.belisko@streamunlimited.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

authored by

Marek Belisko and committed by
Mark Brown
f9c8ba89 1b7c8b35

+20
+10
Documentation/devicetree/bindings/sound/spdif-receiver.txt
··· 1 + Device-Tree bindings for dummy spdif receiver 2 + 3 + Required properties: 4 + - compatible: should be "linux,spdif-dir". 5 + 6 + Example node: 7 + 8 + codec: spdif-receiver { 9 + compatible = "linux,spdif-dir"; 10 + };
+10
sound/soc/codecs/spdif_receiver.c
··· 21 21 #include <sound/soc.h> 22 22 #include <sound/pcm.h> 23 23 #include <sound/initval.h> 24 + #include <linux/of.h> 24 25 25 26 #define STUB_RATES SNDRV_PCM_RATE_8000_192000 26 27 #define STUB_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ ··· 52 51 return 0; 53 52 } 54 53 54 + #ifdef CONFIG_OF 55 + static const struct of_device_id spdif_dir_dt_ids[] = { 56 + { .compatible = "linux,spdif-dir", }, 57 + { } 58 + }; 59 + MODULE_DEVICE_TABLE(of, spdif_dir_dt_ids); 60 + #endif 61 + 55 62 static struct platform_driver spdif_dir_driver = { 56 63 .probe = spdif_dir_probe, 57 64 .remove = spdif_dir_remove, 58 65 .driver = { 59 66 .name = "spdif-dir", 60 67 .owner = THIS_MODULE, 68 + .of_match_table = of_match_ptr(spdif_dir_dt_ids), 61 69 }, 62 70 }; 63 71