* [alsa-devel] [PATCH v2 0/2] Add the broadmobi BM818
@ 2019-12-14 23:55 Angus Ainslie (Purism)
2019-12-14 23:55 ` [alsa-devel] [PATCH v2 1/2] sound: codecs: gtm601: add Broadmobi bm818 sound profile Angus Ainslie (Purism)
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Angus Ainslie (Purism) @ 2019-12-14 23:55 UTC (permalink / raw)
To: Mark Brown
Cc: linux-kernel, alsa-devel, Angus Ainslie (Purism), kernel, Liam Girdwood
he broadmobi uses slightly different parameters from the option modems
so add the paramters and document them.
Changes since v1:
Cut back the CC list.
Use data from compatible match instead of explicit compatible match.
Angus Ainslie (Purism) (2):
sound: codecs: 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 | 46 +++++++++++++++----
2 files changed, 46 insertions(+), 10 deletions(-)
--
2.17.1
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* [alsa-devel] [PATCH v2 1/2] sound: codecs: gtm601: add Broadmobi bm818 sound profile
2019-12-14 23:55 [alsa-devel] [PATCH v2 0/2] Add the broadmobi BM818 Angus Ainslie (Purism)
@ 2019-12-14 23:55 ` Angus Ainslie (Purism)
2019-12-14 23:55 ` [alsa-devel] [PATCH v2 2/2] dt-bindings: sound: gtm601: add the broadmobi interface Angus Ainslie (Purism)
2019-12-16 12:22 ` [alsa-devel] [PATCH v2 0/2] Add the broadmobi BM818 Mark Brown
2 siblings, 0 replies; 5+ messages in thread
From: Angus Ainslie (Purism) @ 2019-12-14 23:55 UTC (permalink / raw)
To: Mark Brown
Cc: linux-kernel, alsa-devel, Angus Ainslie (Purism), kernel, Liam Girdwood
The Broadmobi bm818 uses stereo sound at 48Khz sample rate
Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca>
---
sound/soc/codecs/gtm601.c | 46 ++++++++++++++++++++++++++++++++-------
1 file changed, 38 insertions(+), 8 deletions(-)
diff --git a/sound/soc/codecs/gtm601.c b/sound/soc/codecs/gtm601.c
index d454294c8d06..44cdbd016761 100644
--- a/sound/soc/codecs/gtm601.c
+++ b/sound/soc/codecs/gtm601.c
@@ -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),
@@ -58,20 +76,32 @@ static const struct snd_soc_component_driver soc_component_dev_gtm601 = {
.non_legacy_dai_naming = 1,
};
-static int gtm601_platform_probe(struct platform_device *pdev)
-{
- return devm_snd_soc_register_component(&pdev->dev,
- &soc_component_dev_gtm601, >m601_dai, 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);
#endif
+static int gtm601_platform_probe(struct platform_device *pdev)
+{
+ struct device_node *np = pdev->dev.of_node;
+ struct snd_soc_dai_driver *dai_driver = >m601_dai;
+ const struct of_device_id *id;
+
+#if defined(CONFIG_OF)
+ if (np) {
+ id = of_match_node(gtm601_codec_of_match, pdev->dev.of_node);
+ dai_driver = id->data;
+ }
+#endif
+
+ return devm_snd_soc_register_component(&pdev->dev,
+ &soc_component_dev_gtm601, dai_driver, 1);
+}
+
static struct platform_driver gtm601_codec_driver = {
.driver = {
.name = "gtm601",
--
2.17.1
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [alsa-devel] [PATCH v2 2/2] dt-bindings: sound: gtm601: add the broadmobi interface
2019-12-14 23:55 [alsa-devel] [PATCH v2 0/2] Add the broadmobi BM818 Angus Ainslie (Purism)
2019-12-14 23:55 ` [alsa-devel] [PATCH v2 1/2] sound: codecs: gtm601: add Broadmobi bm818 sound profile Angus Ainslie (Purism)
@ 2019-12-14 23:55 ` Angus Ainslie (Purism)
2019-12-16 12:22 ` [alsa-devel] [PATCH v2 0/2] Add the broadmobi BM818 Mark Brown
2 siblings, 0 replies; 5+ messages in thread
From: Angus Ainslie (Purism) @ 2019-12-14 23:55 UTC (permalink / raw)
To: Mark Brown
Cc: linux-kernel, alsa-devel, Angus Ainslie (Purism), kernel, Liam Girdwood
The Broadmobi BM818 uses a different sample rate and channels from the
option modem.
Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca>
Reviewed-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/sound/gtm601.txt | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/gtm601.txt b/Documentation/devicetree/bindings/sound/gtm601.txt
index 5efc8c068de0..efa32a486c4a 100644
--- a/Documentation/devicetree/bindings/sound/gtm601.txt
+++ b/Documentation/devicetree/bindings/sound/gtm601.txt
@@ -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:
--
2.17.1
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [alsa-devel] [PATCH v2 0/2] Add the broadmobi BM818
2019-12-14 23:55 [alsa-devel] [PATCH v2 0/2] Add the broadmobi BM818 Angus Ainslie (Purism)
2019-12-14 23:55 ` [alsa-devel] [PATCH v2 1/2] sound: codecs: gtm601: add Broadmobi bm818 sound profile Angus Ainslie (Purism)
2019-12-14 23:55 ` [alsa-devel] [PATCH v2 2/2] dt-bindings: sound: gtm601: add the broadmobi interface Angus Ainslie (Purism)
@ 2019-12-16 12:22 ` Mark Brown
2019-12-16 16:53 ` Angus Ainslie
2 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2019-12-16 12:22 UTC (permalink / raw)
To: Angus Ainslie (Purism); +Cc: linux-kernel, alsa-devel, kernel, Liam Girdwood
[-- Attachment #1.1: Type: text/plain, Size: 427 bytes --]
On Sat, Dec 14, 2019 at 03:55:48PM -0800, Angus Ainslie (Purism) wrote:
> Angus Ainslie (Purism) (2):
> sound: codecs: gtm601: add Broadmobi bm818 sound profile
> dt-bindings: sound: gtm601: add the broadmobi interface
As I said in reply to v1:
| These subject styles don't even agree with each other :( - please
| try to be consistent with the style for the subsystem (the latter
| one matches, the first one doesn't).
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [alsa-devel] [PATCH v2 0/2] Add the broadmobi BM818
2019-12-16 12:22 ` [alsa-devel] [PATCH v2 0/2] Add the broadmobi BM818 Mark Brown
@ 2019-12-16 16:53 ` Angus Ainslie
0 siblings, 0 replies; 5+ messages in thread
From: Angus Ainslie @ 2019-12-16 16:53 UTC (permalink / raw)
To: Mark Brown
Cc: linux-kernel, alsa-devel, kernel, linux-kernel-owner, Liam Girdwood
On 2019-12-16 04:22, Mark Brown wrote:
> On Sat, Dec 14, 2019 at 03:55:48PM -0800, Angus Ainslie (Purism) wrote:
>
>> Angus Ainslie (Purism) (2):
>> sound: codecs: gtm601: add Broadmobi bm818 sound profile
>> dt-bindings: sound: gtm601: add the broadmobi interface
>
> As I said in reply to v1:
>
> | These subject styles don't even agree with each other :( - please
> | try to be consistent with the style for the subsystem (the latter
> | one matches, the first one doesn't).
Sorry I missed fixing that. I will re-submit.
Do you have any comments on the code changes I made in v2 ?
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-12-16 16:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-14 23:55 [alsa-devel] [PATCH v2 0/2] Add the broadmobi BM818 Angus Ainslie (Purism)
2019-12-14 23:55 ` [alsa-devel] [PATCH v2 1/2] sound: codecs: gtm601: add Broadmobi bm818 sound profile Angus Ainslie (Purism)
2019-12-14 23:55 ` [alsa-devel] [PATCH v2 2/2] dt-bindings: sound: gtm601: add the broadmobi interface Angus Ainslie (Purism)
2019-12-16 12:22 ` [alsa-devel] [PATCH v2 0/2] Add the broadmobi BM818 Mark Brown
2019-12-16 16:53 ` Angus Ainslie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).