2013-04-25 13:13:41

by Belisko Marek

[permalink] [raw]
Subject: [PATCH v2 0/3] ASoC: Add devicetree support for spdif dummy codecs.

changes from v1 (for patch 2 and 3):
- add prefix linux for compatible property (for both tx and rx)
- rename spdif_transceiver.c to spdif_transmitter.c
- add bindings documentation

Marek Belisko (3):
ASoC: spdif_transceiver: Change driver filename to
spdif_transmitter.c.
ASoC: spdif_transmitter: Add DT support.
ASoC: spdif_receiver: Add DT support.

.../devicetree/bindings/sound/spdif-receiver.txt | 10 ++++++++++
.../bindings/sound/spdif-transmitter.txt | 10 ++++++++++
sound/soc/codecs/Makefile | 2 +-
sound/soc/codecs/spdif_receiver.c | 10 ++++++++++
.../{spdif_transciever.c => spdif_transmitter.c} | 10 ++++++++++
5 files changed, 41 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/sound/spdif-receiver.txt
create mode 100644 Documentation/devicetree/bindings/sound/spdif-transmitter.txt
rename sound/soc/codecs/{spdif_transciever.c => spdif_transmitter.c} (88%)

--
1.7.9.5


2013-04-25 13:13:46

by Belisko Marek

[permalink] [raw]
Subject: [PATCH v2 2/3] ASoC: spdif_transmitter: Add DT support.

Add devicetree support for this dummy audio soc driver.

Signed-off-by: Michal Bachraty <[email protected]>
Signed-off-by: Marek Belisko <[email protected]>
---
.../bindings/sound/spdif-transmitter.txt | 10 ++++++++++
sound/soc/codecs/spdif_transmitter.c | 10 ++++++++++
2 files changed, 20 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/spdif-transmitter.txt

diff --git a/Documentation/devicetree/bindings/sound/spdif-transmitter.txt b/Documentation/devicetree/bindings/sound/spdif-transmitter.txt
new file mode 100644
index 0000000..55a8584
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/spdif-transmitter.txt
@@ -0,0 +1,10 @@
+Device-Tree bindings for dummy spdif transmitter
+
+Required properties:
+ - compatible: should be "linux,spdif-dit".
+
+Example node:
+
+ codec: spdif-transmitter {
+ compatible = "linux,spdif-dit";
+ };
diff --git a/sound/soc/codecs/spdif_transmitter.c b/sound/soc/codecs/spdif_transmitter.c
index 112a49d..1828049 100644
--- a/sound/soc/codecs/spdif_transmitter.c
+++ b/sound/soc/codecs/spdif_transmitter.c
@@ -20,6 +20,7 @@
#include <sound/soc.h>
#include <sound/pcm.h>
#include <sound/initval.h>
+#include <linux/of.h>

#define DRV_NAME "spdif-dit"

@@ -52,12 +53,21 @@ static int spdif_dit_remove(struct platform_device *pdev)
return 0;
}

+#ifdef CONFIG_OF
+static const struct of_device_id spdif_dit_dt_ids[] = {
+ { .compatible = "linux,spdif-dit", },
+ { }
+};
+MODULE_DEVICE_TABLE(of, spdif_dit_dt_ids);
+#endif
+
static struct platform_driver spdif_dit_driver = {
.probe = spdif_dit_probe,
.remove = spdif_dit_remove,
.driver = {
.name = DRV_NAME,
.owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(spdif_dit_dt_ids),
},
};

--
1.7.9.5

2013-04-25 13:14:00

by Belisko Marek

[permalink] [raw]
Subject: [PATCH v2 3/3] ASoC: spdif_receiver: Add DT support.

Add devicetree support for this dummy audio soc driver.

Signed-off-by: Michal Bachraty <[email protected]>
Signed-off-by: Marek Belisko <[email protected]>
---
.../devicetree/bindings/sound/spdif-receiver.txt | 10 ++++++++++
sound/soc/codecs/spdif_receiver.c | 10 ++++++++++
2 files changed, 20 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/spdif-receiver.txt

diff --git a/Documentation/devicetree/bindings/sound/spdif-receiver.txt b/Documentation/devicetree/bindings/sound/spdif-receiver.txt
new file mode 100644
index 0000000..80f807b
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/spdif-receiver.txt
@@ -0,0 +1,10 @@
+Device-Tree bindings for dummy spdif receiver
+
+Required properties:
+ - compatible: should be "linux,spdif-dir".
+
+Example node:
+
+ codec: spdif-receiver {
+ compatible = "linux,spdif-dir";
+ };
diff --git a/sound/soc/codecs/spdif_receiver.c b/sound/soc/codecs/spdif_receiver.c
index dd8d856..e9d7881 100644
--- a/sound/soc/codecs/spdif_receiver.c
+++ b/sound/soc/codecs/spdif_receiver.c
@@ -21,6 +21,7 @@
#include <sound/soc.h>
#include <sound/pcm.h>
#include <sound/initval.h>
+#include <linux/of.h>

#define STUB_RATES SNDRV_PCM_RATE_8000_192000
#define STUB_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
@@ -51,12 +52,21 @@ static int spdif_dir_remove(struct platform_device *pdev)
return 0;
}

+#ifdef CONFIG_OF
+static const struct of_device_id spdif_dir_dt_ids[] = {
+ { .compatible = "linux,spdif-dir", },
+ { }
+};
+MODULE_DEVICE_TABLE(of, spdif_dir_dt_ids);
+#endif
+
static struct platform_driver spdif_dir_driver = {
.probe = spdif_dir_probe,
.remove = spdif_dir_remove,
.driver = {
.name = "spdif-dir",
.owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(spdif_dir_dt_ids),
},
};

--
1.7.9.5

2013-04-25 13:14:20

by Belisko Marek

[permalink] [raw]
Subject: [PATCH v2 1/3] ASoC: spdif_transceiver: Change driver filename to spdif_transmitter.c.

Transceiver usually means receiver + transmitter. This codec can do only
transmit. Update driver accordingly.

Signed-off-by: Marek Belisko <[email protected]>
---
sound/soc/codecs/Makefile | 2 +-
.../{spdif_transciever.c => spdif_transmitter.c} | 0
2 files changed, 1 insertion(+), 1 deletion(-)
rename sound/soc/codecs/{spdif_transciever.c => spdif_transmitter.c} (100%)

diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
index 8cf5951..4252c35 100644
--- a/sound/soc/codecs/Makefile
+++ b/sound/soc/codecs/Makefile
@@ -51,7 +51,7 @@ snd-soc-alc5632-objs := alc5632.o
snd-soc-sigmadsp-objs := sigmadsp.o
snd-soc-si476x-objs := si476x.o
snd-soc-sn95031-objs := sn95031.o
-snd-soc-spdif-tx-objs := spdif_transciever.o
+snd-soc-spdif-tx-objs := spdif_transmitter.o
snd-soc-spdif-rx-objs := spdif_receiver.o
snd-soc-ssm2602-objs := ssm2602.o
snd-soc-sta32x-objs := sta32x.o
diff --git a/sound/soc/codecs/spdif_transciever.c b/sound/soc/codecs/spdif_transmitter.c
similarity index 100%
rename from sound/soc/codecs/spdif_transciever.c
rename to sound/soc/codecs/spdif_transmitter.c
--
1.7.9.5

2013-04-26 19:24:49

by Sebastian Hesselbarth

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] ASoC: spdif_transmitter: Add DT support.

On 04/25/2013 03:13 PM, Marek Belisko wrote:
> Add devicetree support for this dummy audio soc driver.
>
> Signed-off-by: Michal Bachraty<[email protected]>
> Signed-off-by: Marek Belisko<[email protected]>
> ---
> .../bindings/sound/spdif-transmitter.txt | 10 ++++++++++
> sound/soc/codecs/spdif_transmitter.c | 10 ++++++++++
> 2 files changed, 20 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/sound/spdif-transmitter.txt
>
> diff --git a/Documentation/devicetree/bindings/sound/spdif-transmitter.txt b/Documentation/devicetree/bindings/sound/spdif-transmitter.txt
> new file mode 100644
> index 0000000..55a8584
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/spdif-transmitter.txt
> @@ -0,0 +1,10 @@
> +Device-Tree bindings for dummy spdif transmitter
> +
> +Required properties:
> + - compatible: should be "linux,spdif-dit".

Marek,

I remember Daniel commenting on the name already, but
what about "spdif-transmitter" and "spdif-receiver" respectively?
That is very generic and should allow to remove "linux," prefix.
And there is a lot of drivers using more informative compatible
strings compared to the driver name.

Sebastian

2013-04-29 12:17:46

by Marek Belisko

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] ASoC: spdif_transmitter: Add DT support.

Dear Sebastian Hesselbarth,

On 04/26/2013 09:24 PM, Sebastian Hesselbarth wrote:
> On 04/25/2013 03:13 PM, Marek Belisko wrote:
>> Add devicetree support for this dummy audio soc driver.
>>
>> Signed-off-by: Michal Bachraty<[email protected]>
>> Signed-off-by: Marek Belisko<[email protected]>
>> ---
>> .../bindings/sound/spdif-transmitter.txt | 10 ++++++++++
>> sound/soc/codecs/spdif_transmitter.c | 10 ++++++++++
>> 2 files changed, 20 insertions(+)
>> create mode 100644
>> Documentation/devicetree/bindings/sound/spdif-transmitter.txt
>>
>> diff --git
>> a/Documentation/devicetree/bindings/sound/spdif-transmitter.txt
>> b/Documentation/devicetree/bindings/sound/spdif-transmitter.txt
>> new file mode 100644
>> index 0000000..55a8584
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/sound/spdif-transmitter.txt
>> @@ -0,0 +1,10 @@
>> +Device-Tree bindings for dummy spdif transmitter
>> +
>> +Required properties:
>> + - compatible: should be "linux,spdif-dit".
>
> Marek,
>
> I remember Daniel commenting on the name already, but
> what about "spdif-transmitter" and "spdif-receiver" respectively?
Agree.
> That is very generic and should allow to remove "linux," prefix.
Not sure if linux, prefix can be removed. I believe (at least what
documentation said) is that <manufacturer>,<model> must be format for
compatible.
> And there is a lot of drivers using more informative compatible
> strings compared to the driver name.
>
> Sebastian
>

Cheers,

~marek
--
Marek Belisko

Software Developer
StreamUnlimited Engineering GmbH
Gutheil Schodergasse 8-12
A-1100 Vienna, Austria

Office: +421 267200087

e-mail: [email protected]
http://www.streamunlimited.com

Meet us at:

High End - Munich, 09 - 12 May, Hall 4/F05
IFA - Berlin, 6-11 September
CEDIA - Denver, 25-28 September

2013-04-29 20:10:33

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] ASoC: spdif_transmitter: Add DT support.

On Mon, Apr 29, 2013 at 02:16:33PM +0200, Marek Belisko wrote:
> Dear Sebastian Hesselbarth,

> >That is very generic and should allow to remove "linux," prefix.

> Not sure if linux, prefix can be removed. I believe (at least what
> documentation said) is that <manufacturer>,<model> must be format
> for compatible.

Yeah, you're supposed to have some prefix. I guess for stuff that we're
really happy is totally generic we could use "generic" or something but
it doesn't make much practical difference.


Attachments:
(No filename) (507.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2013-04-30 18:43:35

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH v2 0/3] ASoC: Add devicetree support for spdif dummy codecs.

On Thu, Apr 25, 2013 at 03:13:11PM +0200, Marek Belisko wrote:
> changes from v1 (for patch 2 and 3):
> - add prefix linux for compatible property (for both tx and rx)
> - rename spdif_transceiver.c to spdif_transmitter.c
> - add bindings documentation

Applied all, thanks.


Attachments:
(No filename) (275.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments