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

ASoC: gtm601: add Broadmobi bm818 sound profile

The Broadmobi bm818 uses stereo sound at 48Khz sample rate

Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca>
Link: https://lore.kernel.org/r/20191223154712.18581-2-angus@akkea.ca
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Angus Ainslie (Purism) and committed by
Mark Brown
057a317a c5614fb8

+27 -3
+27 -3
sound/soc/codecs/gtm601.c
··· 13 13 #include <linux/slab.h> 14 14 #include <linux/module.h> 15 15 #include <linux/kernel.h> 16 - #include <linux/device.h> 16 + #include <linux/of_device.h> 17 17 #include <sound/core.h> 18 18 #include <sound/pcm.h> 19 19 #include <sound/initval.h> ··· 47 47 }, 48 48 }; 49 49 50 + static struct snd_soc_dai_driver bm818_dai = { 51 + .name = "bm818", 52 + .playback = { 53 + .stream_name = "Playback", 54 + .channels_min = 2, 55 + .channels_max = 2, 56 + .rates = SNDRV_PCM_RATE_48000, 57 + .formats = SNDRV_PCM_FMTBIT_S16_LE, 58 + }, 59 + .capture = { 60 + .stream_name = "Capture", 61 + .channels_min = 2, 62 + .channels_max = 2, 63 + .rates = SNDRV_PCM_RATE_48000, 64 + .formats = SNDRV_PCM_FMTBIT_S16_LE, 65 + }, 66 + }; 67 + 50 68 static const struct snd_soc_component_driver soc_component_dev_gtm601 = { 51 69 .dapm_widgets = gtm601_dapm_widgets, 52 70 .num_dapm_widgets = ARRAY_SIZE(gtm601_dapm_widgets), ··· 78 60 79 61 static int gtm601_platform_probe(struct platform_device *pdev) 80 62 { 63 + const struct snd_soc_dai_driver *dai_driver; 64 + 65 + dai_driver = of_device_get_match_data(&pdev->dev); 66 + 81 67 return devm_snd_soc_register_component(&pdev->dev, 82 - &soc_component_dev_gtm601, &gtm601_dai, 1); 68 + &soc_component_dev_gtm601, 69 + (struct snd_soc_dai_driver *)dai_driver, 1); 83 70 } 84 71 85 72 #if defined(CONFIG_OF) 86 73 static const struct of_device_id gtm601_codec_of_match[] = { 87 - { .compatible = "option,gtm601", }, 74 + { .compatible = "option,gtm601", .data = (void *)&gtm601_dai }, 75 + { .compatible = "broadmobi,bm818", .data = (void *)&bm818_dai }, 88 76 {}, 89 77 }; 90 78 MODULE_DEVICE_TABLE(of, gtm601_codec_of_match);