asoc/multi-component: fsl: add support for disabled SSI nodes
authorTimur Tabi <timur@freescale.com>
Wed, 4 Aug 2010 22:51:08 +0000 (17:51 -0500)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Thu, 12 Aug 2010 13:00:17 +0000 (14:00 +0100)
Add support for adding "status = disabled" to an SSI node to incidate that it
is not wired on the board.  This replaces the not-so-intuitive previous method
of omitting a codec-handle property.

Signed-off-by: Timur Tabi <timur@freescale.com>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
arch/powerpc/boot/dts/mpc8610_hpcd.dts
sound/soc/fsl/fsl_ssi.c

index 9535ce68caaee41331554d2a330a783b503e6eb1..83c3218cb4da2717b9a375ab904ddc8879e9b038 100644 (file)
 
                ssi@16100 {
                        compatible = "fsl,mpc8610-ssi";
+                       status = "disabled";
                        cell-index = <1>;
                        reg = <0x16100 0x100>;
                        interrupt-parent = <&mpic>;
index 00e3e625b52a4869827b0bccc6239ec68be796aa..7939c337ed9db2ebc8f63a7d4cafc37bfe8d9a42 100644 (file)
@@ -625,12 +625,19 @@ static int __devinit fsl_ssi_probe(struct of_device *of_dev,
        struct resource res;
        char name[64];
 
-       /* We are only interested in SSIs with a codec phandle in them, so let's
-        * make sure this SSI has one.
+       /* SSIs that are not connected on the board should have a
+        *      status = "disabled"
+        * property in their device tree nodes.
         */
-       if (!of_get_property(np, "codec-handle", NULL))
+       if (!of_device_is_available(np))
                return -ENODEV;
 
+       /* Check for a codec-handle property. */
+       if (!of_get_property(np, "codec-handle", NULL)) {
+               dev_err(&of_dev->dev, "missing codec-handle property\n");
+               return -ENODEV;
+       }
+
        /* We only support the SSI in "I2S Slave" mode */
        sprop = of_get_property(np, "fsl,mode", NULL);
        if (!sprop || strcmp(sprop, "i2s-slave")) {