On 08/19/2013 11:19 PM, Shawn Guo wrote:
On Mon, Aug 19, 2013 at 10:54:33AM +0100, Mark Rutland wrote:
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.
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.