State of the MPC5200 PSC AC97 driver

Juergen Beisert jbe at pengutronix.de
Wed Apr 16 21:24:15 EST 2008


On Tuesday 15 April 2008 10:03, Juergen Beisert wrote:
> Currently it fails to play anything with an external Wolfson WM9712
> connected to it. It seems the current AC97 reset sequence switches the
> WM9712 into testmode due to SDATA_OUT and Sync are not held low while the
> reset is active. Any idea to solve this? Switching both signals to GPIO and
> force them to low level while reset is active? How to cover PSC1 and PSC2
> with different GPIOs for this case?

Cannot reproduce the reset issue now, but in my case the bestcomm was
programmed to service the wrong PSC unit. That was the reason I never heard
any sound.

Can us give the oftree a better differentiation to program the bestcomm in a
correct manner?

Subject: [@num@/@total@] mpc52xx: Change the AC97 driver to be more generic
From: Juergen Beisert <j.beisert at pengutronix.de>

The current AC97 driver for the mpc52xx CPU is fixed to work on PSC2. This
patch tries to make it more generic, as it detects the PSC unit for AC97 usage
to forward this information into the Bestcomm-API.

Signed-off-by: Juergen Beisert <j.beisert at pengutronix.de>
---
 sound/ppc/mpc52xx_ac97.c |   21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

Index: sound/ppc/mpc52xx_ac97.c
===================================================================
--- sound/ppc/mpc52xx_ac97.c.orig
+++ sound/ppc/mpc52xx_ac97.c
@@ -651,6 +651,7 @@ mpc52xx_ac97_probe(struct of_device *op,
 	struct mpc52xx_ac97_priv *priv;
 	struct snd_card *card;
 	struct resource res;
+	int tx_initiator;
 	int rv;
 
 	dev_dbg(&op->dev, "probing MPC52xx PSC AC97 driver\n");
@@ -699,10 +700,27 @@ mpc52xx_ac97_probe(struct of_device *op,
 	/* Setup Bestcomm tasks */
 	spin_lock_init(&priv->dma_lock);
 
+	/*
+	 * PSC1 or PSC2 can be configured for AC97 usage. Select the right
+	 * channel, to let the BCOMM unit does its job correctly.
+	 */
+	switch (priv->mem_start & 0xFFFF) {
+	case 0x2000:	/* PSC1 */
+		tx_initiator = 14;
+		break;
+	case 0x2200:	/* PSC2 */
+		tx_initiator = 12;
+		break;
+	default:
+		dev_dbg(priv->dev, "Unknown PSC unit for AC97 usage!\n");
+		rv - ENODEV;
+		goto err_irq;
+	}
+
 	priv->tsk_tx = bcom_gen_bd_tx_init(AC97_TX_NUM_BD,
 				priv->mem_start + offsetof(struct mpc52xx_psc,
 							tfdata),
-				12,	/* initiator : FIXME */
+				tx_initiator,
 				2);	/* ipr : FIXME */
 	if (!priv->tsk_tx) {
 		printk(KERN_ERR DRV_NAME ": bcom_gen_bd_tx_init failed\n");
@@ -759,6 +777,7 @@ err_irqreq:
 	bcom_gen_bd_tx_release(priv->tsk_tx);
 err_bcomm:
 	mpc52xx_ac97_hwshutdown(priv);
+err_irq:
 	irq_dispose_mapping(priv->irq);
 err_irqmap:
 	iounmap(priv->psc);

Juergen

-- 
Dipl.-Ing. Juergen Beisert | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
    Handelsregister: Amtsgericht Hildesheim, HRA 2686
         Vertretung Sued/Muenchen, Germany
   Phone: +49-8766-939 228 |  Fax: +49-5121-206917-9



More information about the Linuxppc-dev mailing list