ASoC: fsi: fixup wrong value setting order of TDM
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 13 Jul 2010 03:01:25 +0000 (12:01 +0900)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 13 Jul 2010 11:26:26 +0000 (12:26 +0100)
channel size should be set before setting register value

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/sh/fsi.c

index 4fa75087c45b99c47d786866ed1a5feca1e6d956..ec4acac49ebd527e0a1db89336e528566abf948c 100644 (file)
@@ -721,15 +721,15 @@ static int fsi_dai_startup(struct snd_pcm_substream *substream,
                break;
        case SH_FSI_FMT_TDM:
                msg = "TDM";
-               data = CR_FMT(CR_TDM) | (fsi->chan - 1);
                fsi->chan = is_play ?
                        SH_FSI_GET_CH_O(flags) : SH_FSI_GET_CH_I(flags);
+               data = CR_FMT(CR_TDM) | (fsi->chan - 1);
                break;
        case SH_FSI_FMT_TDM_DELAY:
                msg = "TDM Delay";
-               data = CR_FMT(CR_TDM_D) | (fsi->chan - 1);
                fsi->chan = is_play ?
                        SH_FSI_GET_CH_O(flags) : SH_FSI_GET_CH_I(flags);
+               data = CR_FMT(CR_TDM_D) | (fsi->chan - 1);
                break;
        default:
                dev_err(dai->dev, "unknown format.\n");