linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: bt-sco: Add devicetree support for bt-sco codec
@ 2015-05-05 20:15 Marek Belisko
  2015-05-06 12:13 ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Belisko @ 2015-05-05 20:15 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai
  Cc: devicetree, linux-kernel, alsa-devel, hns, Marek Belisko

Add devicetree support for bt-sco generic bluetooth SCO link codec.

Signed-off-by: Marek Belisko <marek@goldelico.com>
---

 Documentation/devicetree/bindings/sound/bt-sco.txt    | 13 +++++++++++++
 Documentation/devicetree/bindings/vendor-prefixes.txt |  1 +
 sound/soc/codecs/bt-sco.c                             | 10 ++++++++++
 3 files changed, 24 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/bt-sco.txt

diff --git a/Documentation/devicetree/bindings/sound/bt-sco.txt b/Documentation/devicetree/bindings/sound/bt-sco.txt
new file mode 100644
index 0000000..7e6252f
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/bt-sco.txt
@@ -0,0 +1,13 @@
+Bluetooth-SCO audio CODEC
+
+This device support generic Bluetooth SCO link.
+
+Required properties:
+
+  - compatible : "linux,bt-sco" or "delta,dfbmcs320"
+
+Example:
+
+codec: bt_sco {
+	compatible = "linux,bt-sco";
+};
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index ed3bd55..7a3a657 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -55,6 +55,7 @@ crystalfontz	Crystalfontz America, Inc.
 cubietech	Cubietech, Ltd.
 dallas	Maxim Integrated Products (formerly Dallas Semiconductor)
 davicom	DAVICOM Semiconductor, Inc.
+delta	Delta Electronics, Inc.
 denx	Denx Software Engineering
 digi	Digi International Inc.
 digilent	Diglent, Inc.
diff --git a/sound/soc/codecs/bt-sco.c b/sound/soc/codecs/bt-sco.c
index e7238b8..9002f2d 100644
--- a/sound/soc/codecs/bt-sco.c
+++ b/sound/soc/codecs/bt-sco.c
@@ -74,9 +74,19 @@ static struct platform_device_id bt_sco_driver_ids[] = {
 };
 MODULE_DEVICE_TABLE(platform, bt_sco_driver_ids);
 
+#if defined(CONFIG_OF)
+static const struct of_device_id bt_sco_codec_of_match[] = {
+	{ .compatible = "delta,dfbmcs320", },
+	{ .compatible = "linux,bt-sco", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, bt_sco_codec_of_match);
+#endif
+
 static struct platform_driver bt_sco_driver = {
 	.driver = {
 		.name = "bt-sco",
+		.of_match_table = of_match_ptr(bt_sco_codec_of_match),
 	},
 	.probe = bt_sco_probe,
 	.remove = bt_sco_remove,
-- 
1.9.1


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

* Re: [PATCH] ASoC: bt-sco: Add devicetree support for bt-sco codec
  2015-05-05 20:15 [PATCH] ASoC: bt-sco: Add devicetree support for bt-sco codec Marek Belisko
@ 2015-05-06 12:13 ` Mark Brown
  2015-05-06 19:38   ` Belisko Marek
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2015-05-06 12:13 UTC (permalink / raw)
  To: Marek Belisko
  Cc: lgirdwood, perex, tiwai, devicetree, linux-kernel, alsa-devel, hns

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

On Tue, May 05, 2015 at 10:15:41PM +0200, Marek Belisko wrote:

> +static const struct of_device_id bt_sco_codec_of_match[] = {
> +	{ .compatible = "delta,dfbmcs320", },
> +	{ .compatible = "linux,bt-sco", },

Is there any burning reason for adding the linux,bt-sco compatible?

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH] ASoC: bt-sco: Add devicetree support for bt-sco codec
  2015-05-06 12:13 ` Mark Brown
@ 2015-05-06 19:38   ` Belisko Marek
  2015-05-08 18:06     ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Belisko Marek @ 2015-05-06 19:38 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, perex, tiwai, devicetree, LKML, alsa-devel,
	Dr. H. Nikolaus Schaller

Hi Mark,

On Wed, May 6, 2015 at 2:13 PM, Mark Brown <broonie@kernel.org> wrote:
> On Tue, May 05, 2015 at 10:15:41PM +0200, Marek Belisko wrote:
>
>> +static const struct of_device_id bt_sco_codec_of_match[] = {
>> +     { .compatible = "delta,dfbmcs320", },
>> +     { .compatible = "linux,bt-sco", },
>
> Is there any burning reason for adding the linux,bt-sco compatible?
No no real reason just want to keep that if somebody would like use it from DT
referenced by bt-sco entry (similar as platform data). I'm adding DT
support for it because I want to use
this for W2CBW003 chip and I can use simply "linux,bt-sco" property in
DT or I instead of that add new vendor
prefix + add new compatible entry which is IMO much harder that
reference it by generic name.

Thanks,

marek

-- 
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com

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

* Re: [PATCH] ASoC: bt-sco: Add devicetree support for bt-sco codec
  2015-05-06 19:38   ` Belisko Marek
@ 2015-05-08 18:06     ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2015-05-08 18:06 UTC (permalink / raw)
  To: Belisko Marek
  Cc: Liam Girdwood, perex, tiwai, devicetree, LKML, alsa-devel,
	Dr. H. Nikolaus Schaller

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

On Wed, May 06, 2015 at 09:38:55PM +0200, Belisko Marek wrote:

> > Is there any burning reason for adding the linux,bt-sco compatible?

> No no real reason just want to keep that if somebody would like use it from DT
> referenced by bt-sco entry (similar as platform data). I'm adding DT
> support for it because I want to use
> this for W2CBW003 chip and I can use simply "linux,bt-sco" property in
> DT or I instead of that add new vendor
> prefix + add new compatible entry which is IMO much harder that
> reference it by generic name.

OK, can you change the patch to just have the part specific name please?
If we were to have a generic binding it should really be richer than
this, for example I think I've seen BT devices that take in 16kHz
streams rather than 8kHz and there are often requirements for oversized
data frames as well.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

end of thread, other threads:[~2015-05-08 18:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-05 20:15 [PATCH] ASoC: bt-sco: Add devicetree support for bt-sco codec Marek Belisko
2015-05-06 12:13 ` Mark Brown
2015-05-06 19:38   ` Belisko Marek
2015-05-08 18:06     ` Mark Brown

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