]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: fsl-spdif: big-endian support
authorXiubo Li <Li.Xiubo@freescale.com>
Tue, 11 Feb 2014 07:42:48 +0000 (15:42 +0800)
committerMark Brown <broonie@linaro.org>
Wed, 12 Feb 2014 15:31:45 +0000 (15:31 +0000)
For most platforms, the CPU and SPDIF device is in the same endianess
mode. While for the LS1 platform, the CPU is in LE mode and the SPDIF
is in BE mode.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Documentation/devicetree/bindings/sound/fsl,spdif.txt
sound/soc/fsl/fsl_spdif.c

index f2ae335670f5ebb34d467f396a0a1b4ac3b3a69c..3e9e82c8eab328a3427713de5ea5be3031533c51 100644 (file)
@@ -29,6 +29,10 @@ Required properties:
                        can also be referred to TxClk_Source
                        bit of register SPDIF_STC.
 
+   - big-endian : If this property is absent, the native endian mode will
+   be in use as default, or the big endian mode will be in use for all the
+   device registers.
+
 Example:
 
 spdif: spdif@02004000 {
@@ -50,5 +54,6 @@ spdif: spdif@02004000 {
                "rxtx5", "rxtx6",
                "rxtx7";
 
+       big-endian;
        status = "okay";
 };
index 4d075f1abe7803387bb01dbb39a2d66a0eac4c59..73ceb2f9b90d7eee7d148a70369871604e2b894e 100644 (file)
@@ -985,7 +985,7 @@ static bool fsl_spdif_writeable_reg(struct device *dev, unsigned int reg)
        }
 }
 
-static const struct regmap_config fsl_spdif_regmap_config = {
+static struct regmap_config fsl_spdif_regmap_config = {
        .reg_bits = 32,
        .reg_stride = 4,
        .val_bits = 32,
@@ -1105,6 +1105,9 @@ static int fsl_spdif_probe(struct platform_device *pdev)
        memcpy(&spdif_priv->cpu_dai_drv, &fsl_spdif_dai, sizeof(fsl_spdif_dai));
        spdif_priv->cpu_dai_drv.name = spdif_priv->name;
 
+       if (of_property_read_bool(np, "big-endian"))
+               fsl_spdif_regmap_config.val_format_endian = REGMAP_ENDIAN_BIG;
+
        /* Get the addresses and IRQ */
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        regs = devm_ioremap_resource(&pdev->dev, res);