mcasp              72 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp;
mcasp             127 sound/soc/ti/davinci-mcasp.c static inline void mcasp_set_bits(struct davinci_mcasp *mcasp, u32 offset,
mcasp             130 sound/soc/ti/davinci-mcasp.c 	void __iomem *reg = mcasp->base + offset;
mcasp             134 sound/soc/ti/davinci-mcasp.c static inline void mcasp_clr_bits(struct davinci_mcasp *mcasp, u32 offset,
mcasp             137 sound/soc/ti/davinci-mcasp.c 	void __iomem *reg = mcasp->base + offset;
mcasp             141 sound/soc/ti/davinci-mcasp.c static inline void mcasp_mod_bits(struct davinci_mcasp *mcasp, u32 offset,
mcasp             144 sound/soc/ti/davinci-mcasp.c 	void __iomem *reg = mcasp->base + offset;
mcasp             148 sound/soc/ti/davinci-mcasp.c static inline void mcasp_set_reg(struct davinci_mcasp *mcasp, u32 offset,
mcasp             151 sound/soc/ti/davinci-mcasp.c 	__raw_writel(val, mcasp->base + offset);
mcasp             154 sound/soc/ti/davinci-mcasp.c static inline u32 mcasp_get_reg(struct davinci_mcasp *mcasp, u32 offset)
mcasp             156 sound/soc/ti/davinci-mcasp.c 	return (u32)__raw_readl(mcasp->base + offset);
mcasp             159 sound/soc/ti/davinci-mcasp.c static void mcasp_set_ctl_reg(struct davinci_mcasp *mcasp, u32 ctl_reg, u32 val)
mcasp             163 sound/soc/ti/davinci-mcasp.c 	mcasp_set_bits(mcasp, ctl_reg, val);
mcasp             168 sound/soc/ti/davinci-mcasp.c 		if ((mcasp_get_reg(mcasp, ctl_reg) & val) == val)
mcasp             172 sound/soc/ti/davinci-mcasp.c 	if (i == 1000 && ((mcasp_get_reg(mcasp, ctl_reg) & val) != val))
mcasp             176 sound/soc/ti/davinci-mcasp.c static bool mcasp_is_synchronous(struct davinci_mcasp *mcasp)
mcasp             178 sound/soc/ti/davinci-mcasp.c 	u32 rxfmctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_RXFMCTL_REG);
mcasp             179 sound/soc/ti/davinci-mcasp.c 	u32 aclkxctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_ACLKXCTL_REG);
mcasp             184 sound/soc/ti/davinci-mcasp.c static inline void mcasp_set_clk_pdir(struct davinci_mcasp *mcasp, bool enable)
mcasp             188 sound/soc/ti/davinci-mcasp.c 	for_each_set_bit_from(bit, &mcasp->pdir, PIN_BIT_AFSR + 1) {
mcasp             190 sound/soc/ti/davinci-mcasp.c 			mcasp_set_bits(mcasp, DAVINCI_MCASP_PDIR_REG, BIT(bit));
mcasp             192 sound/soc/ti/davinci-mcasp.c 			mcasp_clr_bits(mcasp, DAVINCI_MCASP_PDIR_REG, BIT(bit));
mcasp             196 sound/soc/ti/davinci-mcasp.c static inline void mcasp_set_axr_pdir(struct davinci_mcasp *mcasp, bool enable)
mcasp             200 sound/soc/ti/davinci-mcasp.c 	for_each_set_bit(bit, &mcasp->pdir, PIN_BIT_AMUTE) {
mcasp             202 sound/soc/ti/davinci-mcasp.c 			mcasp_set_bits(mcasp, DAVINCI_MCASP_PDIR_REG, BIT(bit));
mcasp             204 sound/soc/ti/davinci-mcasp.c 			mcasp_clr_bits(mcasp, DAVINCI_MCASP_PDIR_REG, BIT(bit));
mcasp             208 sound/soc/ti/davinci-mcasp.c static void mcasp_start_rx(struct davinci_mcasp *mcasp)
mcasp             210 sound/soc/ti/davinci-mcasp.c 	if (mcasp->rxnumevt) {	/* enable FIFO */
mcasp             211 sound/soc/ti/davinci-mcasp.c 		u32 reg = mcasp->fifo_base + MCASP_RFIFOCTL_OFFSET;
mcasp             213 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, reg, FIFO_ENABLE);
mcasp             214 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, reg, FIFO_ENABLE);
mcasp             218 sound/soc/ti/davinci-mcasp.c 	mcasp_set_ctl_reg(mcasp, DAVINCI_MCASP_GBLCTLR_REG, RXHCLKRST);
mcasp             219 sound/soc/ti/davinci-mcasp.c 	mcasp_set_ctl_reg(mcasp, DAVINCI_MCASP_GBLCTLR_REG, RXCLKRST);
mcasp             225 sound/soc/ti/davinci-mcasp.c 	if (mcasp_is_synchronous(mcasp)) {
mcasp             226 sound/soc/ti/davinci-mcasp.c 		mcasp_set_ctl_reg(mcasp, DAVINCI_MCASP_GBLCTLX_REG, TXHCLKRST);
mcasp             227 sound/soc/ti/davinci-mcasp.c 		mcasp_set_ctl_reg(mcasp, DAVINCI_MCASP_GBLCTLX_REG, TXCLKRST);
mcasp             228 sound/soc/ti/davinci-mcasp.c 		mcasp_set_clk_pdir(mcasp, true);
mcasp             232 sound/soc/ti/davinci-mcasp.c 	mcasp_set_reg(mcasp, DAVINCI_MCASP_RXSTAT_REG, 0xFFFFFFFF);
mcasp             233 sound/soc/ti/davinci-mcasp.c 	mcasp_set_ctl_reg(mcasp, DAVINCI_MCASP_GBLCTLR_REG, RXSERCLR);
mcasp             235 sound/soc/ti/davinci-mcasp.c 	mcasp_set_ctl_reg(mcasp, DAVINCI_MCASP_GBLCTLR_REG, RXSMRST);
mcasp             237 sound/soc/ti/davinci-mcasp.c 	mcasp_set_ctl_reg(mcasp, DAVINCI_MCASP_GBLCTLR_REG, RXFSRST);
mcasp             238 sound/soc/ti/davinci-mcasp.c 	if (mcasp_is_synchronous(mcasp))
mcasp             239 sound/soc/ti/davinci-mcasp.c 		mcasp_set_ctl_reg(mcasp, DAVINCI_MCASP_GBLCTLX_REG, TXFSRST);
mcasp             242 sound/soc/ti/davinci-mcasp.c 	mcasp_set_bits(mcasp, DAVINCI_MCASP_EVTCTLR_REG,
mcasp             243 sound/soc/ti/davinci-mcasp.c 		       mcasp->irq_request[SNDRV_PCM_STREAM_CAPTURE]);
mcasp             246 sound/soc/ti/davinci-mcasp.c static void mcasp_start_tx(struct davinci_mcasp *mcasp)
mcasp             250 sound/soc/ti/davinci-mcasp.c 	if (mcasp->txnumevt) {	/* enable FIFO */
mcasp             251 sound/soc/ti/davinci-mcasp.c 		u32 reg = mcasp->fifo_base + MCASP_WFIFOCTL_OFFSET;
mcasp             253 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, reg, FIFO_ENABLE);
mcasp             254 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, reg, FIFO_ENABLE);
mcasp             258 sound/soc/ti/davinci-mcasp.c 	mcasp_set_ctl_reg(mcasp, DAVINCI_MCASP_GBLCTLX_REG, TXHCLKRST);
mcasp             259 sound/soc/ti/davinci-mcasp.c 	mcasp_set_ctl_reg(mcasp, DAVINCI_MCASP_GBLCTLX_REG, TXCLKRST);
mcasp             260 sound/soc/ti/davinci-mcasp.c 	mcasp_set_clk_pdir(mcasp, true);
mcasp             263 sound/soc/ti/davinci-mcasp.c 	mcasp_set_reg(mcasp, DAVINCI_MCASP_TXSTAT_REG, 0xFFFFFFFF);
mcasp             264 sound/soc/ti/davinci-mcasp.c 	mcasp_set_ctl_reg(mcasp, DAVINCI_MCASP_GBLCTLX_REG, TXSERCLR);
mcasp             268 sound/soc/ti/davinci-mcasp.c 	while ((mcasp_get_reg(mcasp, DAVINCI_MCASP_TXSTAT_REG) & XRDATA) &&
mcasp             272 sound/soc/ti/davinci-mcasp.c 	mcasp_set_axr_pdir(mcasp, true);
mcasp             275 sound/soc/ti/davinci-mcasp.c 	mcasp_set_ctl_reg(mcasp, DAVINCI_MCASP_GBLCTLX_REG, TXSMRST);
mcasp             277 sound/soc/ti/davinci-mcasp.c 	mcasp_set_ctl_reg(mcasp, DAVINCI_MCASP_GBLCTLX_REG, TXFSRST);
mcasp             280 sound/soc/ti/davinci-mcasp.c 	mcasp_set_bits(mcasp, DAVINCI_MCASP_EVTCTLX_REG,
mcasp             281 sound/soc/ti/davinci-mcasp.c 		       mcasp->irq_request[SNDRV_PCM_STREAM_PLAYBACK]);
mcasp             284 sound/soc/ti/davinci-mcasp.c static void davinci_mcasp_start(struct davinci_mcasp *mcasp, int stream)
mcasp             286 sound/soc/ti/davinci-mcasp.c 	mcasp->streams++;
mcasp             289 sound/soc/ti/davinci-mcasp.c 		mcasp_start_tx(mcasp);
mcasp             291 sound/soc/ti/davinci-mcasp.c 		mcasp_start_rx(mcasp);
mcasp             294 sound/soc/ti/davinci-mcasp.c static void mcasp_stop_rx(struct davinci_mcasp *mcasp)
mcasp             297 sound/soc/ti/davinci-mcasp.c 	mcasp_clr_bits(mcasp, DAVINCI_MCASP_EVTCTLR_REG,
mcasp             298 sound/soc/ti/davinci-mcasp.c 		       mcasp->irq_request[SNDRV_PCM_STREAM_CAPTURE]);
mcasp             304 sound/soc/ti/davinci-mcasp.c 	if (mcasp_is_synchronous(mcasp) && !mcasp->streams) {
mcasp             305 sound/soc/ti/davinci-mcasp.c 		mcasp_set_clk_pdir(mcasp, false);
mcasp             306 sound/soc/ti/davinci-mcasp.c 		mcasp_set_reg(mcasp, DAVINCI_MCASP_GBLCTLX_REG, 0);
mcasp             309 sound/soc/ti/davinci-mcasp.c 	mcasp_set_reg(mcasp, DAVINCI_MCASP_GBLCTLR_REG, 0);
mcasp             310 sound/soc/ti/davinci-mcasp.c 	mcasp_set_reg(mcasp, DAVINCI_MCASP_RXSTAT_REG, 0xFFFFFFFF);
mcasp             312 sound/soc/ti/davinci-mcasp.c 	if (mcasp->rxnumevt) {	/* disable FIFO */
mcasp             313 sound/soc/ti/davinci-mcasp.c 		u32 reg = mcasp->fifo_base + MCASP_RFIFOCTL_OFFSET;
mcasp             315 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, reg, FIFO_ENABLE);
mcasp             319 sound/soc/ti/davinci-mcasp.c static void mcasp_stop_tx(struct davinci_mcasp *mcasp)
mcasp             324 sound/soc/ti/davinci-mcasp.c 	mcasp_clr_bits(mcasp, DAVINCI_MCASP_EVTCTLX_REG,
mcasp             325 sound/soc/ti/davinci-mcasp.c 		       mcasp->irq_request[SNDRV_PCM_STREAM_PLAYBACK]);
mcasp             331 sound/soc/ti/davinci-mcasp.c 	if (mcasp_is_synchronous(mcasp) && mcasp->streams)
mcasp             334 sound/soc/ti/davinci-mcasp.c 		mcasp_set_clk_pdir(mcasp, false);
mcasp             337 sound/soc/ti/davinci-mcasp.c 	mcasp_set_reg(mcasp, DAVINCI_MCASP_GBLCTLX_REG, val);
mcasp             338 sound/soc/ti/davinci-mcasp.c 	mcasp_set_reg(mcasp, DAVINCI_MCASP_TXSTAT_REG, 0xFFFFFFFF);
mcasp             340 sound/soc/ti/davinci-mcasp.c 	if (mcasp->txnumevt) {	/* disable FIFO */
mcasp             341 sound/soc/ti/davinci-mcasp.c 		u32 reg = mcasp->fifo_base + MCASP_WFIFOCTL_OFFSET;
mcasp             343 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, reg, FIFO_ENABLE);
mcasp             346 sound/soc/ti/davinci-mcasp.c 	mcasp_set_axr_pdir(mcasp, false);
mcasp             349 sound/soc/ti/davinci-mcasp.c static void davinci_mcasp_stop(struct davinci_mcasp *mcasp, int stream)
mcasp             351 sound/soc/ti/davinci-mcasp.c 	mcasp->streams--;
mcasp             354 sound/soc/ti/davinci-mcasp.c 		mcasp_stop_tx(mcasp);
mcasp             356 sound/soc/ti/davinci-mcasp.c 		mcasp_stop_rx(mcasp);
mcasp             361 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = (struct davinci_mcasp *)data;
mcasp             363 sound/soc/ti/davinci-mcasp.c 	u32 irq_mask = mcasp->irq_request[SNDRV_PCM_STREAM_PLAYBACK];
mcasp             367 sound/soc/ti/davinci-mcasp.c 	stat = mcasp_get_reg(mcasp, DAVINCI_MCASP_TXSTAT_REG);
mcasp             369 sound/soc/ti/davinci-mcasp.c 		dev_warn(mcasp->dev, "Transmit buffer underflow\n");
mcasp             372 sound/soc/ti/davinci-mcasp.c 		substream = mcasp->substreams[SNDRV_PCM_STREAM_PLAYBACK];
mcasp             378 sound/soc/ti/davinci-mcasp.c 		dev_warn(mcasp->dev, "unhandled tx event. txstat: 0x%08x\n",
mcasp             385 sound/soc/ti/davinci-mcasp.c 	mcasp_set_reg(mcasp, DAVINCI_MCASP_TXSTAT_REG, handled_mask);
mcasp             392 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = (struct davinci_mcasp *)data;
mcasp             394 sound/soc/ti/davinci-mcasp.c 	u32 irq_mask = mcasp->irq_request[SNDRV_PCM_STREAM_CAPTURE];
mcasp             398 sound/soc/ti/davinci-mcasp.c 	stat = mcasp_get_reg(mcasp, DAVINCI_MCASP_RXSTAT_REG);
mcasp             400 sound/soc/ti/davinci-mcasp.c 		dev_warn(mcasp->dev, "Receive buffer overflow\n");
mcasp             403 sound/soc/ti/davinci-mcasp.c 		substream = mcasp->substreams[SNDRV_PCM_STREAM_CAPTURE];
mcasp             409 sound/soc/ti/davinci-mcasp.c 		dev_warn(mcasp->dev, "unhandled rx event. rxstat: 0x%08x\n",
mcasp             416 sound/soc/ti/davinci-mcasp.c 	mcasp_set_reg(mcasp, DAVINCI_MCASP_RXSTAT_REG, handled_mask);
mcasp             423 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = (struct davinci_mcasp *)data;
mcasp             426 sound/soc/ti/davinci-mcasp.c 	if (mcasp->substreams[SNDRV_PCM_STREAM_PLAYBACK])
mcasp             429 sound/soc/ti/davinci-mcasp.c 	if (mcasp->substreams[SNDRV_PCM_STREAM_CAPTURE])
mcasp             438 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(cpu_dai);
mcasp             447 sound/soc/ti/davinci-mcasp.c 	pm_runtime_get_sync(mcasp->dev);
mcasp             450 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXDUR);
mcasp             451 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, FSRDUR);
mcasp             457 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXDUR);
mcasp             458 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, FSRDUR);
mcasp             464 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXDUR);
mcasp             465 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, FSRDUR);
mcasp             474 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXDUR);
mcasp             475 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, FSRDUR);
mcasp             484 sound/soc/ti/davinci-mcasp.c 	mcasp_mod_bits(mcasp, DAVINCI_MCASP_TXFMT_REG, FSXDLY(data_delay),
mcasp             486 sound/soc/ti/davinci-mcasp.c 	mcasp_mod_bits(mcasp, DAVINCI_MCASP_RXFMT_REG, FSRDLY(data_delay),
mcasp             492 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, ACLKXE);
mcasp             493 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, AFSXE);
mcasp             495 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRE);
mcasp             496 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, AFSRE);
mcasp             499 sound/soc/ti/davinci-mcasp.c 		set_bit(PIN_BIT_ACLKX, &mcasp->pdir);
mcasp             500 sound/soc/ti/davinci-mcasp.c 		set_bit(PIN_BIT_ACLKR, &mcasp->pdir);
mcasp             502 sound/soc/ti/davinci-mcasp.c 		set_bit(PIN_BIT_AFSX, &mcasp->pdir);
mcasp             503 sound/soc/ti/davinci-mcasp.c 		set_bit(PIN_BIT_AFSR, &mcasp->pdir);
mcasp             505 sound/soc/ti/davinci-mcasp.c 		mcasp->bclk_master = 1;
mcasp             509 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, ACLKXE);
mcasp             510 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, AFSXE);
mcasp             512 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRE);
mcasp             513 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, AFSRE);
mcasp             516 sound/soc/ti/davinci-mcasp.c 		set_bit(PIN_BIT_ACLKX, &mcasp->pdir);
mcasp             517 sound/soc/ti/davinci-mcasp.c 		set_bit(PIN_BIT_ACLKR, &mcasp->pdir);
mcasp             519 sound/soc/ti/davinci-mcasp.c 		clear_bit(PIN_BIT_AFSX, &mcasp->pdir);
mcasp             520 sound/soc/ti/davinci-mcasp.c 		clear_bit(PIN_BIT_AFSR, &mcasp->pdir);
mcasp             522 sound/soc/ti/davinci-mcasp.c 		mcasp->bclk_master = 1;
mcasp             526 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, ACLKXE);
mcasp             527 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, AFSXE);
mcasp             529 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRE);
mcasp             530 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, AFSRE);
mcasp             533 sound/soc/ti/davinci-mcasp.c 		clear_bit(PIN_BIT_ACLKX, &mcasp->pdir);
mcasp             534 sound/soc/ti/davinci-mcasp.c 		clear_bit(PIN_BIT_ACLKR, &mcasp->pdir);
mcasp             536 sound/soc/ti/davinci-mcasp.c 		set_bit(PIN_BIT_AFSX, &mcasp->pdir);
mcasp             537 sound/soc/ti/davinci-mcasp.c 		set_bit(PIN_BIT_AFSR, &mcasp->pdir);
mcasp             539 sound/soc/ti/davinci-mcasp.c 		mcasp->bclk_master = 0;
mcasp             543 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, ACLKXE);
mcasp             544 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, AFSXE);
mcasp             546 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRE);
mcasp             547 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, AFSRE);
mcasp             550 sound/soc/ti/davinci-mcasp.c 		clear_bit(PIN_BIT_ACLKX, &mcasp->pdir);
mcasp             551 sound/soc/ti/davinci-mcasp.c 		clear_bit(PIN_BIT_ACLKR, &mcasp->pdir);
mcasp             553 sound/soc/ti/davinci-mcasp.c 		clear_bit(PIN_BIT_AFSX, &mcasp->pdir);
mcasp             554 sound/soc/ti/davinci-mcasp.c 		clear_bit(PIN_BIT_AFSR, &mcasp->pdir);
mcasp             556 sound/soc/ti/davinci-mcasp.c 		mcasp->bclk_master = 0;
mcasp             565 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, ACLKXPOL);
mcasp             566 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRPOL);
mcasp             570 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, ACLKXPOL);
mcasp             571 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRPOL);
mcasp             575 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, ACLKXPOL);
mcasp             576 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRPOL);
mcasp             580 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, ACLKXPOL);
mcasp             581 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRPOL);
mcasp             593 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXPOL);
mcasp             594 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, FSRPOL);
mcasp             596 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXPOL);
mcasp             597 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, FSRPOL);
mcasp             600 sound/soc/ti/davinci-mcasp.c 	mcasp->dai_fmt = fmt;
mcasp             602 sound/soc/ti/davinci-mcasp.c 	pm_runtime_put(mcasp->dev);
mcasp             606 sound/soc/ti/davinci-mcasp.c static int __davinci_mcasp_set_clkdiv(struct davinci_mcasp *mcasp, int div_id,
mcasp             609 sound/soc/ti/davinci-mcasp.c 	pm_runtime_get_sync(mcasp->dev);
mcasp             612 sound/soc/ti/davinci-mcasp.c 		mcasp_mod_bits(mcasp, DAVINCI_MCASP_AHCLKXCTL_REG,
mcasp             614 sound/soc/ti/davinci-mcasp.c 		mcasp_mod_bits(mcasp, DAVINCI_MCASP_AHCLKRCTL_REG,
mcasp             619 sound/soc/ti/davinci-mcasp.c 		mcasp_mod_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG,
mcasp             621 sound/soc/ti/davinci-mcasp.c 		mcasp_mod_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG,
mcasp             624 sound/soc/ti/davinci-mcasp.c 			mcasp->bclk_div = div;
mcasp             638 sound/soc/ti/davinci-mcasp.c 		mcasp->slot_width = div / mcasp->tdm_slots;
mcasp             639 sound/soc/ti/davinci-mcasp.c 		if (div % mcasp->tdm_slots)
mcasp             640 sound/soc/ti/davinci-mcasp.c 			dev_warn(mcasp->dev,
mcasp             642 sound/soc/ti/davinci-mcasp.c 				 __func__, div, mcasp->tdm_slots);
mcasp             649 sound/soc/ti/davinci-mcasp.c 	pm_runtime_put(mcasp->dev);
mcasp             656 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai);
mcasp             658 sound/soc/ti/davinci-mcasp.c 	return __davinci_mcasp_set_clkdiv(mcasp, div_id, div, 1);
mcasp             664 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai);
mcasp             666 sound/soc/ti/davinci-mcasp.c 	pm_runtime_get_sync(mcasp->dev);
mcasp             668 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_AHCLKXCTL_REG, AHCLKXE);
mcasp             669 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_AHCLKRCTL_REG, AHCLKRE);
mcasp             670 sound/soc/ti/davinci-mcasp.c 		set_bit(PIN_BIT_AHCLKX, &mcasp->pdir);
mcasp             672 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_AHCLKXCTL_REG, AHCLKXE);
mcasp             673 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_AHCLKRCTL_REG, AHCLKRE);
mcasp             674 sound/soc/ti/davinci-mcasp.c 		clear_bit(PIN_BIT_AHCLKX, &mcasp->pdir);
mcasp             677 sound/soc/ti/davinci-mcasp.c 	mcasp->sysclk_freq = freq;
mcasp             679 sound/soc/ti/davinci-mcasp.c 	pm_runtime_put(mcasp->dev);
mcasp             684 sound/soc/ti/davinci-mcasp.c static int davinci_mcasp_ch_constraint(struct davinci_mcasp *mcasp, int stream,
mcasp             687 sound/soc/ti/davinci-mcasp.c 	struct snd_pcm_hw_constraint_list *cl = &mcasp->chconstr[stream];
mcasp             689 sound/soc/ti/davinci-mcasp.c 	int slots = mcasp->tdm_slots;
mcasp             692 sound/soc/ti/davinci-mcasp.c 	if (mcasp->tdm_mask[stream])
mcasp             693 sound/soc/ti/davinci-mcasp.c 		slots = hweight32(mcasp->tdm_mask[stream]);
mcasp             706 sound/soc/ti/davinci-mcasp.c static int davinci_mcasp_set_ch_constraints(struct davinci_mcasp *mcasp)
mcasp             710 sound/soc/ti/davinci-mcasp.c 	for (i = 0; i < mcasp->num_serializer; i++)
mcasp             711 sound/soc/ti/davinci-mcasp.c 		if (mcasp->serial_dir[i] == TX_MODE)
mcasp             713 sound/soc/ti/davinci-mcasp.c 		else if (mcasp->serial_dir[i] == RX_MODE)
mcasp             716 sound/soc/ti/davinci-mcasp.c 	ret = davinci_mcasp_ch_constraint(mcasp, SNDRV_PCM_STREAM_PLAYBACK,
mcasp             721 sound/soc/ti/davinci-mcasp.c 	ret = davinci_mcasp_ch_constraint(mcasp, SNDRV_PCM_STREAM_CAPTURE,
mcasp             733 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai);
mcasp             735 sound/soc/ti/davinci-mcasp.c 	dev_dbg(mcasp->dev,
mcasp             740 sound/soc/ti/davinci-mcasp.c 		dev_err(mcasp->dev,
mcasp             748 sound/soc/ti/davinci-mcasp.c 		dev_err(mcasp->dev, "%s: Unsupported slot_width %d\n",
mcasp             753 sound/soc/ti/davinci-mcasp.c 	mcasp->tdm_slots = slots;
mcasp             754 sound/soc/ti/davinci-mcasp.c 	mcasp->tdm_mask[SNDRV_PCM_STREAM_PLAYBACK] = tx_mask;
mcasp             755 sound/soc/ti/davinci-mcasp.c 	mcasp->tdm_mask[SNDRV_PCM_STREAM_CAPTURE] = rx_mask;
mcasp             756 sound/soc/ti/davinci-mcasp.c 	mcasp->slot_width = slot_width;
mcasp             758 sound/soc/ti/davinci-mcasp.c 	return davinci_mcasp_set_ch_constraints(mcasp);
mcasp             761 sound/soc/ti/davinci-mcasp.c static int davinci_config_channel_size(struct davinci_mcasp *mcasp,
mcasp             768 sound/soc/ti/davinci-mcasp.c 	if (mcasp->slot_width)
mcasp             769 sound/soc/ti/davinci-mcasp.c 		slot_width = mcasp->slot_width;
mcasp             770 sound/soc/ti/davinci-mcasp.c 	else if (mcasp->max_format_width)
mcasp             771 sound/soc/ti/davinci-mcasp.c 		slot_width = mcasp->max_format_width;
mcasp             783 sound/soc/ti/davinci-mcasp.c 	if ((mcasp->dai_fmt & SND_SOC_DAIFMT_FORMAT_MASK) ==
mcasp             795 sound/soc/ti/davinci-mcasp.c 	if (mcasp->op_mode != DAVINCI_MCASP_DIT_MODE) {
mcasp             796 sound/soc/ti/davinci-mcasp.c 		mcasp_mod_bits(mcasp, DAVINCI_MCASP_RXFMT_REG, RXSSZ(fmt),
mcasp             798 sound/soc/ti/davinci-mcasp.c 		mcasp_mod_bits(mcasp, DAVINCI_MCASP_TXFMT_REG, TXSSZ(fmt),
mcasp             800 sound/soc/ti/davinci-mcasp.c 		mcasp_mod_bits(mcasp, DAVINCI_MCASP_TXFMT_REG, TXROT(tx_rotate),
mcasp             802 sound/soc/ti/davinci-mcasp.c 		mcasp_mod_bits(mcasp, DAVINCI_MCASP_RXFMT_REG, RXROT(rx_rotate),
mcasp             804 sound/soc/ti/davinci-mcasp.c 		mcasp_set_reg(mcasp, DAVINCI_MCASP_RXMASK_REG, mask);
mcasp             807 sound/soc/ti/davinci-mcasp.c 	mcasp_set_reg(mcasp, DAVINCI_MCASP_TXMASK_REG, mask);
mcasp             812 sound/soc/ti/davinci-mcasp.c static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream,
mcasp             815 sound/soc/ti/davinci-mcasp.c 	struct snd_dmaengine_dai_dma_data *dma_data = &mcasp->dma_data[stream];
mcasp             819 sound/soc/ti/davinci-mcasp.c 	u8 slots = mcasp->tdm_slots;
mcasp             825 sound/soc/ti/davinci-mcasp.c 	if (mcasp->version < MCASP_VERSION_3)
mcasp             826 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_PWREMUMGT_REG, MCASP_SOFT);
mcasp             829 sound/soc/ti/davinci-mcasp.c 		mcasp_set_reg(mcasp, DAVINCI_MCASP_TXSTAT_REG, 0xFFFFFFFF);
mcasp             830 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_XEVTCTL_REG, TXDATADMADIS);
mcasp             833 sound/soc/ti/davinci-mcasp.c 			mcasp->active_serializers[SNDRV_PCM_STREAM_CAPTURE];
mcasp             835 sound/soc/ti/davinci-mcasp.c 		mcasp_set_reg(mcasp, DAVINCI_MCASP_RXSTAT_REG, 0xFFFFFFFF);
mcasp             836 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_REVTCTL_REG, RXDATADMADIS);
mcasp             838 sound/soc/ti/davinci-mcasp.c 			mcasp->active_serializers[SNDRV_PCM_STREAM_PLAYBACK];
mcasp             842 sound/soc/ti/davinci-mcasp.c 	for (i = 0; i < mcasp->num_serializer; i++) {
mcasp             843 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_XRSRCTL_REG(i),
mcasp             844 sound/soc/ti/davinci-mcasp.c 			       mcasp->serial_dir[i]);
mcasp             845 sound/soc/ti/davinci-mcasp.c 		if (mcasp->serial_dir[i] == TX_MODE &&
mcasp             847 sound/soc/ti/davinci-mcasp.c 			mcasp_mod_bits(mcasp, DAVINCI_MCASP_XRSRCTL_REG(i),
mcasp             848 sound/soc/ti/davinci-mcasp.c 				       mcasp->dismod, DISMOD_MASK);
mcasp             849 sound/soc/ti/davinci-mcasp.c 			set_bit(PIN_BIT_AXR(i), &mcasp->pdir);
mcasp             851 sound/soc/ti/davinci-mcasp.c 		} else if (mcasp->serial_dir[i] == RX_MODE &&
mcasp             853 sound/soc/ti/davinci-mcasp.c 			clear_bit(PIN_BIT_AXR(i), &mcasp->pdir);
mcasp             857 sound/soc/ti/davinci-mcasp.c 			mcasp_mod_bits(mcasp, DAVINCI_MCASP_XRSRCTL_REG(i),
mcasp             860 sound/soc/ti/davinci-mcasp.c 			if (mcasp->serial_dir[i] != INACTIVE_MODE)
mcasp             861 sound/soc/ti/davinci-mcasp.c 				mcasp_mod_bits(mcasp,
mcasp             863 sound/soc/ti/davinci-mcasp.c 					       mcasp->dismod, DISMOD_MASK);
mcasp             864 sound/soc/ti/davinci-mcasp.c 			clear_bit(PIN_BIT_AXR(i), &mcasp->pdir);
mcasp             870 sound/soc/ti/davinci-mcasp.c 		numevt = mcasp->txnumevt;
mcasp             871 sound/soc/ti/davinci-mcasp.c 		reg = mcasp->fifo_base + MCASP_WFIFOCTL_OFFSET;
mcasp             874 sound/soc/ti/davinci-mcasp.c 		numevt = mcasp->rxnumevt;
mcasp             875 sound/soc/ti/davinci-mcasp.c 		reg = mcasp->fifo_base + MCASP_RFIFOCTL_OFFSET;
mcasp             879 sound/soc/ti/davinci-mcasp.c 		dev_warn(mcasp->dev, "stream has more channels (%d) than are "
mcasp             904 sound/soc/ti/davinci-mcasp.c 		dev_err(mcasp->dev, "Invalid combination of period words and "
mcasp             922 sound/soc/ti/davinci-mcasp.c 	mcasp_mod_bits(mcasp, reg, active_serializers, NUMDMA_MASK);
mcasp             923 sound/soc/ti/davinci-mcasp.c 	mcasp_mod_bits(mcasp, reg, NUMEVT(numevt), NUMEVT_MASK);
mcasp             931 sound/soc/ti/davinci-mcasp.c 	mcasp->active_serializers[stream] = active_serializers;
mcasp             936 sound/soc/ti/davinci-mcasp.c static int mcasp_i2s_hw_param(struct davinci_mcasp *mcasp, int stream,
mcasp             945 sound/soc/ti/davinci-mcasp.c 	total_slots = mcasp->tdm_slots;
mcasp             953 sound/soc/ti/davinci-mcasp.c 	if (mcasp->tdm_mask[stream]) {
mcasp             954 sound/soc/ti/davinci-mcasp.c 		active_slots = hweight32(mcasp->tdm_mask[stream]);
mcasp             960 sound/soc/ti/davinci-mcasp.c 			if ((1 << i) & mcasp->tdm_mask[stream]) {
mcasp             977 sound/soc/ti/davinci-mcasp.c 	mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, TX_ASYNC);
mcasp             979 sound/soc/ti/davinci-mcasp.c 	if (!mcasp->dat_port)
mcasp             983 sound/soc/ti/davinci-mcasp.c 		mcasp_set_reg(mcasp, DAVINCI_MCASP_TXTDM_REG, mask);
mcasp             984 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMT_REG, busel | TXORD);
mcasp             985 sound/soc/ti/davinci-mcasp.c 		mcasp_mod_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG,
mcasp             988 sound/soc/ti/davinci-mcasp.c 		mcasp_set_reg(mcasp, DAVINCI_MCASP_RXTDM_REG, mask);
mcasp             989 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMT_REG, busel | RXORD);
mcasp             990 sound/soc/ti/davinci-mcasp.c 		mcasp_mod_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG,
mcasp             997 sound/soc/ti/davinci-mcasp.c 		if (mcasp_is_synchronous(mcasp) && !mcasp->channels)
mcasp             998 sound/soc/ti/davinci-mcasp.c 			mcasp_mod_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG,
mcasp            1006 sound/soc/ti/davinci-mcasp.c static int mcasp_dit_hw_param(struct davinci_mcasp *mcasp,
mcasp            1014 sound/soc/ti/davinci-mcasp.c 	mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMT_REG, TXROT(6) | TXSSZ(15));
mcasp            1017 sound/soc/ti/davinci-mcasp.c 	mcasp_set_reg(mcasp, DAVINCI_MCASP_TXFMCTL_REG, AFSXE | FSXMOD(0x180));
mcasp            1020 sound/soc/ti/davinci-mcasp.c 	mcasp_set_reg(mcasp, DAVINCI_MCASP_TXTDM_REG, 0xFFFFFFFF);
mcasp            1023 sound/soc/ti/davinci-mcasp.c 	mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, ACLKXE | TX_ASYNC);
mcasp            1025 sound/soc/ti/davinci-mcasp.c 	mcasp_clr_bits(mcasp, DAVINCI_MCASP_XEVTCTL_REG, TXDATADMADIS);
mcasp            1028 sound/soc/ti/davinci-mcasp.c 	mcasp_set_bits(mcasp, DAVINCI_MCASP_AHCLKXCTL_REG, AHCLKXDIV(3));
mcasp            1031 sound/soc/ti/davinci-mcasp.c 	mcasp_set_bits(mcasp, DAVINCI_MCASP_TXDITCTL_REG, DITEN);
mcasp            1070 sound/soc/ti/davinci-mcasp.c 	mcasp_set_reg(mcasp, DAVINCI_MCASP_DITCSRA_REG, cs_value);
mcasp            1071 sound/soc/ti/davinci-mcasp.c 	mcasp_set_reg(mcasp, DAVINCI_MCASP_DITCSRB_REG, cs_value);
mcasp            1076 sound/soc/ti/davinci-mcasp.c static int davinci_mcasp_calc_clk_div(struct davinci_mcasp *mcasp,
mcasp            1080 sound/soc/ti/davinci-mcasp.c 	u32 reg = mcasp_get_reg(mcasp, DAVINCI_MCASP_AHCLKXCTL_REG);
mcasp            1096 sound/soc/ti/davinci-mcasp.c 			dev_warn(mcasp->dev, "Too fast reference clock (%u)\n",
mcasp            1114 sound/soc/ti/davinci-mcasp.c 			dev_info(mcasp->dev, "Sample-rate is off by %d PPM\n",
mcasp            1117 sound/soc/ti/davinci-mcasp.c 		__davinci_mcasp_set_clkdiv(mcasp, MCASP_CLKDIV_BCLK, div, 0);
mcasp            1119 sound/soc/ti/davinci-mcasp.c 			__davinci_mcasp_set_clkdiv(mcasp, MCASP_CLKDIV_AUXCLK,
mcasp            1126 sound/soc/ti/davinci-mcasp.c static inline u32 davinci_mcasp_tx_delay(struct davinci_mcasp *mcasp)
mcasp            1128 sound/soc/ti/davinci-mcasp.c 	if (!mcasp->txnumevt)
mcasp            1131 sound/soc/ti/davinci-mcasp.c 	return mcasp_get_reg(mcasp, mcasp->fifo_base + MCASP_WFIFOSTS_OFFSET);
mcasp            1134 sound/soc/ti/davinci-mcasp.c static inline u32 davinci_mcasp_rx_delay(struct davinci_mcasp *mcasp)
mcasp            1136 sound/soc/ti/davinci-mcasp.c 	if (!mcasp->rxnumevt)
mcasp            1139 sound/soc/ti/davinci-mcasp.c 	return mcasp_get_reg(mcasp, mcasp->fifo_base + MCASP_RFIFOSTS_OFFSET);
mcasp            1146 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(cpu_dai);
mcasp            1150 sound/soc/ti/davinci-mcasp.c 		fifo_use = davinci_mcasp_tx_delay(mcasp);
mcasp            1152 sound/soc/ti/davinci-mcasp.c 		fifo_use = davinci_mcasp_rx_delay(mcasp);
mcasp            1166 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(cpu_dai);
mcasp            1203 sound/soc/ti/davinci-mcasp.c 	ret = davinci_mcasp_set_dai_fmt(cpu_dai, mcasp->dai_fmt);
mcasp            1211 sound/soc/ti/davinci-mcasp.c 	if (mcasp->bclk_master && mcasp->bclk_div == 0 && mcasp->sysclk_freq) {
mcasp            1212 sound/soc/ti/davinci-mcasp.c 		int slots = mcasp->tdm_slots;
mcasp            1216 sound/soc/ti/davinci-mcasp.c 		if (mcasp->slot_width)
mcasp            1217 sound/soc/ti/davinci-mcasp.c 			sbits = mcasp->slot_width;
mcasp            1219 sound/soc/ti/davinci-mcasp.c 		davinci_mcasp_calc_clk_div(mcasp, mcasp->sysclk_freq,
mcasp            1223 sound/soc/ti/davinci-mcasp.c 	ret = mcasp_common_hw_param(mcasp, substream->stream,
mcasp            1228 sound/soc/ti/davinci-mcasp.c 	if (mcasp->op_mode == DAVINCI_MCASP_DIT_MODE)
mcasp            1229 sound/soc/ti/davinci-mcasp.c 		ret = mcasp_dit_hw_param(mcasp, params_rate(params));
mcasp            1231 sound/soc/ti/davinci-mcasp.c 		ret = mcasp_i2s_hw_param(mcasp, substream->stream,
mcasp            1237 sound/soc/ti/davinci-mcasp.c 	davinci_config_channel_size(mcasp, word_length);
mcasp            1239 sound/soc/ti/davinci-mcasp.c 	if (mcasp->op_mode == DAVINCI_MCASP_IIS_MODE) {
mcasp            1240 sound/soc/ti/davinci-mcasp.c 		mcasp->channels = channels;
mcasp            1241 sound/soc/ti/davinci-mcasp.c 		if (!mcasp->max_format_width)
mcasp            1242 sound/soc/ti/davinci-mcasp.c 			mcasp->max_format_width = word_length;
mcasp            1251 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(cpu_dai);
mcasp            1258 sound/soc/ti/davinci-mcasp.c 		davinci_mcasp_start(mcasp, substream->stream);
mcasp            1263 sound/soc/ti/davinci-mcasp.c 		davinci_mcasp_stop(mcasp, substream->stream);
mcasp            1282 sound/soc/ti/davinci-mcasp.c 	slot_width = rd->mcasp->slot_width;
mcasp            1304 sound/soc/ti/davinci-mcasp.c 	format_width = rd->mcasp->max_format_width;
mcasp            1331 sound/soc/ti/davinci-mcasp.c 	int slots = rd->mcasp->tdm_slots;
mcasp            1335 sound/soc/ti/davinci-mcasp.c 	if (rd->mcasp->slot_width)
mcasp            1336 sound/soc/ti/davinci-mcasp.c 		sbits = rd->mcasp->slot_width;
mcasp            1348 sound/soc/ti/davinci-mcasp.c 			if (rd->mcasp->auxclk_fs_ratio)
mcasp            1350 sound/soc/ti/davinci-mcasp.c 					       rd->mcasp->auxclk_fs_ratio;
mcasp            1352 sound/soc/ti/davinci-mcasp.c 				sysclk_freq = rd->mcasp->sysclk_freq;
mcasp            1354 sound/soc/ti/davinci-mcasp.c 			ppm = davinci_mcasp_calc_clk_div(rd->mcasp, sysclk_freq,
mcasp            1366 sound/soc/ti/davinci-mcasp.c 	dev_dbg(rd->mcasp->dev,
mcasp            1381 sound/soc/ti/davinci-mcasp.c 	int slots = rd->mcasp->tdm_slots;
mcasp            1392 sound/soc/ti/davinci-mcasp.c 			if (rd->mcasp->auxclk_fs_ratio)
mcasp            1394 sound/soc/ti/davinci-mcasp.c 					       rd->mcasp->auxclk_fs_ratio;
mcasp            1396 sound/soc/ti/davinci-mcasp.c 				sysclk_freq = rd->mcasp->sysclk_freq;
mcasp            1398 sound/soc/ti/davinci-mcasp.c 			if (rd->mcasp->slot_width)
mcasp            1399 sound/soc/ti/davinci-mcasp.c 				sbits = rd->mcasp->slot_width;
mcasp            1401 sound/soc/ti/davinci-mcasp.c 			ppm = davinci_mcasp_calc_clk_div(rd->mcasp, sysclk_freq,
mcasp            1410 sound/soc/ti/davinci-mcasp.c 	dev_dbg(rd->mcasp->dev,
mcasp            1434 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(cpu_dai);
mcasp            1436 sound/soc/ti/davinci-mcasp.c 					&mcasp->ruledata[substream->stream];
mcasp            1439 sound/soc/ti/davinci-mcasp.c 	int tdm_slots = mcasp->tdm_slots;
mcasp            1442 sound/soc/ti/davinci-mcasp.c 	if (mcasp->substreams[substream->stream])
mcasp            1445 sound/soc/ti/davinci-mcasp.c 	mcasp->substreams[substream->stream] = substream;
mcasp            1447 sound/soc/ti/davinci-mcasp.c 	if (mcasp->tdm_mask[substream->stream])
mcasp            1448 sound/soc/ti/davinci-mcasp.c 		tdm_slots = hweight32(mcasp->tdm_mask[substream->stream]);
mcasp            1450 sound/soc/ti/davinci-mcasp.c 	if (mcasp->op_mode == DAVINCI_MCASP_DIT_MODE)
mcasp            1462 sound/soc/ti/davinci-mcasp.c 	for (i = 0; i < mcasp->num_serializer; i++) {
mcasp            1463 sound/soc/ti/davinci-mcasp.c 		if (mcasp->serial_dir[i] == dir)
mcasp            1467 sound/soc/ti/davinci-mcasp.c 	ruledata->mcasp = mcasp;
mcasp            1476 sound/soc/ti/davinci-mcasp.c 	if (mcasp->channels && mcasp->channels < max_channels &&
mcasp            1478 sound/soc/ti/davinci-mcasp.c 		max_channels = mcasp->channels;
mcasp            1492 sound/soc/ti/davinci-mcasp.c 				   &mcasp->chconstr[substream->stream]);
mcasp            1494 sound/soc/ti/davinci-mcasp.c 	if (mcasp->max_format_width) {
mcasp            1507 sound/soc/ti/davinci-mcasp.c 	else if (mcasp->slot_width) {
mcasp            1522 sound/soc/ti/davinci-mcasp.c 	if (mcasp->bclk_master && mcasp->bclk_div == 0 && mcasp->sysclk_freq) {
mcasp            1550 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(cpu_dai);
mcasp            1552 sound/soc/ti/davinci-mcasp.c 	mcasp->substreams[substream->stream] = NULL;
mcasp            1553 sound/soc/ti/davinci-mcasp.c 	mcasp->active_serializers[substream->stream] = 0;
mcasp            1555 sound/soc/ti/davinci-mcasp.c 	if (mcasp->op_mode == DAVINCI_MCASP_DIT_MODE)
mcasp            1559 sound/soc/ti/davinci-mcasp.c 		mcasp->channels = 0;
mcasp            1560 sound/soc/ti/davinci-mcasp.c 		mcasp->max_format_width = 0;
mcasp            1578 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai);
mcasp            1580 sound/soc/ti/davinci-mcasp.c 	dai->playback_dma_data = &mcasp->dma_data[SNDRV_PCM_STREAM_PLAYBACK];
mcasp            1581 sound/soc/ti/davinci-mcasp.c 	dai->capture_dma_data = &mcasp->dma_data[SNDRV_PCM_STREAM_CAPTURE];
mcasp            1860 sound/soc/ti/davinci-mcasp.c static int davinci_mcasp_get_dma_type(struct davinci_mcasp *mcasp)
mcasp            1866 sound/soc/ti/davinci-mcasp.c 	if (!mcasp->dev->of_node)
mcasp            1869 sound/soc/ti/davinci-mcasp.c 	tmp = mcasp->dma_data[SNDRV_PCM_STREAM_PLAYBACK].filter_data;
mcasp            1870 sound/soc/ti/davinci-mcasp.c 	chan = dma_request_slave_channel_reason(mcasp->dev, tmp);
mcasp            1873 sound/soc/ti/davinci-mcasp.c 			dev_err(mcasp->dev,
mcasp            1885 sound/soc/ti/davinci-mcasp.c 		dev_dbg(mcasp->dev, "DMA controller has no of-node\n");
mcasp            1891 sound/soc/ti/davinci-mcasp.c 	dev_dbg(mcasp->dev, "DMA controller compatible = \"%s\"\n", tmp);
mcasp            1947 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = gpiochip_get_data(chip);
mcasp            1949 sound/soc/ti/davinci-mcasp.c 	if (mcasp->num_serializer && offset < mcasp->num_serializer &&
mcasp            1950 sound/soc/ti/davinci-mcasp.c 	    mcasp->serial_dir[offset] != INACTIVE_MODE) {
mcasp            1951 sound/soc/ti/davinci-mcasp.c 		dev_err(mcasp->dev, "AXR%u pin is  used for audio\n", offset);
mcasp            1957 sound/soc/ti/davinci-mcasp.c 	return pm_runtime_get_sync(mcasp->dev);
mcasp            1962 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = gpiochip_get_data(chip);
mcasp            1965 sound/soc/ti/davinci-mcasp.c 	mcasp_clr_bits(mcasp, DAVINCI_MCASP_PDIR_REG, BIT(offset));
mcasp            1968 sound/soc/ti/davinci-mcasp.c 	mcasp_clr_bits(mcasp, DAVINCI_MCASP_PFUNC_REG, BIT(offset));
mcasp            1970 sound/soc/ti/davinci-mcasp.c 	pm_runtime_put_sync(mcasp->dev);
mcasp            1976 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = gpiochip_get_data(chip);
mcasp            1980 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_PDOUT_REG, BIT(offset));
mcasp            1982 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_PDOUT_REG, BIT(offset));
mcasp            1984 sound/soc/ti/davinci-mcasp.c 	val = mcasp_get_reg(mcasp, DAVINCI_MCASP_PFUNC_REG);
mcasp            1987 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_PFUNC_REG, BIT(offset));
mcasp            1990 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_PDIR_REG, BIT(offset));
mcasp            1999 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = gpiochip_get_data(chip);
mcasp            2002 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_PDOUT_REG, BIT(offset));
mcasp            2004 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_PDOUT_REG, BIT(offset));
mcasp            2010 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = gpiochip_get_data(chip);
mcasp            2013 sound/soc/ti/davinci-mcasp.c 	val = mcasp_get_reg(mcasp, DAVINCI_MCASP_PFUNC_REG);
mcasp            2016 sound/soc/ti/davinci-mcasp.c 		mcasp_clr_bits(mcasp, DAVINCI_MCASP_PDIR_REG, BIT(offset));
mcasp            2019 sound/soc/ti/davinci-mcasp.c 		mcasp_set_bits(mcasp, DAVINCI_MCASP_PFUNC_REG, BIT(offset));
mcasp            2027 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = gpiochip_get_data(chip);
mcasp            2030 sound/soc/ti/davinci-mcasp.c 	val = mcasp_get_reg(mcasp, DAVINCI_MCASP_PDSET_REG);
mcasp            2040 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = gpiochip_get_data(chip);
mcasp            2043 sound/soc/ti/davinci-mcasp.c 	val = mcasp_get_reg(mcasp, DAVINCI_MCASP_PDIR_REG);
mcasp            2063 sound/soc/ti/davinci-mcasp.c static int davinci_mcasp_init_gpiochip(struct davinci_mcasp *mcasp)
mcasp            2065 sound/soc/ti/davinci-mcasp.c 	if (!of_property_read_bool(mcasp->dev->of_node, "gpio-controller"))
mcasp            2068 sound/soc/ti/davinci-mcasp.c 	mcasp->gpio_chip = davinci_mcasp_template_chip;
mcasp            2069 sound/soc/ti/davinci-mcasp.c 	mcasp->gpio_chip.label = dev_name(mcasp->dev);
mcasp            2070 sound/soc/ti/davinci-mcasp.c 	mcasp->gpio_chip.parent = mcasp->dev;
mcasp            2072 sound/soc/ti/davinci-mcasp.c 	mcasp->gpio_chip.of_node = mcasp->dev->of_node;
mcasp            2075 sound/soc/ti/davinci-mcasp.c 	return devm_gpiochip_add_data(mcasp->dev, &mcasp->gpio_chip, mcasp);
mcasp            2079 sound/soc/ti/davinci-mcasp.c static inline int davinci_mcasp_init_gpiochip(struct davinci_mcasp *mcasp)
mcasp            2085 sound/soc/ti/davinci-mcasp.c static int davinci_mcasp_get_dt_params(struct davinci_mcasp *mcasp)
mcasp            2087 sound/soc/ti/davinci-mcasp.c 	struct device_node *np = mcasp->dev->of_node;
mcasp            2096 sound/soc/ti/davinci-mcasp.c 		mcasp->auxclk_fs_ratio = val;
mcasp            2106 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp;
mcasp            2117 sound/soc/ti/davinci-mcasp.c 	mcasp = devm_kzalloc(&pdev->dev, sizeof(struct davinci_mcasp),
mcasp            2119 sound/soc/ti/davinci-mcasp.c 	if (!mcasp)
mcasp            2130 sound/soc/ti/davinci-mcasp.c 		dev_warn(mcasp->dev,
mcasp            2139 sound/soc/ti/davinci-mcasp.c 	mcasp->base = devm_ioremap_resource(&pdev->dev, mem);
mcasp            2140 sound/soc/ti/davinci-mcasp.c 	if (IS_ERR(mcasp->base))
mcasp            2141 sound/soc/ti/davinci-mcasp.c 		return PTR_ERR(mcasp->base);
mcasp            2145 sound/soc/ti/davinci-mcasp.c 	mcasp->op_mode = pdata->op_mode;
mcasp            2147 sound/soc/ti/davinci-mcasp.c 	if (mcasp->op_mode == DAVINCI_MCASP_IIS_MODE) {
mcasp            2151 sound/soc/ti/davinci-mcasp.c 			mcasp->tdm_slots = 2;
mcasp            2155 sound/soc/ti/davinci-mcasp.c 			mcasp->tdm_slots = 32;
mcasp            2157 sound/soc/ti/davinci-mcasp.c 			mcasp->tdm_slots = pdata->tdm_slots;
mcasp            2161 sound/soc/ti/davinci-mcasp.c 	mcasp->num_serializer = pdata->num_serializer;
mcasp            2163 sound/soc/ti/davinci-mcasp.c 	mcasp->context.xrsr_regs = devm_kcalloc(&pdev->dev,
mcasp            2164 sound/soc/ti/davinci-mcasp.c 					mcasp->num_serializer, sizeof(u32),
mcasp            2166 sound/soc/ti/davinci-mcasp.c 	if (!mcasp->context.xrsr_regs) {
mcasp            2171 sound/soc/ti/davinci-mcasp.c 	mcasp->serial_dir = pdata->serial_dir;
mcasp            2172 sound/soc/ti/davinci-mcasp.c 	mcasp->version = pdata->version;
mcasp            2173 sound/soc/ti/davinci-mcasp.c 	mcasp->txnumevt = pdata->txnumevt;
mcasp            2174 sound/soc/ti/davinci-mcasp.c 	mcasp->rxnumevt = pdata->rxnumevt;
mcasp            2175 sound/soc/ti/davinci-mcasp.c 	mcasp->dismod = pdata->dismod;
mcasp            2177 sound/soc/ti/davinci-mcasp.c 	mcasp->dev = &pdev->dev;
mcasp            2190 sound/soc/ti/davinci-mcasp.c 						irq_name, mcasp);
mcasp            2196 sound/soc/ti/davinci-mcasp.c 		mcasp->irq_request[SNDRV_PCM_STREAM_PLAYBACK] = XUNDRN;
mcasp            2197 sound/soc/ti/davinci-mcasp.c 		mcasp->irq_request[SNDRV_PCM_STREAM_CAPTURE] = ROVRN;
mcasp            2210 sound/soc/ti/davinci-mcasp.c 						IRQF_ONESHOT, irq_name, mcasp);
mcasp            2216 sound/soc/ti/davinci-mcasp.c 		mcasp->irq_request[SNDRV_PCM_STREAM_CAPTURE] = ROVRN;
mcasp            2229 sound/soc/ti/davinci-mcasp.c 						IRQF_ONESHOT, irq_name, mcasp);
mcasp            2235 sound/soc/ti/davinci-mcasp.c 		mcasp->irq_request[SNDRV_PCM_STREAM_PLAYBACK] = XUNDRN;
mcasp            2240 sound/soc/ti/davinci-mcasp.c 		mcasp->dat_port = true;
mcasp            2242 sound/soc/ti/davinci-mcasp.c 	dma_data = &mcasp->dma_data[SNDRV_PCM_STREAM_PLAYBACK];
mcasp            2248 sound/soc/ti/davinci-mcasp.c 	dma = &mcasp->dma_request[SNDRV_PCM_STREAM_PLAYBACK];
mcasp            2262 sound/soc/ti/davinci-mcasp.c 	if (mcasp->op_mode != DAVINCI_MCASP_DIT_MODE) {
mcasp            2263 sound/soc/ti/davinci-mcasp.c 		dma_data = &mcasp->dma_data[SNDRV_PCM_STREAM_CAPTURE];
mcasp            2270 sound/soc/ti/davinci-mcasp.c 		dma = &mcasp->dma_request[SNDRV_PCM_STREAM_CAPTURE];
mcasp            2284 sound/soc/ti/davinci-mcasp.c 	if (mcasp->version < MCASP_VERSION_3) {
mcasp            2285 sound/soc/ti/davinci-mcasp.c 		mcasp->fifo_base = DAVINCI_MCASP_V2_AFIFO_BASE;
mcasp            2287 sound/soc/ti/davinci-mcasp.c 		mcasp->dat_port = true;
mcasp            2289 sound/soc/ti/davinci-mcasp.c 		mcasp->fifo_base = DAVINCI_MCASP_V3_AFIFO_BASE;
mcasp            2299 sound/soc/ti/davinci-mcasp.c 	mcasp->chconstr[SNDRV_PCM_STREAM_PLAYBACK].list =
mcasp            2300 sound/soc/ti/davinci-mcasp.c 		devm_kcalloc(mcasp->dev,
mcasp            2301 sound/soc/ti/davinci-mcasp.c 			     32 + mcasp->num_serializer - 1,
mcasp            2305 sound/soc/ti/davinci-mcasp.c 	mcasp->chconstr[SNDRV_PCM_STREAM_CAPTURE].list =
mcasp            2306 sound/soc/ti/davinci-mcasp.c 		devm_kcalloc(mcasp->dev,
mcasp            2307 sound/soc/ti/davinci-mcasp.c 			     32 + mcasp->num_serializer - 1,
mcasp            2311 sound/soc/ti/davinci-mcasp.c 	if (!mcasp->chconstr[SNDRV_PCM_STREAM_PLAYBACK].list ||
mcasp            2312 sound/soc/ti/davinci-mcasp.c 	    !mcasp->chconstr[SNDRV_PCM_STREAM_CAPTURE].list) {
mcasp            2317 sound/soc/ti/davinci-mcasp.c 	ret = davinci_mcasp_set_ch_constraints(mcasp);
mcasp            2321 sound/soc/ti/davinci-mcasp.c 	dev_set_drvdata(&pdev->dev, mcasp);
mcasp            2326 sound/soc/ti/davinci-mcasp.c 	pm_runtime_get_sync(mcasp->dev);
mcasp            2327 sound/soc/ti/davinci-mcasp.c 	mcasp_set_reg(mcasp, DAVINCI_MCASP_PFUNC_REG, 0x00000000);
mcasp            2328 sound/soc/ti/davinci-mcasp.c 	pm_runtime_put(mcasp->dev);
mcasp            2330 sound/soc/ti/davinci-mcasp.c 	ret = davinci_mcasp_init_gpiochip(mcasp);
mcasp            2334 sound/soc/ti/davinci-mcasp.c 	ret = davinci_mcasp_get_dt_params(mcasp);
mcasp            2345 sound/soc/ti/davinci-mcasp.c 	ret = davinci_mcasp_get_dma_type(mcasp);
mcasp            2382 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = dev_get_drvdata(dev);
mcasp            2383 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp_context *context = &mcasp->context;
mcasp            2388 sound/soc/ti/davinci-mcasp.c 		context->config_regs[i] = mcasp_get_reg(mcasp, context_regs[i]);
mcasp            2390 sound/soc/ti/davinci-mcasp.c 	if (mcasp->txnumevt) {
mcasp            2391 sound/soc/ti/davinci-mcasp.c 		reg = mcasp->fifo_base + MCASP_WFIFOCTL_OFFSET;
mcasp            2392 sound/soc/ti/davinci-mcasp.c 		context->afifo_regs[0] = mcasp_get_reg(mcasp, reg);
mcasp            2394 sound/soc/ti/davinci-mcasp.c 	if (mcasp->rxnumevt) {
mcasp            2395 sound/soc/ti/davinci-mcasp.c 		reg = mcasp->fifo_base + MCASP_RFIFOCTL_OFFSET;
mcasp            2396 sound/soc/ti/davinci-mcasp.c 		context->afifo_regs[1] = mcasp_get_reg(mcasp, reg);
mcasp            2399 sound/soc/ti/davinci-mcasp.c 	for (i = 0; i < mcasp->num_serializer; i++)
mcasp            2400 sound/soc/ti/davinci-mcasp.c 		context->xrsr_regs[i] = mcasp_get_reg(mcasp,
mcasp            2408 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp *mcasp = dev_get_drvdata(dev);
mcasp            2409 sound/soc/ti/davinci-mcasp.c 	struct davinci_mcasp_context *context = &mcasp->context;
mcasp            2414 sound/soc/ti/davinci-mcasp.c 		mcasp_set_reg(mcasp, context_regs[i], context->config_regs[i]);
mcasp            2416 sound/soc/ti/davinci-mcasp.c 	if (mcasp->txnumevt) {
mcasp            2417 sound/soc/ti/davinci-mcasp.c 		reg = mcasp->fifo_base + MCASP_WFIFOCTL_OFFSET;
mcasp            2418 sound/soc/ti/davinci-mcasp.c 		mcasp_set_reg(mcasp, reg, context->afifo_regs[0]);
mcasp            2420 sound/soc/ti/davinci-mcasp.c 	if (mcasp->rxnumevt) {
mcasp            2421 sound/soc/ti/davinci-mcasp.c 		reg = mcasp->fifo_base + MCASP_RFIFOCTL_OFFSET;
mcasp            2422 sound/soc/ti/davinci-mcasp.c 		mcasp_set_reg(mcasp, reg, context->afifo_regs[1]);
mcasp            2425 sound/soc/ti/davinci-mcasp.c 	for (i = 0; i < mcasp->num_serializer; i++)
mcasp            2426 sound/soc/ti/davinci-mcasp.c 		mcasp_set_reg(mcasp, DAVINCI_MCASP_XRSRCTL_REG(i),