Linux-Devicetree Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/2] Add the broadmobi BM818
@ 2019-12-02 17:48 Angus Ainslie (Purism)
  2019-12-02 17:48 ` [PATCH 1/2] sound: codecs: gtm601: add Broadmobi bm818 sound profile Angus Ainslie (Purism)
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Angus Ainslie (Purism) @ 2019-12-02 17:48 UTC (permalink / raw)
  To: kernel
  Cc: Liam Girdwood, Mark Brown, Rob Herring, Mark Rutland,
	Jaroslav Kysela, Takashi Iwai, Thomas Gleixner, Allison Randal,
	Kate Stewart, Enrico Weigelt, alsa-devel, devicetree,
	linux-kernel, Angus Ainslie (Purism)

The broadmobi uses slightly different parameters from the option modems
so add the paramters and document them.

Angus Ainslie (Purism) (2):
  sound: codecs: gtm601: add Broadmobi bm818 sound profile
  ASoC: gtm601: add the broadmobi interface

 .../devicetree/bindings/sound/gtm601.txt      | 10 +++++--
 sound/soc/codecs/gtm601.c                     | 29 +++++++++++++++++--
 2 files changed, 35 insertions(+), 4 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] sound: codecs: gtm601: add Broadmobi bm818 sound profile
  2019-12-02 17:48 [PATCH 0/2] Add the broadmobi BM818 Angus Ainslie (Purism)
@ 2019-12-02 17:48 ` Angus Ainslie (Purism)
  2019-12-03 14:32   ` Mark Brown
  2019-12-02 17:48 ` [PATCH 2/2] ASoC: gtm601: add the broadmobi interface Angus Ainslie (Purism)
  2019-12-03 14:27 ` [PATCH 0/2] Add the broadmobi BM818 Mark Brown
  2 siblings, 1 reply; 7+ messages in thread
From: Angus Ainslie (Purism) @ 2019-12-02 17:48 UTC (permalink / raw)
  To: kernel
  Cc: Liam Girdwood, Mark Brown, Rob Herring, Mark Rutland,
	Jaroslav Kysela, Takashi Iwai, Thomas Gleixner, Allison Randal,
	Kate Stewart, Enrico Weigelt, alsa-devel, devicetree,
	linux-kernel, Angus Ainslie (Purism)

The Broadmobi bm818 uses stereo sound at 48Khz sample rate

Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca>
---
 sound/soc/codecs/gtm601.c | 29 +++++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/gtm601.c b/sound/soc/codecs/gtm601.c
index d454294c8d06..302569bc46ff 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),
@@ -60,13 +78,20 @@ static const struct snd_soc_component_driver soc_component_dev_gtm601 = {
 
 static int gtm601_platform_probe(struct platform_device *pdev)
 {
+	struct device_node *np = pdev->dev.of_node;
+	struct snd_soc_dai_driver *dai_driver = &gtm601_dai;
+
+	if (np && of_device_is_compatible(np, "broadmobi,bm818"))
+		dai_driver = &bm818_dai;
+
 	return devm_snd_soc_register_component(&pdev->dev,
-			&soc_component_dev_gtm601, &gtm601_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 = "broadmobi,bm818", },
 	{},
 };
 MODULE_DEVICE_TABLE(of, gtm601_codec_of_match);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/2] ASoC: gtm601: add the broadmobi interface
  2019-12-02 17:48 [PATCH 0/2] Add the broadmobi BM818 Angus Ainslie (Purism)
  2019-12-02 17:48 ` [PATCH 1/2] sound: codecs: gtm601: add Broadmobi bm818 sound profile Angus Ainslie (Purism)
@ 2019-12-02 17:48 ` Angus Ainslie (Purism)
  2019-12-13 23:30   ` Rob Herring
  2019-12-03 14:27 ` [PATCH 0/2] Add the broadmobi BM818 Mark Brown
  2 siblings, 1 reply; 7+ messages in thread
From: Angus Ainslie (Purism) @ 2019-12-02 17:48 UTC (permalink / raw)
  To: kernel
  Cc: Liam Girdwood, Mark Brown, Rob Herring, Mark Rutland,
	Jaroslav Kysela, Takashi Iwai, Thomas Gleixner, Allison Randal,
	Kate Stewart, Enrico Weigelt, alsa-devel, devicetree,
	linux-kernel, Angus Ainslie (Purism)

The Broadmobi BM818 uses a different sample rate and channels from the
option modem.

Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca>
---
 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] Add the broadmobi BM818
  2019-12-02 17:48 [PATCH 0/2] Add the broadmobi BM818 Angus Ainslie (Purism)
  2019-12-02 17:48 ` [PATCH 1/2] sound: codecs: gtm601: add Broadmobi bm818 sound profile Angus Ainslie (Purism)
  2019-12-02 17:48 ` [PATCH 2/2] ASoC: gtm601: add the broadmobi interface Angus Ainslie (Purism)
@ 2019-12-03 14:27 ` Mark Brown
  2019-12-03 14:34   ` Angus Ainslie
  2 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2019-12-03 14:27 UTC (permalink / raw)
  To: Angus Ainslie (Purism)
  Cc: kernel, Liam Girdwood, Rob Herring, Mark Rutland,
	Jaroslav Kysela, Takashi Iwai, Thomas Gleixner, Allison Randal,
	Kate Stewart, Enrico Weigelt, alsa-devel, devicetree,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 603 bytes --]

On Mon, Dec 02, 2019 at 10:48:29AM -0700, Angus Ainslie (Purism) wrote:

>   sound: codecs: gtm601: add Broadmobi bm818 sound profile
>   ASoC: gtm601: add the broadmobi interface

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).

Please also try to think about your CC lists when sending
patches, try to understand why everyone you're sending them to is
getting a copy - kernel maintainers get a lot of mail and sending
not obviously relevant patches to random people adds to that.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] sound: codecs: gtm601: add Broadmobi bm818 sound profile
  2019-12-02 17:48 ` [PATCH 1/2] sound: codecs: gtm601: add Broadmobi bm818 sound profile Angus Ainslie (Purism)
@ 2019-12-03 14:32   ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2019-12-03 14:32 UTC (permalink / raw)
  To: Angus Ainslie (Purism)
  Cc: kernel, Liam Girdwood, Rob Herring, Mark Rutland,
	Jaroslav Kysela, Takashi Iwai, Thomas Gleixner, Allison Randal,
	Kate Stewart, Enrico Weigelt, alsa-devel, devicetree,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 564 bytes --]

On Mon, Dec 02, 2019 at 10:48:30AM -0700, Angus Ainslie (Purism) wrote:

> +	if (np && of_device_is_compatible(np, "broadmobi,bm818"))
> +		dai_driver = &bm818_dai;

Rather than having a tree of these it'd be better if...

>  #if defined(CONFIG_OF)
>  static const struct of_device_id gtm601_codec_of_match[] = {
>  	{ .compatible = "option,gtm601", },
> +	{ .compatible = "broadmobi,bm818", },
>  	{},
>  };

...this used the data you can provide along with the of_match as
the dai_driver so the probe function doesn't have to know about
the individual variants.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] Add the broadmobi BM818
  2019-12-03 14:27 ` [PATCH 0/2] Add the broadmobi BM818 Mark Brown
@ 2019-12-03 14:34   ` Angus Ainslie
  0 siblings, 0 replies; 7+ messages in thread
From: Angus Ainslie @ 2019-12-03 14:34 UTC (permalink / raw)
  To: Angus Ainslie (Purism)
  Cc: kernel, Liam Girdwood, Rob Herring, Mark Rutland,
	Jaroslav Kysela, Takashi Iwai, Thomas Gleixner, Allison Randal,
	Kate Stewart, Enrico Weigelt, alsa-devel, devicetree,
	linux-kernel

Hi Mark,

On 2019-12-03 07:27, Mark Brown wrote:
> On Mon, Dec 02, 2019 at 10:48:29AM -0700, Angus Ainslie (Purism) wrote:
> 
>>   sound: codecs: gtm601: add Broadmobi bm818 sound profile
>>   ASoC: gtm601: add the broadmobi interface
> 
> 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).
> 

Ok I'll fix that. I pulled those out of previous commit messages of 
those files.

> Please also try to think about your CC lists when sending
> patches, try to understand why everyone you're sending them to is
> getting a copy - kernel maintainers get a lot of mail and sending
> not obviously relevant patches to random people adds to that.

I used the output of ./scripts/get_maintainer.pl . Is that not the 
correct way to generate the CC list ?

Thanks
Angus

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] ASoC: gtm601: add the broadmobi interface
  2019-12-02 17:48 ` [PATCH 2/2] ASoC: gtm601: add the broadmobi interface Angus Ainslie (Purism)
@ 2019-12-13 23:30   ` Rob Herring
  0 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2019-12-13 23:30 UTC (permalink / raw)
  To: Angus Ainslie (Purism)
  Cc: kernel, Liam Girdwood, Mark Brown, Mark Rutland, Jaroslav Kysela,
	Takashi Iwai, Thomas Gleixner, Allison Randal, Kate Stewart,
	Enrico Weigelt, alsa-devel, devicetree, linux-kernel,
	Angus Ainslie (Purism)

On Mon,  2 Dec 2019 10:48:31 -0700, "Angus Ainslie (Purism)" wrote:
> The Broadmobi BM818 uses a different sample rate and channels from the
> option modem.
> 
> Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca>
> ---
>  Documentation/devicetree/bindings/sound/gtm601.txt | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-02 17:48 [PATCH 0/2] Add the broadmobi BM818 Angus Ainslie (Purism)
2019-12-02 17:48 ` [PATCH 1/2] sound: codecs: gtm601: add Broadmobi bm818 sound profile Angus Ainslie (Purism)
2019-12-03 14:32   ` Mark Brown
2019-12-02 17:48 ` [PATCH 2/2] ASoC: gtm601: add the broadmobi interface Angus Ainslie (Purism)
2019-12-13 23:30   ` Rob Herring
2019-12-03 14:27 ` [PATCH 0/2] Add the broadmobi BM818 Mark Brown
2019-12-03 14:34   ` Angus Ainslie

Linux-Devicetree Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-devicetree/0 linux-devicetree/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-devicetree linux-devicetree/ https://lore.kernel.org/linux-devicetree \
		devicetree@vger.kernel.org
	public-inbox-index linux-devicetree

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-devicetree


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git