Commit ea8b27ad authored by Jon Smirl's avatar Jon Smirl Committed by Mark Brown

ASoC: Modify mpc5200 AC97 driver to use V9 of spin_event_timeout()

The function signature for spin_event_timeout() has changed in version V9.
Adjust the mpc5200 AC97 driver to use the new function.
Signed-off-by: default avatarJon Smirl <jonsmirl@gmail.com>
Acked-by: default avatarTimur Tabi <timur@freescale.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 08d15f03
...@@ -31,13 +31,13 @@ static struct psc_dma *psc_dma; ...@@ -31,13 +31,13 @@ static struct psc_dma *psc_dma;
static unsigned short psc_ac97_read(struct snd_ac97 *ac97, unsigned short reg) static unsigned short psc_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
{ {
int rc; int status;
unsigned int val; unsigned int val;
/* Wait for command send status zero = ready */ /* Wait for command send status zero = ready */
spin_event_timeout(!(in_be16(&psc_dma->psc_regs->sr_csr.status) & status = spin_event_timeout(!(in_be16(&psc_dma->psc_regs->sr_csr.status) &
MPC52xx_PSC_SR_CMDSEND), 100, 0, rc); MPC52xx_PSC_SR_CMDSEND), 100, 0);
if (rc == 0) { if (status == 0) {
pr_err("timeout on ac97 bus (rdy)\n"); pr_err("timeout on ac97 bus (rdy)\n");
return -ENODEV; return -ENODEV;
} }
...@@ -45,9 +45,9 @@ static unsigned short psc_ac97_read(struct snd_ac97 *ac97, unsigned short reg) ...@@ -45,9 +45,9 @@ static unsigned short psc_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
out_be32(&psc_dma->psc_regs->ac97_cmd, (1<<31) | ((reg & 0x7f) << 24)); out_be32(&psc_dma->psc_regs->ac97_cmd, (1<<31) | ((reg & 0x7f) << 24));
/* Wait for the answer */ /* Wait for the answer */
spin_event_timeout((in_be16(&psc_dma->psc_regs->sr_csr.status) & status = spin_event_timeout((in_be16(&psc_dma->psc_regs->sr_csr.status) &
MPC52xx_PSC_SR_DATA_VAL), 100, 0, rc); MPC52xx_PSC_SR_DATA_VAL), 100, 0);
if (rc == 0) { if (status == 0) {
pr_err("timeout on ac97 read (val) %x\n", pr_err("timeout on ac97 read (val) %x\n",
in_be16(&psc_dma->psc_regs->sr_csr.status)); in_be16(&psc_dma->psc_regs->sr_csr.status));
return -ENODEV; return -ENODEV;
...@@ -66,12 +66,12 @@ static unsigned short psc_ac97_read(struct snd_ac97 *ac97, unsigned short reg) ...@@ -66,12 +66,12 @@ static unsigned short psc_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
static void psc_ac97_write(struct snd_ac97 *ac97, static void psc_ac97_write(struct snd_ac97 *ac97,
unsigned short reg, unsigned short val) unsigned short reg, unsigned short val)
{ {
int rc; int status;
/* Wait for command status zero = ready */ /* Wait for command status zero = ready */
spin_event_timeout(!(in_be16(&psc_dma->psc_regs->sr_csr.status) & status = spin_event_timeout(!(in_be16(&psc_dma->psc_regs->sr_csr.status) &
MPC52xx_PSC_SR_CMDSEND), 100, 0, rc); MPC52xx_PSC_SR_CMDSEND), 100, 0);
if (rc == 0) { if (status == 0) {
pr_err("timeout on ac97 bus (write)\n"); pr_err("timeout on ac97 bus (write)\n");
return; return;
} }
...@@ -82,24 +82,22 @@ static void psc_ac97_write(struct snd_ac97 *ac97, ...@@ -82,24 +82,22 @@ static void psc_ac97_write(struct snd_ac97 *ac97,
static void psc_ac97_warm_reset(struct snd_ac97 *ac97) static void psc_ac97_warm_reset(struct snd_ac97 *ac97)
{ {
int rc;
struct mpc52xx_psc __iomem *regs = psc_dma->psc_regs; struct mpc52xx_psc __iomem *regs = psc_dma->psc_regs;
out_be32(&regs->sicr, psc_dma->sicr | MPC52xx_PSC_SICR_AWR); out_be32(&regs->sicr, psc_dma->sicr | MPC52xx_PSC_SICR_AWR);
spin_event_timeout(0, 3, 0, rc); udelay(3);
out_be32(&regs->sicr, psc_dma->sicr); out_be32(&regs->sicr, psc_dma->sicr);
} }
static void psc_ac97_cold_reset(struct snd_ac97 *ac97) static void psc_ac97_cold_reset(struct snd_ac97 *ac97)
{ {
int rc;
struct mpc52xx_psc __iomem *regs = psc_dma->psc_regs; struct mpc52xx_psc __iomem *regs = psc_dma->psc_regs;
/* Do a cold reset */ /* Do a cold reset */
out_8(&regs->op1, MPC52xx_PSC_OP_RES); out_8(&regs->op1, MPC52xx_PSC_OP_RES);
spin_event_timeout(0, 10, 0, rc); udelay(10);
out_8(&regs->op0, MPC52xx_PSC_OP_RES); out_8(&regs->op0, MPC52xx_PSC_OP_RES);
spin_event_timeout(0, 50, 0, rc); udelay(50);
psc_ac97_warm_reset(ac97); psc_ac97_warm_reset(ac97);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment