fsi->fmt = CR_DTMD_SPDIF_PCM | CR_PCM;
fsi->chan_num = 2;
- fsi->spdif = 1;
return 0;
}
}
/* 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;
}
/*
* 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)
{
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) {
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) {