From: "Angus Ainslie (Purism)" <angus@akkea.ca> To: broonie@kernel.org Cc: Liam Girdwood <lgirdwood@gmail.com>, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, kernel@puri.sm, robh@kernel.org, "Angus Ainslie (Purism)" <angus@akkea.ca> Subject: [PATCH v4 1/2] ASoC: gtm601: add Broadmobi bm818 sound profile Date: Mon, 23 Dec 2019 07:47:11 -0800 [thread overview] Message-ID: <20191223154712.18581-2-angus@akkea.ca> (raw) In-Reply-To: <20191223154712.18581-1-angus@akkea.ca> The Broadmobi bm818 uses stereo sound at 48Khz sample rate Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca> --- sound/soc/codecs/gtm601.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/gtm601.c b/sound/soc/codecs/gtm601.c index d454294c8d06..7f05ebcb88d1 100644 --- a/sound/soc/codecs/gtm601.c +++ b/sound/soc/codecs/gtm601.c @@ -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> @@ -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), @@ -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, >m601_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 *)>m601_dai }, + { .compatible = "broadmobi,bm818", .data = (void *)&bm818_dai }, {}, }; MODULE_DEVICE_TABLE(of, gtm601_codec_of_match); -- 2.17.1
WARNING: multiple messages have this Message-ID (diff)
From: "Angus Ainslie (Purism)" <angus@akkea.ca> To: broonie@kernel.org Cc: robh@kernel.org, alsa-devel@alsa-project.org, kernel@puri.sm, "Angus Ainslie \(Purism\)" <angus@akkea.ca>, Liam Girdwood <lgirdwood@gmail.com>, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH v4 1/2] ASoC: gtm601: add Broadmobi bm818 sound profile Date: Mon, 23 Dec 2019 07:47:11 -0800 [thread overview] Message-ID: <20191223154712.18581-2-angus@akkea.ca> (raw) In-Reply-To: <20191223154712.18581-1-angus@akkea.ca> The Broadmobi bm818 uses stereo sound at 48Khz sample rate Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca> --- sound/soc/codecs/gtm601.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/gtm601.c b/sound/soc/codecs/gtm601.c index d454294c8d06..7f05ebcb88d1 100644 --- a/sound/soc/codecs/gtm601.c +++ b/sound/soc/codecs/gtm601.c @@ -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> @@ -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), @@ -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, >m601_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 *)>m601_dai }, + { .compatible = "broadmobi,bm818", .data = (void *)&bm818_dai }, {}, }; MODULE_DEVICE_TABLE(of, gtm601_codec_of_match); -- 2.17.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2019-12-23 15:48 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-12-23 15:47 [PATCH v4 0/2] Add the broadmobi BM818 Angus Ainslie (Purism) 2019-12-23 15:47 ` [alsa-devel] " Angus Ainslie (Purism) 2019-12-23 15:47 ` Angus Ainslie (Purism) [this message] 2019-12-23 15:47 ` [alsa-devel] [PATCH v4 1/2] ASoC: gtm601: add Broadmobi bm818 sound profile Angus Ainslie (Purism) 2019-12-25 0:08 ` Applied "ASoC: gtm601: add Broadmobi bm818 sound profile" to the asoc tree Mark Brown 2019-12-25 0:08 ` [alsa-devel] " Mark Brown 2019-12-23 15:47 ` [PATCH v4 2/2] dt-bindings: sound: gtm601: add the broadmobi interface Angus Ainslie (Purism) 2019-12-23 15:47 ` [alsa-devel] " Angus Ainslie (Purism) 2019-12-25 0:08 ` Applied "dt-bindings: sound: gtm601: add the broadmobi interface" to the asoc tree Mark Brown 2019-12-25 0:08 ` [alsa-devel] " Mark Brown
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20191223154712.18581-2-angus@akkea.ca \ --to=angus@akkea.ca \ --cc=alsa-devel@alsa-project.org \ --cc=broonie@kernel.org \ --cc=kernel@puri.sm \ --cc=lgirdwood@gmail.com \ --cc=linux-kernel@vger.kernel.org \ --cc=robh@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.