linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mpa@pengutronix.de (Markus Pargmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 07/10] ASoC: fsl-ssi: imx ac97 support
Date: Thu, 25 Apr 2013 13:37:16 +0200	[thread overview]
Message-ID: <20130425113716.GB27763@pengutronix.de> (raw)
In-Reply-To: <20130425035029.GB1276@S2101-09.ap.freescale.net>

On Thu, Apr 25, 2013 at 11:50:30AM +0800, Shawn Guo wrote:
> On Wed, Apr 24, 2013 at 04:36:36PM +0200, Markus Pargmann wrote:
> > +/*
> > + * Pointer to AC97 reset functions for specific boards
> > + */
> > +#if IS_ENABLED(CONFIG_MACH_PCA100)
> > +extern void pca100_ac97_cold_reset(struct snd_ac97 *ac97);
> > +extern void pca100_ac97_warm_reset(struct snd_ac97 *ac97);
> > +#else
> > +void pca100_ac97_cold_reset(struct snd_ac97 *ac97) { }
> > +void pca100_ac97_warm_reset(struct snd_ac97 *ac97) { }
> > +#endif
> > +
> > +#if IS_ENABLED(CONFIG_MACH_PCM043)
> > +extern void pcm043_ac97_cold_reset(struct snd_ac97 *ac97);
> > +extern void pcm043_ac97_warm_reset(struct snd_ac97 *ac97);
> > +#else
> > +void pcm043_ac97_cold_reset(struct snd_ac97 *ac97) { }
> > +void pcm043_ac97_warm_reset(struct snd_ac97 *ac97) { }
> > +#endif
> ...
> > @@ -717,13 +956,39 @@ static int fsl_ssi_probe(struct platform_device *pdev)
> >  
> >  	strcpy(ssi_private->name, p);
> >  
> > -	/* Initialize this copy of the CPU DAI driver structure */
> > -	memcpy(&ssi_private->cpu_dai_drv, &fsl_ssi_dai_template,
> > -	       sizeof(fsl_ssi_dai_template));
> > -	ssi_private->cpu_dai_drv.name = ssi_private->name;
> > -
> >  	ssi_private->use_dma = !of_property_read_bool(np, "fsl,imx-fiq");
> >  
> > +	if (ac97) {
> > +		sprop = of_get_property(of_find_node_by_path("/"), "compatible",
> > +				NULL);
> > +		p = strrchr(sprop, ',');
> > +		if (p)
> > +			sprop = p + 1;
> > +
> > +		if (!strcmp(sprop, "imx27-pca100")) {
> > +			ssi_private->ac97_reset = pca100_ac97_cold_reset;
> > +			ssi_private->ac97_warm_reset = pca100_ac97_warm_reset;
> > +		} else if (!strcmp(sprop, "imx27-pcm043")) {
> > +			ssi_private->ac97_reset = pcm043_ac97_cold_reset;
> > +			ssi_private->ac97_warm_reset = pcm043_ac97_warm_reset;
> > +		} else {
> > +			dev_err(&pdev->dev, "Failed to enable ssi AC97 mode, unknown board.\n");
> > +			ret = -EINVAL;
> > +			goto error_kmalloc;
> > +		}
> 
> I do not like these board specific hooks show up in an IP driver
> in such way.  Can we work it out in other ways, notification or even
> platform_data with auxdata?

soc_ac97_ops is a global symbol, so we could setup soc_ac97_ops.reset
and warm_reset in board specific ac97 drivers. For this patch I would
move the assignment of reset functions to phycore-ac97.c which already
is specifically for this codec-ssi combination on the two boards.

Regards,

Markus

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2013-04-25 11:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-24 14:36 [PATCH v5 00/10] ASoC: fsl-ssi: ac97-slave support Markus Pargmann
2013-04-24 14:36 ` [PATCH v5 01/10] ASoC: phycore-ac97: Add DT support Markus Pargmann
2013-04-24 19:45   ` Sascha Hauer
2013-04-25  3:35     ` Shawn Guo
2013-04-25 11:02       ` Markus Pargmann
2013-04-24 14:36 ` [PATCH v5 02/10] ASoC: imx-pcm-dma: " Markus Pargmann
2013-04-24 14:36 ` [PATCH v5 03/10] ASoC: imx-pcm-fiq: Introduce pcm-fiq-params Markus Pargmann
2013-04-24 14:36 ` [PATCH v5 04/10] ASoC: fsl-ssi: Add support for imx-pcm-fiq Markus Pargmann
2013-04-24 14:36 ` [PATCH v5 05/10] ASoC: fsl-ssi: Use generic DMA bindings if possible Markus Pargmann
2013-04-24 14:36 ` [PATCH v5 06/10] ARM: imx: Export ac97 reset functions Markus Pargmann
2013-04-24 14:36 ` [PATCH v5 07/10] ASoC: fsl-ssi: imx ac97 support Markus Pargmann
2013-04-25  3:50   ` Shawn Guo
2013-04-25 11:37     ` Markus Pargmann [this message]
2013-04-24 14:36 ` [PATCH v5 08/10] ASoC: fsl: Kconfig: Use fsl-ssi for phycore-ac97 Markus Pargmann
2013-04-24 14:36 ` [PATCH v5 09/10] ASoC: fsl: Move fsl-ssi binding doc to sound/ Markus Pargmann
2013-04-24 14:36 ` [PATCH v5 10/10] ASoC: fsl: Update fsl-ssi binding doc Markus Pargmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130425113716.GB27763@pengutronix.de \
    --to=mpa@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).