Lines Matching refs:i2s_reg
31 static void i2s_set_lr_framesize(struct i2s_reg *i2s_reg, unsigned int rfs) in i2s_set_lr_framesize() argument
33 unsigned int mod = readl(&i2s_reg->mod); in i2s_set_lr_framesize()
52 writel(mod, &i2s_reg->mod); in i2s_set_lr_framesize()
61 static void i2s_txctrl(struct i2s_reg *i2s_reg, int on) in i2s_txctrl() argument
63 unsigned int con = readl(&i2s_reg->con); in i2s_txctrl()
64 unsigned int mod = readl(&i2s_reg->mod) & ~MOD_MASK; in i2s_txctrl()
74 writel(mod, &i2s_reg->mod); in i2s_txctrl()
75 writel(con, &i2s_reg->con); in i2s_txctrl()
84 static void i2s_set_bitclk_framesize(struct i2s_reg *i2s_reg, unsigned bfs) in i2s_set_bitclk_framesize() argument
86 unsigned int mod = readl(&i2s_reg->mod); in i2s_set_bitclk_framesize()
106 writel(mod, &i2s_reg->mod); in i2s_set_bitclk_framesize()
116 static void i2s_fifo(struct i2s_reg *i2s_reg, unsigned int flush) in i2s_fifo() argument
119 setbits_le32(&i2s_reg->fic, flush); in i2s_fifo()
120 clrbits_le32(&i2s_reg->fic, flush); in i2s_fifo()
131 static int i2s_set_sysclk_dir(struct i2s_reg *i2s_reg, int dir) in i2s_set_sysclk_dir() argument
133 unsigned int mod = readl(&i2s_reg->mod); in i2s_set_sysclk_dir()
140 writel(mod, &i2s_reg->mod); in i2s_set_sysclk_dir()
153 static int i2s_set_fmt(struct i2s_reg *i2s_reg, unsigned int fmt) in i2s_set_fmt() argument
155 unsigned int mod = readl(&i2s_reg->mod); in i2s_set_fmt()
203 ret = i2s_set_sysclk_dir(i2s_reg, SND_SOC_CLOCK_OUT); in i2s_set_fmt()
217 writel(mod, &i2s_reg->mod); in i2s_set_fmt()
230 static int i2s_set_samplesize(struct i2s_reg *i2s_reg, unsigned int blc) in i2s_set_samplesize() argument
232 unsigned int mod = readl(&i2s_reg->mod); in i2s_set_samplesize()
255 writel(mod, &i2s_reg->mod); in i2s_set_samplesize()
263 struct i2s_reg *i2s_reg = (struct i2s_reg *)pi2s_tx->base_address; in i2s_transfer_tx_data() local
275 writel(*ptr++, &i2s_reg->txd); in i2s_transfer_tx_data()
278 i2s_txctrl(i2s_reg, I2S_TX_ON); in i2s_transfer_tx_data()
282 if (!(CON_TXFIFO_FULL & (readl(&i2s_reg->con)))) { in i2s_transfer_tx_data()
283 writel(*ptr++, &i2s_reg->txd); in i2s_transfer_tx_data()
287 i2s_txctrl(i2s_reg, I2S_TX_OFF); in i2s_transfer_tx_data()
293 i2s_txctrl(i2s_reg, I2S_TX_OFF); in i2s_transfer_tx_data()
301 struct i2s_reg *i2s_reg = (struct i2s_reg *)pi2s_tx->base_address; in i2s_tx_init() local
335 writel(CON_RESET, &i2s_reg->con); in i2s_tx_init()
337 writel(MOD_OP_CLK | MOD_RCLKSRC, &i2s_reg->mod); in i2s_tx_init()
339 writel(PSREN | PSVAL, &i2s_reg->psr); in i2s_tx_init()
353 ret = i2s_set_fmt(i2s_reg, SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | in i2s_tx_init()
356 i2s_set_lr_framesize(i2s_reg, pi2s_tx->rfs); in i2s_tx_init()
357 ret = i2s_set_samplesize(i2s_reg, pi2s_tx->bitspersample); in i2s_tx_init()
363 i2s_set_bitclk_framesize(i2s_reg, pi2s_tx->bfs); in i2s_tx_init()
365 i2s_txctrl(i2s_reg, I2S_TX_OFF); in i2s_tx_init()
366 i2s_fifo(i2s_reg, FIC_TXFLUSH); in i2s_tx_init()