From 54c7c78a1a0ffdf28c3211a5430fbcc8cbba9a7d Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Fri, 16 Nov 2012 01:17:06 -0800 Subject: [PATCH] --- yaml --- r: 342721 b: refs/heads/master c: c2052def9e92de0f702eb38e179b7991f4638351 h: refs/heads/master i: 342719: 309bc8e24b2a70c4a6e167e8ed65fcfa237d1b94 v: v3 --- [refs] | 2 +- trunk/sound/soc/sh/fsi.c | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 4e3f80a5b2f3..b6322e9d87da 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 943fdadc17962b7ca6fa28167d1077b383dead4b +refs/heads/master: c2052def9e92de0f702eb38e179b7991f4638351 diff --git a/trunk/sound/soc/sh/fsi.c b/trunk/sound/soc/sh/fsi.c index 3260d54413c8..cc81a4966df5 100644 --- a/trunk/sound/soc/sh/fsi.c +++ b/trunk/sound/soc/sh/fsi.c @@ -1771,7 +1771,6 @@ static int fsi_set_fmt_spdif(struct fsi_priv *fsi) fsi->fmt = CR_DTMD_SPDIF_PCM | CR_PCM; fsi->chan_num = 2; - fsi->spdif = 1; return 0; } @@ -1816,16 +1815,10 @@ static int fsi_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) } /* set format */ - switch (flags & SH_FSI_FMT_MASK) { - case SH_FSI_FMT_DAI: - ret = fsi_set_fmt_dai(fsi, fmt & SND_SOC_DAIFMT_FORMAT_MASK); - break; - case SH_FSI_FMT_SPDIF: + if (fsi_is_spdif(fsi)) ret = fsi_set_fmt_spdif(fsi); - break; - default: - ret = -EINVAL; - } + else + ret = fsi_set_fmt_dai(fsi, fmt & SND_SOC_DAIFMT_FORMAT_MASK); return ret; } @@ -1991,6 +1984,13 @@ static struct snd_soc_platform_driver fsi_soc_platform = { /* * platform function */ +static void fsi_port_info_init(struct fsi_priv *fsi, + struct sh_fsi_port_info *info) +{ + if (info->flags & SH_FSI_FMT_SPDIF) + fsi->spdif = 1; +} + static void fsi_handler_init(struct fsi_priv *fsi, struct sh_fsi_port_info *info) { @@ -2057,6 +2057,7 @@ static int fsi_probe(struct platform_device *pdev) fsi->base = master->base; fsi->master = master; fsi->info = pinfo; + fsi_port_info_init(fsi, pinfo); fsi_handler_init(fsi, pinfo); ret = fsi_stream_probe(fsi, &pdev->dev); if (ret < 0) { @@ -2070,6 +2071,7 @@ static int fsi_probe(struct platform_device *pdev) fsi->base = master->base + 0x40; fsi->master = master; fsi->info = pinfo; + fsi_port_info_init(fsi, pinfo); fsi_handler_init(fsi, pinfo); ret = fsi_stream_probe(fsi, &pdev->dev); if (ret < 0) {