Skip to content

Commit 057a317

Browse files
nytowlbroonie
authored andcommitted
ASoC: gtm601: add Broadmobi bm818 sound profile
The Broadmobi bm818 uses stereo sound at 48Khz sample rate Signed-off-by: Angus Ainslie (Purism) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent c5614fb commit 057a317

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

sound/soc/codecs/gtm601.c

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <linux/slab.h>
1414
#include <linux/module.h>
1515
#include <linux/kernel.h>
16-
#include <linux/device.h>
16+
#include <linux/of_device.h>
1717
#include <sound/core.h>
1818
#include <sound/pcm.h>
1919
#include <sound/initval.h>
@@ -47,6 +47,24 @@ static struct snd_soc_dai_driver gtm601_dai = {
4747
},
4848
};
4949

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+
5068
static const struct snd_soc_component_driver soc_component_dev_gtm601 = {
5169
.dapm_widgets = gtm601_dapm_widgets,
5270
.num_dapm_widgets = ARRAY_SIZE(gtm601_dapm_widgets),
@@ -60,13 +78,19 @@ static const struct snd_soc_component_driver soc_component_dev_gtm601 = {
6078

6179
static int gtm601_platform_probe(struct platform_device *pdev)
6280
{
81+
const struct snd_soc_dai_driver *dai_driver;
82+
83+
dai_driver = of_device_get_match_data(&pdev->dev);
84+
6385
return devm_snd_soc_register_component(&pdev->dev,
64-
&soc_component_dev_gtm601, &gtm601_dai, 1);
86+
&soc_component_dev_gtm601,
87+
(struct snd_soc_dai_driver *)dai_driver, 1);
6588
}
6689

6790
#if defined(CONFIG_OF)
6891
static const struct of_device_id gtm601_codec_of_match[] = {
69-
{ .compatible = "option,gtm601", },
92+
{ .compatible = "option,gtm601", .data = (void *)&gtm601_dai },
93+
{ .compatible = "broadmobi,bm818", .data = (void *)&bm818_dai },
7094
{},
7195
};
7296
MODULE_DEVICE_TABLE(of, gtm601_codec_of_match);

0 commit comments

Comments
 (0)