[alsa-devel] [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%)
Transceiver usually means receiver + transmitter. This codec can do only transmit. Update driver accordingly.
Signed-off-by: Marek Belisko marek.belisko@streamunlimited.com --- 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
Add devicetree support for this dummy audio soc driver.
Signed-off-by: Michal Bachraty michal.bachraty@streamunlimited.com Signed-off-by: Marek Belisko marek.belisko@streamunlimited.com --- .../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), }, };
On 04/25/2013 03:13 PM, Marek Belisko wrote:
Add devicetree support for this dummy audio soc driver.
Signed-off-by: Michal Bachratymichal.bachraty@streamunlimited.com Signed-off-by: Marek Beliskomarek.belisko@streamunlimited.com
.../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
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 Bachratymichal.bachraty@streamunlimited.com Signed-off-by: Marek Beliskomarek.belisko@streamunlimited.com
.../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
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.
Add devicetree support for this dummy audio soc driver.
Signed-off-by: Michal Bachraty michal.bachraty@streamunlimited.com Signed-off-by: Marek Belisko marek.belisko@streamunlimited.com --- .../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), }, };
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.
participants (4)
-
Marek Belisko
-
Marek Belisko
-
Mark Brown
-
Sebastian Hesselbarth