Add freescale S/PDIF CPU DAI and machine drivers
Subsystems (5)
v7 cover Add freescale S/PDIF CPU DAI and machine drivers
Changelog:v6->v7:
* Removed extra comma in array.
* Revised some comments.
* Added some dev_err().
* Check the return value of soft reset.
* Use bitrev8() instead of extra reverse_bits().
* Use cache_bypass as default for regmap.v5->v6:
* Sorted out rxtx clk source in DT binding.
* Use devm_xxxx() functions.
* Use platform_get_resource() instead.v4->v5:
* Dropped rx/tx-clksrc-names DT bindings.
* Use standard clock binding instead to pass the clock source list.
* Update the compatible list by using "imx35", the first SoC that has spdif.v3->v4:
* Use regmap for CPU DAI driver.
* Use individual clock source for 32KHz, 44KHz, 48KHz playback.
* Determine clock source configuration from 'clocks' entry.
* Added imx53 to compatible list, merged imx6q and imx6dl in the list.
* Improve the algorism of reverse_bits().
* Dropped the unneeded clk_put().v2->v3:
* Removed a wrong tag from the commit of patch-1.v1->v2:
* Dropped one applied patch for spdif dummy codec drivers.
* Use generic DMA DT binding.
* Let spdif controller driver calculate the clock div.
* Added one optional clock source for spdif tx.
* Reivsed documentation accordingly.
Nicolin Chen (2):
ASoC: fsl: Add S/PDIF CPU DAI driver
ASoC: fsl: Add S/PDIF machine driver
.../devicetree/bindings/sound/fsl,spdif.txt | 56 + .../devicetree/bindings/sound/imx-audio-spdif.txt | 29 + sound/soc/fsl/Kconfig | 14 + sound/soc/fsl/Makefile | 4 + sound/soc/fsl/fsl_spdif.c | 1277 ++++++++++++++++++++ sound/soc/fsl/fsl_spdif.h | 224 ++++ sound/soc/fsl/imx-spdif.c | 134 ++ 7 files changed, 1738 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/fsl,spdif.txt create mode 100644 Documentation/devicetree/bindings/sound/imx-audio-spdif.txt create mode 100644 sound/soc/fsl/fsl_spdif.c create mode 100644 sound/soc/fsl/fsl_spdif.h create mode 100644 sound/soc/fsl/imx-spdif.c
PATCH v7 1/2 ASoC: fsl: Add S/PDIF CPU DAI driver
This patch implements a device-tree-only CPU DAI driver for Freescale S/PDIF controller that supports stereo playback and record feature.
--- .../devicetree/bindings/sound/fsl,spdif.txt | 56 + sound/soc/fsl/Kconfig | 3 + sound/soc/fsl/Makefile | 2 + sound/soc/fsl/fsl_spdif.c | 1277 ++++++++++++++++++++ sound/soc/fsl/fsl_spdif.h | 224 ++++ 5 files changed, 1562 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/fsl,spdif.txt create mode 100644 sound/soc/fsl/fsl_spdif.c create mode 100644 sound/soc/fsl/fsl_spdif.h
Documentation/devicetree/bindings/sound/fsl,spdif.txt new file +56 -0
@@ -0,0 +1,56 @@ +Freescale Sony/Philips Digital Interface Format (S/PDIF) Controller + +The Freescale S/PDIF audio block is a stereo transceiver that allows the +processor to receive and transmit digital audio via an coaxial cable or +a fibre cable. + +Required properties: + + - compatible : Compatible list, contains "fsl,<chip>-spdif". + + - reg : Offset and length of the register set for the device. + + - interrupts : Contains spdif interrupt. + + - dmas : Generic dma devicetree binding as described in + Documentation/devicetree/bindings/dma/dma.txt. + + - dma-names : Two dmas have to be defined, "tx" and "rx". + + - clocks : Contains an entry for each entry in clock-names. + + - clock-names : Includes the following entries: + name description + "core" The core clock of spdif controller + "rxtx<0-7>" Clock source list for tx and rx clock. + This clock list should be identical to + the source list connecting to the spdif + clock mux in "SPDIF Transceiver Clock + Diagram" of SoC reference manual. It + can also be referred to TxClk_Source + bit of register SPDIF_STC. + +Example: + +spdif: spdif@02004000 { + compatible = "fsl,imx6q-spdif", + "fsl,imx35-spdif"; + reg = <0x02004000 0x4000>; + interrupts = <0 52 0x04>; + dmas = <&sdma 14 18 0>, + <&sdma 15 18 0>; + dma-names = "rx", "tx"; + + clocks = <&clks 197>, <&clks 3>, + <&clks 197>, <&clks 107>, + <&clks 0>, <&clks 118>, + <&clks 62>, <&clks 139>, + <&clks 0>; + clock-names = "core", "rxtx0", + "rxtx1", "rxtx2", + "rxtx3", "rxtx4", + "rxtx5", "rxtx6", + "rxtx7"; + + status = "okay"; +};
sound/soc/fsl/Kconfig +3 -0
@@ -1,6 +1,9 @@ config SND_SOC_FSL_SSI tristate +config SND_SOC_FSL_SPDIF + tristate + config SND_SOC_FSL_UTILS tristate
sound/soc/fsl/Makefile +2 -0
@@ -12,9 +12,11 @@ obj-$(CONFIG_SND_SOC_P1022_RDK) += snd-soc-p1022-rdk.o # Freescale PowerPC SSI/DMA Platform Support snd-soc-fsl-ssi-objs := fsl_ssi.o +snd-soc-fsl-spdif-objs := fsl_spdif.o snd-soc-fsl-utils-objs := fsl_utils.o snd-soc-fsl-dma-objs := fsl_dma.o obj-$(CONFIG_SND_SOC_FSL_SSI) += snd-soc-fsl-ssi.o +obj-$(CONFIG_SND_SOC_FSL_SPDIF) += snd-soc-fsl-spdif.o obj-$(CONFIG_SND_SOC_FSL_UTILS) += snd-soc-fsl-utils.o obj-$(CONFIG_SND_SOC_POWERPC_DMA) += snd-soc-fsl-dma.o
sound/soc/fsl/fsl_spdif.c new file +1277 -0
1,277 lines not on this page · raw message
sound/soc/fsl/fsl_spdif.h new file +224 -0
224 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH v7 2/2 ASoC: fsl: Add S/PDIF machine driver
In reply to Nicolin ChenThis patch implements a device-tree-only machine driver for Freescale i.MX series Soc. It works with spdif_transmitter/spdif_receiver and fsl_spdif.c drivers.
--- .../devicetree/bindings/sound/imx-audio-spdif.txt | 29 +++++ sound/soc/fsl/Kconfig | 11 ++ sound/soc/fsl/Makefile | 2 + sound/soc/fsl/imx-spdif.c | 134 ++++++++++++++++++++ 4 files changed, 176 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/imx-audio-spdif.txt create mode 100644 sound/soc/fsl/imx-spdif.c
Documentation/devicetree/bindings/sound/imx-audio-spdif.txt new file +29 -0
@@ -0,0 +1,29 @@ +Freescale i.MX audio complex with S/PDIF transceiver + +Required properties: + + - compatible : "fsl,imx-audio-spdif" + + - model : The user-visible name of this sound complex + + - spdif-controller : The phandle of the i.MX S/PDIF controller + + +Optional properties: + + - spdif-transmitter : The phandle of the spdif-transmitter dummy codec + + - spdif-receiver : The phandle of the spdif-receiver dummy codec + +* Note: At least one of these two properties should be set in the DT binding. + + +Example: + +sound-spdif { + compatible = "fsl,imx-audio-spdif"; + model = "imx-spdif"; + spdif-controller = <&spdif>; + spdif-transmitter = <&spdif_tx_codec>; + spdif-receiver = <&spdif_rx_codec>; +};
sound/soc/fsl/Kconfig +11 -0
@@ -193,6 +193,17 @@ config SND_SOC_IMX_SGTL5000 Say Y if you want to add support for SoC audio on an i.MX board with a sgtl5000 codec. +config SND_SOC_IMX_SPDIF + tristate "SoC Audio support for i.MX boards with S/PDIF" + select SND_SOC_IMX_PCM_DMA + select SND_SOC_FSL_SPDIF + select SND_SOC_FSL_UTILS + select SND_SOC_SPDIF + help + SoC Audio support for i.MX boards with S/PDIF + Say Y if you want to add support for SoC audio on an i.MX board with + a S/DPDIF. + config SND_SOC_IMX_MC13783 tristate "SoC Audio support for I.MX boards with mc13783" depends on MFD_MC13783 && ARM
sound/soc/fsl/Makefile +2 -0
@@ -45,6 +45,7 @@ snd-soc-mx27vis-aic32x4-objs := mx27vis-aic32x4.o snd-soc-wm1133-ev1-objs := wm1133-ev1.o snd-soc-imx-sgtl5000-objs := imx-sgtl5000.o snd-soc-imx-wm8962-objs := imx-wm8962.o +snd-soc-imx-spdif-objs :=imx-spdif.o snd-soc-imx-mc13783-objs := imx-mc13783.o obj-$(CONFIG_SND_SOC_EUKREA_TLV320) += snd-soc-eukrea-tlv320.o
@@ -53,4 +54,5 @@ obj-$(CONFIG_SND_SOC_MX27VIS_AIC32X4) += snd-soc-mx27vis-aic32x4.o obj-$(CONFIG_SND_MXC_SOC_WM1133_EV1) += snd-soc-wm1133-ev1.o obj-$(CONFIG_SND_SOC_IMX_SGTL5000) += snd-soc-imx-sgtl5000.o obj-$(CONFIG_SND_SOC_IMX_WM8962) += snd-soc-imx-wm8962.o +obj-$(CONFIG_SND_SOC_IMX_SPDIF) += snd-soc-imx-spdif.o obj-$(CONFIG_SND_SOC_IMX_MC13783) += snd-soc-imx-mc13783.o
sound/soc/fsl/imx-spdif.c new file +134 -0
134 lines not on this page · raw message
Signature · 1 line
1.7.1
Re: [PATCH v7 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver
In reply to Nicolin ChenQuoted 21 lines · Nicolin Chen
This patch implements a device-tree-only CPU DAI driver for Freescale S/PDIF controller that supports stereo playback and record feature.
Signed-off-by Nicolin Chen <[email protected]>--- .../devicetree/bindings/sound/fsl,spdif.txt | 56 + sound/soc/fsl/Kconfig | 3 + sound/soc/fsl/Makefile | 2 + sound/soc/fsl/fsl_spdif.c | 1277 ++++++++++++++++++++ sound/soc/fsl/fsl_spdif.h | 224 ++++ 5 files changed, 1562 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/fsl,spdif.txt create mode 100644 sound/soc/fsl/fsl_spdif.c create mode 100644 sound/soc/fsl/fsl_spdif.hDocumentation/devicetree/bindings/sound/fsl,spdif.txt new file +0
-0
Documentation/devicetree/bindings/sound/fsl,spdif.txt line 9
Quoted 9 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt new file +9
-0@@ -0,0 +1,56 @@ +Freescale Sony/Philips Digital Interface Format (S/PDIF) Controller + +The Freescale S/PDIF audio block is a stereo transceiver that allows the +processor to receive and transmit digital audio via an coaxial cable or +a fibre cable. + +Required properties: + + - compatible : Compatible list, contains "fsl,<chip>-spdif".
What are valid values for <chip>? The binding should mention this. There are bindings that don't, but they need to be fixed. Undocumented ABIs are a bad idea.
Documentation/devicetree/bindings/sound/fsl,spdif.txt line 13
Quoted 4 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt new file +4
-0+ + - reg : Offset and length of the register set for the device. + + - interrupts : Contains spdif interrupt.
Is that the only interrupt the device generates?
Documentation/devicetree/bindings/sound/fsl,spdif.txt line 23
Quoted 10 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt new file +10
-0+ + - dmas : Generic dma devicetree binding as described in + Documentation/devicetree/bindings/dma/dma.txt. + + - dma-names : Two dmas have to be defined, "tx" and "rx". + + - clocks : Contains an entry for each entry in clock-names. + + - clock-names : Includes the following entries: + name description
I don't think you need this line, it's obvious enough without it.
Documentation/devicetree/bindings/sound/fsl,spdif.txt line 31
Quoted 8 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt new file +8
-0+ "core" The core clock of spdif controller + "rxtx<0-7>" Clock source list for tx and rx clock. + This clock list should be identical to + the source list connecting to the spdif + clock mux in "SPDIF Transceiver Clock + Diagram" of SoC reference manual. It + can also be referred to TxClk_Source + bit of register SPDIF_STC.
Could you elaborate on the last sentence? I'm not sure exactly what you meant.
Documentation/devicetree/bindings/sound/fsl,spdif.txt line 37
Quoted 6 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt new file +6
-0+ +Example: + +spdif: spdif@02004000 { + compatible = "fsl,imx6q-spdif", + "fsl,imx35-spdif";
Is "fsl,imx35-spdif" necessary in the list, or is it not the case all "fsl,<chip>-spdif" variants are compatible with it?
That should be mentioned along with the list of valid compatible strings.
Quoted 19 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt new file +19
-0+ reg = <0x02004000 0x4000>; + interrupts = <0 52 0x04>; + dmas = <&sdma 14 18 0>, + <&sdma 15 18 0>; + dma-names = "rx", "tx"; + + clocks = <&clks 197>, <&clks 3>, + <&clks 197>, <&clks 107>, + <&clks 0>, <&clks 118>, + <&clks 62>, <&clks 139>, + <&clks 0>; + clock-names = "core", "rxtx0", + "rxtx1", "rxtx2", + "rxtx3", "rxtx4", + "rxtx5", "rxtx6", + "rxtx7"; + + status = "okay"; +};
[...]
Documentation/devicetree/bindings/sound/fsl,spdif.txt
Quoted 9 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt new file +9
-0+static int spdif_clk_set_rate(struct clk *clk, unsigned long rate) +{ + unsigned long rate_actual; + + rate_actual = clk_round_rate(clk, rate); + clk_set_rate(clk, rate_actual); + + return 0; +}
Can't clk_set_rate fail?
[...]
Documentation/devicetree/bindings/sound/fsl,spdif.txt
Quoted 4 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt new file +4
-0+ /* Select clock source for rx/tx clock */ + spdif_priv->rxclk = devm_clk_get(&pdev->dev, "rxtx1"); + if (IS_ERR(spdif_priv->rxclk)) { + dev_err(&pdev->dev, "no rxtx1 property in devicetree\n");
Saying "no rxtx1 clock in devicetree" would be clearer.
[...]
Documentation/devicetree/bindings/sound/fsl,spdif.txt
Quoted 4 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt new file +4
-0+static const struct of_device_id fsl_spdif_dt_ids[] = { + { .compatible = "fsl,imx35-spdif", }, + {} +};
So "fsl,imx35-spdif" *must* be in the compatible list. The binding should mention this.
Thanks,
Mark.
Re: [PATCH v7 2/2] ASoC: fsl: Add S/PDIF machine driver
In reply to Nicolin ChenQuoted 20 lines · Nicolin Chen
This patch implements a device-tree-only machine driver for Freescale i.MX series Soc. It works with spdif_transmitter/spdif_receiver and
fsl_spdif.cdrivers.Signed-off-by Nicolin Chen <[email protected]>--- .../devicetree/bindings/sound/imx-audio-spdif.txt | 29 +++++ sound/soc/fsl/Kconfig | 11 ++ sound/soc/fsl/Makefile | 2 + sound/soc/fsl/imx-spdif.c | 134 ++++++++++++++++++++ 4 files changed, 176 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/imx-audio-spdif.txt create mode 100644 sound/soc/fsl/imx-spdif.cDocumentation/devicetree/bindings/sound/imx-audio-spdif.txt new file +0
-0
Documentation/devicetree/bindings/sound/imx-audio-spdif.txt line 7
Quoted 7 lines
Documentation/devicetree/bindings/sound/imx-audio-spdif.txt new file +7
-0@@ -0,0 +1,29 @@ +Freescale i.MX audio complex with S/PDIF transceiver + +Required properties: + + - compatible : "fsl,imx-audio-spdif" + + - model : The user-visible name of this sound complex
Is this used semantically, or is it a completely arbitrary string? In either case I don't see why the compatible string doesn't give the driver enough to have a sensible value.
I'm confused as to why we need this. The phrase "user-visible" in a device description seems very odd.
Documentation/devicetree/bindings/sound/imx-audio-spdif.txt line 18
Quoted 11 lines
Documentation/devicetree/bindings/sound/imx-audio-spdif.txt new file +11
-0+ + - spdif-controller : The phandle of the i.MX S/PDIF controller + + +Optional properties: + + - spdif-transmitter : The phandle of the spdif-transmitter dummy codec + + - spdif-receiver : The phandle of the spdif-receiver dummy codec + +* Note: At least one of these two properties should be set in the DT binding.
Are all four units (comlpex,controller,transmitter,receiver) really separate blocks?
Thanks,
Mark.
Re: [PATCH v7 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver
In reply to Mark RutlandHi Mark,
Thank you for the commenst. I'll Fix them in v8.
Here are some remaining question:
Quoted 7 lines · Mark Rutland
Documentation/devicetree/bindings/sound/fsl,spdif.txt line 9
Quoted 3 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt new file +3
-0+Required properties: + + - compatible : Compatible list, contains "fsl,<chip>-spdif".What are valid values for <chip>? The binding should mention this. There are bindings that don't, but they need to be fixed. Undocumented ABIs are a bad idea.
I see, so 'Compatible list, must contains "fsl,imx35-spdif"' would be okay?
Quoted 3 lines
Quoted 1 line
+ - interrupts : Contains spdif interrupt.
Is that the only interrupt the device generates?
Yes, how could I improve this description?
Quoted 11 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt line 31
Quoted 8 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt new file +8
-0+ "core" The core clock of spdif controller + "rxtx<0-7>" Clock source list for tx and rx clock. + This clock list should be identical to + the source list connecting to the spdif + clock mux in "SPDIF Transceiver Clock + Diagram" of SoC reference manual. It + can also be referred to TxClk_Source + bit of register SPDIF_STC.Could you elaborate on the last sentence? I'm not sure exactly what you meant.
The list is also identical to the TxClk_Source bit value list of register SPDIF_STC.
Quoted 11 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt line 37
Quoted 7 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt new file +6
-0+ +Example: + +spdif: spdif@02004000 { + compatible = "fsl,imx6q-spdif", + "fsl,imx35-spdif";Is "fsl,imx35-spdif" necessary in the list, or is it not the case all "fsl,<chip>-spdif" variants are compatible with it?
Quoted 2 lines
That should be mentioned along with the list of valid compatible strings.
I guess it's better to drop the 'imx6q-spdif' here?
Thank you,
Nicolin
Re: [PATCH v7 2/2] ASoC: fsl: Add S/PDIF machine driver
In reply to Mark RutlandHi,
Quoted 6 lines · Mark Rutland
Is this used semantically, or is it a completely arbitrary string? In either case I don't see why the compatible string doesn't give the driver enough to have a sensible value.
I'm confused as to why we need this. The phrase "user-visible" in a device description seems very odd.
The string would be in the ALSA device list:
ALSA device list:
#0: imx-spdif
I think it can be a sort of arbitrary as long as users know which this device exactly is when they catch the name by 'aplay -l' or 'arecord -l'
The phrase "user-visible" is being used in many current docs, I don't dare to change it unless a sage gives me a suggestion.
Quoted 6 lines
Quoted 6 lines
Documentation/devicetree/bindings/sound/imx-audio-spdif.txt new file +6
-0+ + - spdif-controller : The phandle of the i.MX S/PDIF controller + + +Optional properties: +
Quoted 8 lines
Documentation/devicetree/bindings/sound/imx-audio-spdif.txt line 18
Quoted 5 lines
Documentation/devicetree/bindings/sound/imx-audio-spdif.txt new file +5
-0+ - spdif-transmitter : The phandle of the spdif-transmitter dummy codec + + - spdif-receiver : The phandle of the spdif-receiver dummy codec + +* Note: At least one of these two properties should be set in the DT binding.Are all four units (comlpex,controller,transmitter,receiver) really separate blocks?
At least they are separate drivers as I mentioned in the commit comments.
Thank you,
Nicolin
Re: [PATCH v7 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver
In reply to Nicolin ChenQuoted 15 lines · Nicolin Chen
Hi Mark,
Thank you for the commenst. I'll Fix them in v8.
Here are some remaining question:
Quoted 7 lines · Mark Rutland
Documentation/devicetree/bindings/sound/fsl,spdif.txt line 9
Quoted 3 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt new file +3
-0+Required properties: + + - compatible : Compatible list, contains "fsl,<chip>-spdif".What are valid values for <chip>? The binding should mention this. There are bindings that don't, but they need to be fixed. Undocumented ABIs are a bad idea.
Quoted 1 line
I see, so 'Compatible list, must contains "fsl,imx35-spdif"' would be okay?
While that needs to be mentioned, other values which might be present (e.g. "fsl,imx6q-spdif") must be mentioned, or we can't rely on them if we want to use them in future from drivers to provide additional information (and thus they're useless).
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
+ - interrupts : Contains spdif interrupt.
Is that the only interrupt the device generates?
Yes, how could I improve this description?
It's probably not possible to make it much clearar to be honest, "Contains the sole interrupt generated by the device" might be a little overkill.
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt new file +8
-0+ "core" The core clock of spdif controller + "rxtx<0-7>" Clock source list for tx and rx clock. + This clock list should be identical to + the source list connecting to the spdif + clock mux in "SPDIF Transceiver Clock + Diagram" of SoC reference manual. It + can also be referred to TxClk_Source + bit of register SPDIF_STC.
Quoted 5 lines
Quoted 2 lines
Could you elaborate on the last sentence? I'm not sure exactly what you meant.
The list is also identical to the
TxClk_Sourcebit value list of registerSPDIF_STC.
What I don't understand is how the value of the SPDIF_STC register within the spdif IP block can describe the necessary details of clocks coming from an external clock provider.
What do the TxClk_Source bits represent? The configuration of the clock inputs on the spdif IP block, or the outputs on some clock provider? Are they writeable, or configured at integration time? If the clock provider were replaced with another arbitrary clock provider, what would they represent?
Quoted 12 lines
Quoted 12 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt line 37
Quoted 8 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt new file +6
-0+ +Example: + +spdif: spdif@02004000 { + compatible = "fsl,imx6q-spdif", + "fsl,imx35-spdif";Is "fsl,imx35-spdif" necessary in the list, or is it not the case all "fsl,<chip>-spdif" variants are compatible with it?
Quoted 4 lines
Quoted 2 lines
That should be mentioned along with the list of valid compatible strings.
I guess it's better to drop the 'imx6q-spdif' here?
That depends:
* If the two IP blocks are identical, only the "imx35-spdif" name is necessary, and we can forget about "fsl,imx6q-spdif".
* If "fsl,imx6q-spdif" is a strict superset of "fsl,imx35-spdif", having both names documented and in a compatible list for a "fsl,imx6q-spdif" device makes sense.
* If "fsl,imx6q-spdif" is a variation of "fsl,imx35-spdif", and the "fsl,imx6q-spdif" cannot always be treated identically to a "fsl,imx35-spdif", then it makes sense to have separate compatible strings, with a device being listed as either "fsl,imx6q-spdif" or "fsl,imx35-spdif".
I don't know enough about the hardware to make that judgement call.
Cheers,
Mark.
Re: [PATCH v7 2/2] ASoC: fsl: Add S/PDIF machine driver
In reply to Nicolin ChenQuoted 14 lines · Nicolin Chen
Hi,
Quoted 6 lines · Mark Rutland
Is this used semantically, or is it a completely arbitrary string? In either case I don't see why the compatible string doesn't give the driver enough to have a sensible value.
I'm confused as to why we need this. The phrase "user-visible" in a device description seems very odd.
The string would be in the ALSA device list:
ALSA device list:
#0: imx-spdif
Quoted 5 lines
I think it can be a sort of arbitrary as long as users know which this device exactly is when they catch the name by 'aplay -l' or 'arecord -l'
The phrase "user-visible" is being used in many current docs, I don't dare to change it unless a sage gives me a suggestion.
I can see that there is entrenched usage, but this really seems to be embedding Linux-specific implementation details into the dt. I don't see why the driver cannot select a sensible name, but perhaps I'm missing something.
Mark, is there any reason we need to handle the user-visible name of the device this way?
Quoted 16 lines
Quoted 15 lines
Documentation/devicetree/bindings/sound/imx-audio-spdif.txt line 18
Quoted 12 lines
Documentation/devicetree/bindings/sound/imx-audio-spdif.txt new file +11
-0+ + - spdif-controller : The phandle of the i.MX S/PDIF controller + + +Optional properties: + + - spdif-transmitter : The phandle of the spdif-transmitter dummy codec + + - spdif-receiver : The phandle of the spdif-receiver dummy codec + +* Note: At least one of these two properties should be set in the DT binding.Are all four units (comlpex,controller,transmitter,receiver) really separate blocks?
Quoted 1 line
At least they are separate drivers as I mentioned in the commit comments.
I'm not sure that the boundary of Linux drivers should necessarily determine the way we carve up the description of IP blocks, though presumably it's a pretty sensible way of carving it up or we wouldn't have done it.
Is there any public documentation on the i.MX S/PDIF hardware block(s)?
Thanks,
Mark.
Re: [PATCH v7 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver
In reply to Mark RutlandQuoted 6 lines · Mark Rutland
Quoted 1 line
I see, so 'Compatible list, must contains "fsl,imx35-spdif"' would be okay?
While that needs to be mentioned, other values which might be present (e.g. "fsl,imx6q-spdif") must be mentioned, or we can't rely on them if we want to use them in future from drivers to provide additional information (and thus they're useless).
Well, imx6q-spdif is identical to the imx35-spdif. So I think the 'must contains 35' would be enough for the current case. If any future modification happens to the list, I can update this doc later.
Quoted 10 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
+ - interrupts : Contains spdif interrupt.
Is that the only interrupt the device generates?
Yes, how could I improve this description?
It's probably not possible to make it much clearar to be honest, "Contains the sole interrupt generated by the device" might be a little overkill.
Then I keep it no-change :)
Quoted 15 lines
Quoted 10 lines
Quoted 7 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt line 31
Quoted 7 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt new file +7
-0+ "rxtx<0-7>" Clock source list for tx and rx clock. + This clock list should be identical to + the source list connecting to the spdif + clock mux in "SPDIF Transceiver Clock + Diagram" of SoC reference manual. It + can also be referred to TxClk_Source + bit of register SPDIF_STC.The list is also identical to the
TxClk_Sourcebit value list of registerSPDIF_STC.What I don't understand is how the value of the
SPDIF_STCregister within the spdif IP block can describe the necessary details of clocks coming from an external clock provider.
Quoted 5 lines
What do the
TxClk_Sourcebits represent? The configuration of the clock inputs on the spdif IP block, or the outputs on some clock provider? Are they writeable, or configured at integration time? If the clock provider were replaced with another arbitrary clock provider, what would they represent?
Actually there's a clock mux for TxClk and it's connecting with 8 clock sources. So the TxClk_Source bit show the connection between its value with the correspond source on the clock mux:
TxClk_Source 000 XTAL clk input
001 CCM spdif0_clk_root input 010 asrc_clk input
011 spdif_extclk input, from pads 100 esai_hckt input
101 frequency divided ipg_clk input 110 mlb_clk input
111 mlb phy clk input
Quoted 11 lines
Quoted 1 line
I guess it's better to drop the 'imx6q-spdif' here?
That depends:
* If the two IP blocks are identical, only the "imx35-spdif" name is necessary, and we can forget about "fsl,imx6q-spdif".
* If "fsl,imx6q-spdif" is a strict superset of "fsl,imx35-spdif", having both names documented and in a compatible list for a "fsl,imx6q-spdif" device makes sense.
Quoted 7 lines
* If "fsl,imx6q-spdif" is a variation of "fsl,imx35-spdif", and the "fsl,imx6q-spdif" cannot always be treated identically to a "fsl,imx35-spdif", then it makes sense to have separate compatible strings, with a device being listed as either "fsl,imx6q-spdif" or "fsl,imx35-spdif".
I don't know enough about the hardware to make that judgement call.
Thank you for explaining! I will choose A, because they are internally identical except their external clock sources.
Best regards,
Nicolin
Re: [PATCH v7 2/2] ASoC: fsl: Add S/PDIF machine driver
In reply to Mark RutlandQuoted 6 lines · Mark Rutland
Quoted 1 line
At least they are separate drivers as I mentioned in the commit comments.
I'm not sure that the boundary of Linux drivers should necessarily determine the way we carve up the description of IP blocks, though presumably it's a pretty sensible way of carving it up or we wouldn't have done it.
I'm not sure if I understand your point correctly. But in fact the IP driver is not being carved up. The spdif-transmitter and spdif-receiver are basically dummy codec drivers. All the IP-related codes are implemented in fsl_spdif.c, the PATCH 1/2 you just reviewed.
Quoted 1 line
Is there any public documentation on the i.MX S/PDIF hardware block(s)?
http://cache.freescale.com/files/32bit/doc/ref_manual/IMX6DQRM.pdf
Thank you,
Nicolin
Re: [PATCH v7 2/2] ASoC: fsl: Add S/PDIF machine driver
In reply to Mark RutlandAm Montag, den 19.08.2013, 11:01 +0100 schrieb Mark Rutland:
Quoted 45 lines · Nicolin Chen
Quoted 14 lines
Hi,
Quoted 6 lines · Mark Rutland
Is this used semantically, or is it a completely arbitrary string? In either case I don't see why the compatible string doesn't give the driver enough to have a sensible value.
I'm confused as to why we need this. The phrase "user-visible" in a device description seems very odd.
The string would be in the ALSA device list:
ALSA device list:
#0: imx-spdifQuoted 5 lines
I think it can be a sort of arbitrary as long as users know which this device exactly is when they catch the name by 'aplay -l' or 'arecord -l'
The phrase "user-visible" is being used in many current docs, I don't dare to change it unless a sage gives me a suggestion.
I can see that there is entrenched usage, but this really seems to be embedding Linux-specific implementation details into the dt. I don't see why the driver cannot select a sensible name, but perhaps I'm missing something.
Mark, is there any reason we need to handle the user-visible name of the device this way?
Quoted 16 lines
Quoted 15 lines
Documentation/devicetree/bindings/sound/imx-audio-spdif.txt line 18
Quoted 12 lines
Documentation/devicetree/bindings/sound/imx-audio-spdif.txt new file +11
-0+ + - spdif-controller : The phandle of the i.MX S/PDIF controller + + +Optional properties: + + - spdif-transmitter : The phandle of the spdif-transmitter dummy codec + + - spdif-receiver : The phandle of the spdif-receiver dummy codec + +* Note: At least one of these two properties should be set in the DT binding.Are all four units (comlpex,controller,transmitter,receiver) really separate blocks?
Quoted 6 lines
Quoted 1 line
At least they are separate drivers as I mentioned in the commit comments.
I'm not sure that the boundary of Linux drivers should necessarily determine the way we carve up the description of IP blocks, though presumably it's a pretty sensible way of carving it up or we wouldn't have done it.
The transmitter and receiver can be real external codec devices with S/PDIF input or output pads connected to the i.MX S/PDIF. One example would be the Analog Devices ADV7612 HDMI receiver, which can output audio taken from HDMI input via S/PDIF (just as via I2S).
The dummy codec devices are just needed if the S/PDIF pads are directly routed to externally accessible connectors.
regards
Philipp
Mark Brown
maintainerRe: [PATCH v7 2/2] ASoC: fsl: Add S/PDIF machine driver
In reply to Mark RutlandQuoted 5 lines · Mark Rutland
Quoted 2 lines · Nicolin Chen
The phrase "user-visible" is being used in many current docs, I don't dare to change it unless a sage gives me a suggestion.
Quoted 7 lines
I can see that there is entrenched usage, but this really seems to be embedding Linux-specific implementation details into the dt. I don't see why the driver cannot select a sensible name, but perhaps I'm missing something.
Mark, is there any reason we need to handle the user-visible name of the device this way?
This is intended to allow userspace to distinguish between systems that are electrically identical but physically distinct, for example when multiple systems are derived from the same reference design.
Re: [PATCH v7 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver
In reply to Nicolin ChenQuoted 17 lines · Nicolin Chen
Quoted 6 lines · Mark Rutland
Quoted 1 line
I see, so 'Compatible list, must contains "fsl,imx35-spdif"' would be okay?
While that needs to be mentioned, other values which might be present (e.g. "fsl,imx6q-spdif") must be mentioned, or we can't rely on them if we want to use them in future from drivers to provide additional information (and thus they're useless).
Well, imx6q-spdif is identical to the imx35-spdif. So I think the 'must contains 35' would be enough for the current case. If any future modification happens to the list, I can update this doc later.
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines
+ - interrupts : Contains spdif interrupt.
Is that the only interrupt the device generates?
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Yes, how could I improve this description?
It's probably not possible to make it much clearar to be honest, "Contains the sole interrupt generated by the device" might be a little overkill.
Then I keep it no-change :)
Ok :)
Quoted 28 lines
Quoted 17 lines
Quoted 10 lines
Quoted 9 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt line 31
Quoted 9 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt new file +7
-0+ "rxtx<0-7>" Clock source list for tx and rx clock. + This clock list should be identical to + the source list connecting to the spdif + clock mux in "SPDIF Transceiver Clock + Diagram" of SoC reference manual. It + can also be referred to TxClk_Source + bit of register SPDIF_STC.Quoted 2 lines
The list is also identical to the
TxClk_Sourcebit value list of registerSPDIF_STC.What I don't understand is how the value of the
SPDIF_STCregister within the spdif IP block can describe the necessary details of clocks coming from an external clock provider.Quoted 5 lines
What do the
TxClk_Sourcebits represent? The configuration of the clock inputs on the spdif IP block, or the outputs on some clock provider? Are they writeable, or configured at integration time? If the clock provider were replaced with another arbitrary clock provider, what would they represent?Actually there's a clock mux for TxClk and it's connecting with 8 clock sources. So the
TxClk_Sourcebit show the connection between its value with the correspond source on the clock mux:
Quoted 8 lines
TxClk_Source000 XTAL clk input
001 CCMspdif0_clk_rootinput 010asrc_clkinput
011spdif_extclkinput, from pads 100esai_hcktinput
101 frequency dividedipg_clkinput 110mlb_clkinput
111 mlb phy clk input
Ah. So are these the actual input names on the mux, or the names of the outputs that are wired up to the mux? If the former, these may be better clock-names than rxtx<0-7>.
Is there a similar Rx mux?
Given the "rxtx<0-7>" names you've given these clocks, are there 8 clock inputs that get duplicated within the spdif block and fed into both muxes, or are there 16 external inputs that happen to be two groups of 8 identical sets of clocks in systems so far?
Quoted 19 lines
Quoted 19 lines
Quoted 3 lines
I guess it's better to drop the 'imx6q-spdif' here?
That depends:
* If the two IP blocks are identical, only the "imx35-spdif" name is necessary, and we can forget about "fsl,imx6q-spdif".
* If "fsl,imx6q-spdif" is a strict superset of "fsl,imx35-spdif", having both names documented and in a compatible list for a "fsl,imx6q-spdif" device makes sense.
* If "fsl,imx6q-spdif" is a variation of "fsl,imx35-spdif", and the "fsl,imx6q-spdif" cannot always be treated identically to a "fsl,imx35-spdif", then it makes sense to have separate compatible strings, with a device being listed as either "fsl,imx6q-spdif" or "fsl,imx35-spdif".
Quoted 4 lines
Quoted 1 line
I don't know enough about the hardware to make that judgement call.
Thank you for explaining! I will choose A, because they are internally identical except their external clock sources.
Ok, that sounds like the right course of action to me.
Thanks,
Mark.
Re: [PATCH v7 2/2] ASoC: fsl: Add S/PDIF machine driver
In reply to Nicolin ChenQuoted 8 lines · Nicolin Chen
Quoted 6 lines · Mark Rutland
Quoted 1 line
At least they are separate drivers as I mentioned in the commit comments.
I'm not sure that the boundary of Linux drivers should necessarily determine the way we carve up the description of IP blocks, though presumably it's a pretty sensible way of carving it up or we wouldn't have done it.
Quoted 4 lines
I'm not sure if I understand your point correctly. But in fact the IP driver is not being carved up. The spdif-transmitter and spdif-receiver are basically dummy codec drivers. All the IP-related codes are implemented in
fsl_spdif.c, the PATCH 1/2 you just reviewed.
I see. Sorry for the noise there, that's an artifact of my not full understanding of the ASoC bindings.
Quoted 5 lines
Quoted 2 lines
Is there any public documentation on the i.MX S/PDIF hardware block(s)?
http://cache.freescale.com/files/32bit/doc/ref_manual/IMX6DQRM.pdf
Cheers!
Mark.
Re: [PATCH v7 2/2] ASoC: fsl: Add S/PDIF machine driver
In reply to Mark BrownQuoted 11 lines · Mark Brown
Quoted 9 lines · Mark Rutland
Quoted 2 lines · Nicolin Chen
The phrase "user-visible" is being used in many current docs, I don't dare to change it unless a sage gives me a suggestion.
I can see that there is entrenched usage, but this really seems to be embedding Linux-specific implementation details into the dt. I don't see why the driver cannot select a sensible name, but perhaps I'm missing something.
Quoted 6 lines
Quoted 2 lines
Mark, is there any reason we need to handle the user-visible name of the device this way?
This is intended to allow userspace to distinguish between systems that are electrically identical but physically distinct, for example when multiple systems are derived from the same reference design.
I see. Surely if there's some meaning imparted to userspace by the model name, there's a contract there that we should document (the set of valid model names and what they correspond to)?
I'm not sure I understand why userspace needs to know what the system is if we've adequately described how it's wired and what its capabilities are. However, I'm not at all familiar with the way we handle audio, so please forgive my naivety there :)
Thanks,
Mark.
Re: [PATCH v7 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver
In reply to Mark RutlandQuoted 20 lines · Mark Rutland
Quoted 11 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt line 31
Quoted 7 lines
Documentation/devicetree/bindings/sound/fsl,spdif.txt new file +7
-0+ "rxtx<0-7>" Clock source list for tx and rx clock. + This clock list should be identical to + the source list connecting to the spdif + clock mux in "SPDIF Transceiver Clock + Diagram" of SoC reference manual. It + can also be referred to TxClk_Source + bit of register SPDIF_STC.Actually there's a clock mux for TxClk and it's connecting with 8 clock sources. So the
TxClk_Sourcebit show the connection between its value with the correspond source on the clock mux:Quoted 8 lines
TxClk_Source000 XTAL clk input
001 CCMspdif0_clk_rootinput 010asrc_clkinput
011spdif_extclkinput, from pads 100esai_hcktinput
101 frequency dividedipg_clkinput 110mlb_clkinput
111 mlb phy clk input
Quoted 3 lines
Ah. So are these the actual input names on the mux, or the names of the outputs that are wired up to the mux? If the former, these may be better clock-names than rxtx<0-7>.
The clock names are actually different with different SoC. The list above is only for i.MX6Q. So we can't specify these names here, because the driver then would need to maintain a clock names list for different SoC as well.
Quoted 1 line
Is there a similar Rx mux?
Both Tx and RX clocks can be derived from the Tx mux.
Quoted 4 lines
Given the "rxtx<0-7>" names you've given these clocks, are there 8 clock inputs that get duplicated within the spdif block and fed into both muxes, or are there 16 external inputs that happen to be two groups of 8 identical sets of clocks in systems so far?
I think you can refer to the RM, since you just got it. The diagram doesn't show which one you mentioned is true. But I think we can understand in both ways.
I'm going to send a v8. So I think I don't need to modify the description right?
Thank you
Nicolin Chen
Mark Brown
maintainerRe: [PATCH v7 2/2] ASoC: fsl: Add S/PDIF machine driver
In reply to Mark RutlandQuoted 9 lines · Mark Rutland
Quoted 3 lines · Mark Brown
This is intended to allow userspace to distinguish between systems that are electrically identical but physically distinct, for example when multiple systems are derived from the same reference design.
I see. Surely if there's some meaning imparted to userspace by the model name, there's a contract there that we should document (the set of valid model names and what they correspond to)?
In theory I guess. In practice I doubt many people will bother and I'd expect zero productive result from those that do.
Quoted 4 lines
I'm not sure I understand why userspace needs to know what the system is if we've adequately described how it's wired and what its capabilities are. However, I'm not at all familiar with the way we handle audio, so please forgive my naivety there :)
The physical form of the system can have a substantial impact on how people want to configure it at runtime even if there is no software visible difference. Coefficients can be chosen to work with plastics, or volumes adjusted for expected user positioning with respect to the hardware for example.
Re: [PATCH v7 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver
In reply to Mark RutlandQuoted 10 lines · Mark Rutland
Quoted 1 line
I guess it's better to drop the 'imx6q-spdif' here?
That depends:
* If the two IP blocks are identical, only the "imx35-spdif" name is necessary, and we can forget about "fsl,imx6q-spdif".
* If "fsl,imx6q-spdif" is a strict superset of "fsl,imx35-spdif", having both names documented and in a compatible list for a "fsl,imx6q-spdif" device makes sense.
Practically, I found it's very useful to have "fsl,<soc>-<ip>" in the device compatible property in <soc>.dtsi, even when device driver does not match it right now. For this example, I still prefer to have the following line for spdif device in imx6q.dtsi.
compatible = "fsl,imx6q-spdif", "fsl,imx35-spdif";
The reason for that is we usually do not see all the differences of an IP block from one SoC to another when we firstly define the bindings for the device by looking at hardware reference manual. Some programming model differences are only identified when we're actually programming. That said, if some day we find there is difference between imx6q-spdif and imx35-spdif to be handled when we add something new to the driver, we only need to add "fsl,imx6q-spdif" as a new compatible into device driver and bindings document. The existing device tree would need no update to work with the new kernel driver.
Shawn
Quoted 6 lines
* If "fsl,imx6q-spdif" is a variation of "fsl,imx35-spdif", and the "fsl,imx6q-spdif" cannot always be treated identically to a "fsl,imx35-spdif", then it makes sense to have separate compatible strings, with a device being listed as either "fsl,imx6q-spdif" or "fsl,imx35-spdif".
Re: [PATCH v7 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver
In reply to Nicolin ChenQuoted 21 lines · Nicolin Chen
Quoted 20 lines · Mark Rutland
Quoted 19 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Review
Quoted 7 lines
(quoted diff) +7
-0+ "rxtx<0-7>" Clock source list for tx and rx clock. + This clock list should be identical to + the source list connecting to the spdif + clock mux in "SPDIF Transceiver Clock + Diagram" of SoC reference manual. It + can also be referred to TxClk_Source + bit of register SPDIF_STC.Actually there's a clock mux for TxClk and it's connecting with 8 clock sources. So the
TxClk_Sourcebit show the connection between its value with the correspond source on the clock mux:
TxClk_Source000 XTAL clk input
001 CCMspdif0_clk_rootinput 010asrc_clkinput
011spdif_extclkinput, from pads 100esai_hcktinput
101 frequency dividedipg_clkinput 110mlb_clkinput
111 mlb phy clk input
Quoted 7 lines
Quoted 3 lines
Ah. So are these the actual input names on the mux, or the names of the outputs that are wired up to the mux? If the former, these may be better clock-names than rxtx<0-7>.
The clock names are actually different with different SoC. The list above is only for i.MX6Q. So we can't specify these names here, because the driver then would need to maintain a clock names list for different SoC as well.
Ok. I was working on the assumption there were some logical input names on the mux that weren't just the names of the actual clocks wired into them.
Quoted 4 lines
Quoted 2 lines
Is there a similar Rx mux?
Both Tx and RX clocks can be derived from the Tx mux.
ok.
Quoted 6 lines
Quoted 5 lines
Given the "rxtx<0-7>" names you've given these clocks, are there 8 clock inputs that get duplicated within the spdif block and fed into both muxes, or are there 16 external inputs that happen to be two groups of 8 identical sets of clocks in systems so far?
Quoted 8 lines
I think you can refer to the RM, since you just got it. The diagram doesn't show which one you mentioned is true. But I think we can understand in both ways.
I'm going to send a v8. So I think I don't need to modify the description right?
From the sounds of it, no.
Thanks,
Mark.
Re: [PATCH v7 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver
In reply to Shawn GuoQuoted 12 lines · Shawn Guo
Quoted 10 lines · Mark Rutland
Quoted 1 line
I guess it's better to drop the 'imx6q-spdif' here?
That depends:
* If the two IP blocks are identical, only the "imx35-spdif" name is necessary, and we can forget about "fsl,imx6q-spdif".
* If "fsl,imx6q-spdif" is a strict superset of "fsl,imx35-spdif", having both names documented and in a compatible list for a "fsl,imx6q-spdif" device makes sense.
Quoted 6 lines
Practically, I found it's very useful to have "fsl,<soc>-<ip>" in the device compatible property in <soc>.dtsi, even when device driver does not match it right now. For this example, I still prefer to have the following line for spdif device in
imx6q.dtsi.compatible = "fsl,imx6q-spdif", "fsl,imx35-spdif";
This is a good thing, but I was not referring to the driver. Nicolin presumably has enough information about the hardware to know if the new block is fully compatible, even if the driver doesn't yet poke the hardware in such a way as to make that obvious.
Quoted 10 lines
The reason for that is we usually do not see all the differences of an IP block from one SoC to another when we firstly define the bindings for the device by looking at hardware reference manual. Some programming model differences are only identified when we're actually programming. That said, if some day we find there is difference between imx6q-spdif and imx35-spdif to be handled when we add something new to the driver, we only need to add "fsl,imx6q-spdif" as a new compatible into device driver and bindings document. The existing device tree would need no update to work with the new kernel driver.
That's a valid concern, but I think that bindings should be documented from the start (even if unused by the driver), otherwise we're in an equally bad position later if we discover a device isn't backwards compatible as we have no guarantee the new (previously undocumented) string was picked up in all dts.
Thanks,
Mark.
Re: [PATCH v7 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver
In reply to Shawn GuoQuoted 19 lines · Shawn Guo
Quoted 10 lines · Mark Rutland
Quoted 1 line
I guess it's better to drop the 'imx6q-spdif' here?
That depends:
* If the two IP blocks are identical, only the "imx35-spdif" name is necessary, and we can forget about "fsl,imx6q-spdif".
* If "fsl,imx6q-spdif" is a strict superset of "fsl,imx35-spdif", having both names documented and in a compatible list for a "fsl,imx6q-spdif" device makes sense.
Practically, I found it's very useful to have "fsl,<soc>-<ip>" in the device compatible property in <soc>.dtsi, even when device driver does not match it right now. For this example, I still prefer to have the following line for spdif device in
imx6q.dtsi.compatible = "fsl,imx6q-spdif", "fsl,imx35-spdif";
Quoted 9 lines
The reason for that is we usually do not see all the differences of an IP block from one SoC to another when we firstly define the bindings for the device by looking at hardware reference manual. Some programming model differences are only identified when we're actually programming. That said, if some day we find there is difference between imx6q-spdif and imx35-spdif to be handled when we add something new to the driver, we only need to add "fsl,imx6q-spdif" as a new compatible into device driver and bindings document. The existing device tree would need no update to work with the new kernel driver.
Yes, we should definitely include the specific SoC model in the compatible property even in the case where we've done exhaustive research and validated that the two IP blocks are indeed 100% identical.
This enables us to retro-actively enable and bug workarounds or quirks which are required for one SoC but not the other. If the compatible value is already there in DT, we just need a code-change. If the compatible value isn't already there in DT, we need to change the DT as well, which means only new DTs will work correctly with new kernels.