Skip to content

Commit

Permalink
ASoC: gtm601: add Broadmobi bm818 sound profile
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Angus Ainslie (Purism) authored and Mark Brown committed Dec 25, 2019
1 parent c5614fb commit 057a317
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions sound/soc/codecs/gtm601.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/of_device.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/initval.h>
Expand Down Expand Up @@ -47,6 +47,24 @@ static struct snd_soc_dai_driver gtm601_dai = {
},
};

static struct snd_soc_dai_driver bm818_dai = {
.name = "bm818",
.playback = {
.stream_name = "Playback",
.channels_min = 2,
.channels_max = 2,
.rates = SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
},
.capture = {
.stream_name = "Capture",
.channels_min = 2,
.channels_max = 2,
.rates = SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
},
};

static const struct snd_soc_component_driver soc_component_dev_gtm601 = {
.dapm_widgets = gtm601_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(gtm601_dapm_widgets),
Expand All @@ -60,13 +78,19 @@ static const struct snd_soc_component_driver soc_component_dev_gtm601 = {

static int gtm601_platform_probe(struct platform_device *pdev)
{
const struct snd_soc_dai_driver *dai_driver;

dai_driver = of_device_get_match_data(&pdev->dev);

return devm_snd_soc_register_component(&pdev->dev,
&soc_component_dev_gtm601, &gtm601_dai, 1);
&soc_component_dev_gtm601,
(struct snd_soc_dai_driver *)dai_driver, 1);
}

#if defined(CONFIG_OF)
static const struct of_device_id gtm601_codec_of_match[] = {
{ .compatible = "option,gtm601", },
{ .compatible = "option,gtm601", .data = (void *)&gtm601_dai },
{ .compatible = "broadmobi,bm818", .data = (void *)&bm818_dai },
{},
};
MODULE_DEVICE_TABLE(of, gtm601_codec_of_match);
Expand Down

0 comments on commit 057a317

Please sign in to comment.