/* D: clock selecter if master mode */
#define SH_FSI_CLK_MASK 0x0000F000
-#define SH_FSI_CLK_EXTERNAL (1 << 12)
-#define SH_FSI_CLK_CPG (2 << 12) /* FSIxCK + FSI-DIV */
+#define SH_FSI_CLK_EXTERNAL (0 << 12)
+#define SH_FSI_CLK_CPG (1 << 12) /* FSIxCK + FSI-DIV */
/*
* set_rate return value
int chan_num:16;
int clk_master:1;
+ int clk_cpg:1;
int spdif:1;
long rate;
{
struct fsi_priv *fsi = fsi_get_priv_frm_dai(dai);
set_rate_func set_rate = fsi_get_info_set_rate(fsi);
- u32 flags = fsi_get_info_flags(fsi);
int ret;
/* set master/slave audio interface */
if (set_rate)
dev_warn(dai->dev, "set_rate will be removed soon\n");
- switch (flags & SH_FSI_CLK_MASK) {
- case SH_FSI_CLK_EXTERNAL:
- fsi_clk_init(dai->dev, fsi, 1, 1, 0,
- fsi_clk_set_rate_external);
- break;
- case SH_FSI_CLK_CPG:
+ if (fsi->clk_cpg)
fsi_clk_init(dai->dev, fsi, 0, 1, 1,
fsi_clk_set_rate_cpg);
- break;
- }
+ else
+ fsi_clk_init(dai->dev, fsi, 1, 1, 0,
+ fsi_clk_set_rate_external);
}
/* set format */
{
if (info->flags & SH_FSI_FMT_SPDIF)
fsi->spdif = 1;
+
+ if (info->flags & SH_FSI_CLK_CPG)
+ fsi->clk_cpg = 1;
}
static void fsi_handler_init(struct fsi_priv *fsi,