I am attempting to convert a machine driver for the wm8753 codec into a working driver for the wm8750 codec and there is a section of code which I am unfamiliar with and am not sure what it is doing. Could someone take a look and see if they can make sense of it and its implications?
Code:
unsigned int ssi_ptcr = 0;
unsigned int dai_ptcr = 0;
unsigned int ssi_pdcr = 0;
unsigned int dai_pdcr = 0;
/* iMX51 uses SSI1 or SSI2 via AUDMUX port dai_port for audio */
/* reset port ssi_port & dai_port */
__raw_writel(0, DAM_PTCR(ssi_port));
__raw_writel(0, DAM_PTCR(dai_port));
__raw_writel(0, DAM_PDCR(ssi_port));
__raw_writel(0, DAM_PDCR(dai_port));
/* set to synchronous */
ssi_ptcr |= AUDMUX_PTCR_SYN;
dai_ptcr |= AUDMUX_PTCR_SYN;
#if WM8753_SSI_MASTER
/* set Rx sources ssi_port <--> dai_port */
ssi_pdcr |= AUDMUX_PDCR_RXDSEL(dai_port);
dai_pdcr |= AUDMUX_PDCR_RXDSEL(ssi_port);
/* set Tx frame direction and source dai_port--> ssi_port output */
ssi_ptcr |= AUDMUX_PTCR_TFSDIR;
ssi_ptcr |= AUDMUX_PTCR_TFSSEL(AUDMUX_FROM_TXFS, dai_port);
/* set Tx Clock direction and source dai_port--> ssi_port output */
ssi_ptcr |= AUDMUX_PTCR_TCLKDIR;
ssi_ptcr |= AUDMUX_PTCR_TCSEL(AUDMUX_FROM_TXFS, dai_port);
#else
/* set Rx sources ssi_port <--> dai_port */
ssi_pdcr |= AUDMUX_PDCR_RXDSEL(dai_port);
dai_pdcr |= AUDMUX_PDCR_RXDSEL(ssi_port);
/* set Tx frame direction and source ssi_port --> dai_port output */
dai_ptcr |= AUDMUX_PTCR_TFSDIR;
dai_ptcr |= AUDMUX_PTCR_TFSSEL(AUDMUX_FROM_TXFS, ssi_port);
/* set Tx Clock direction and source ssi_port--> dai_port output */
dai_ptcr |= AUDMUX_PTCR_TCLKDIR;
dai_ptcr |= AUDMUX_PTCR_TCSEL(AUDMUX_FROM_TXFS, ssi_port);
#endif
I am not sure what Rx and Tx are. From what I understand there should be no machine specific code inside a machine driver so I dont understand why its here or if I need to replicate its functionality. Also, my C skills are somewhat lacking.