Add the broadmobi BM818
Subsystems (3)
v3 cover Add the broadmobi BM818
The broadmobi uses slightly different parameters from the option modems so add the paramters and document them.
Changes since v2:
Use of_device_get_match_data to get the dai data.
Updated subject styles.
Changes since v1:
Cut back the CC list.
Use data from compatible match instead of explicit compatible match.
Angus Ainslie (Purism) (2):
ASoC: gtm601: add Broadmobi bm818 sound profile
dt-bindings: sound: gtm601: add the broadmobi interface
.../devicetree/bindings/sound/gtm601.txt | 10 ++++-- sound/soc/codecs/gtm601.c | 31 ++++++++++++++++--- 2 files changed, 35 insertions(+), 6 deletions(-)
Signature · 1 line
2.17.1
PATCH v3 1/2 ASoC: gtm601: add Broadmobi bm818 sound profile
The Broadmobi bm818 uses stereo sound at 48Khz sample rate
--- sound/soc/codecs/gtm601.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-)
sound/soc/codecs/gtm601.c +27 -4
@@ -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>
@@ -37,7 +37,7 @@ static struct snd_soc_dai_driver gtm601_dai = { .channels_max = 1, .rates = SNDRV_PCM_RATE_8000, .formats = SNDRV_PCM_FMTBIT_S16_LE, - }, + }, .capture = { .stream_name = "Capture", .channels_min = 1,
@@ -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,18 @@ static const struct snd_soc_component_driver soc_component_dev_gtm601 = {static int gtm601_platform_probe (struct platform_device *pdev) { +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, 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);
Signature · 1 line
2.17.1
Mark Brown
maintainerRe: [PATCH v3 1/2] ASoC: gtm601: add Broadmobi bm818 sound profile
sound/soc/codecs/gtm601.c static struct snd_soc_dai_driver gtm601_dai = { · line 41
Quoted 7 lines · Angus Ainslie (Purism)
sound/soc/codecs/gtm601.c +1
-1@@ -37,7 +37,7 @@ static struct snd_soc_dai_driver gtm601_dai = { .channels_max = 1, .rates = SNDRV_PCM_RATE_8000, .formats = SNDRV_PCM_FMTBIT_S16_LE, - }, + }, .capture = {
This is an unrelated indentation change.
Mark Brown
maintainerRe: [PATCH v3 1/2] ASoC: gtm601: add Broadmobi bm818 sound profile
In reply to Angus Ainslie (Purism)sound/soc/codecs/gtm601.c static const struct snd_soc_component_driver soc_component_dev_gtm601 = { · line 84
Quoted 6 lines · Angus Ainslie (Purism)
static int
gtm601_platform_probe(struct platform_device *pdev){sound/soc/codecs/gtm601.c +4
-0+struct snd_soc_dai_driver *dai_driver; + + dai_driver =of_device_get_match_data (&pdev->dev); +
I was going to apply this but it causes build warnings:
sound/soc/codecs/gtm601.c: In function ‘gtm601_platform_probe’:sound/soc/codecs/gtm601.c:83:13: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
dai_driver = of_device_get_match_data(&pdev->dev);
^Re: [PATCH v3 1/2] ASoC: gtm601: add Broadmobi bm818 sound profile
Quoted 11 lines · Mark Brown
sound/soc/codecs/gtm601.c static const struct snd_soc_component_driver soc_component_dev_gtm601 = { · line 84
Quoted 6 lines · Angus Ainslie (Purism)
static int
gtm601_platform_probe(struct platform_device *pdev){sound/soc/codecs/gtm601.c +4
-0+struct snd_soc_dai_driver *dai_driver; + + dai_driver =of_device_get_match_data (&pdev->dev); +I was going to apply this but it causes build warnings:
Quoted 5 lines
sound/soc/codecs/gtm601.c: In function ‘gtm601_platform_probe’:sound/soc/codecs/gtm601.c:83:13: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]dai_driver = of_device_get_match_data(&pdev->dev); ^
Sorry, missed that.
New version inbound.
Angus
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH v3 2/2 dt-bindings: sound: gtm601: add the broadmobi interface
In reply to Angus Ainslie (Purism)The Broadmobi BM818 uses a different sample rate and channels from the option modem.
--- Documentation/devicetree/bindings/sound/gtm601.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/sound/gtm601.txt +8 -2
@@ -1,10 +1,16 @@ GTM601 UMTS modem audio interface CODEC -This device has no configuration interface. Sample rate is fixed - 8kHz. +This device has no configuration interface. The sample rate and channels are +based on the compatible string + "option,gtm601" = 8kHz mono + "broadmobi,bm818" = 48KHz stereo Required properties: - - compatible : "option,gtm601" + - compatible : one of + "option,gtm601" + "broadmobi,bm818" + Example:
Signature · 1 line
2.17.1