On Wed, Dec 15, 2010 at 1:19 AM, Lennert Buytenhek
<buytenh@xxxxxxxxxxxxxx> wrote:
> Instead of using the IRQ_AC97 define, which forces a dependency on
> platform include files, take the IRQ number to use from the specified
> platform device's first IRQ resource.
>
> Signed-off-by: Lennert Buytenhek <buytenh@xxxxxxxxxxxx>
Acked-by: Eric Miao <eric.y.miao@xxxxxxxxx>
>
> diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c
> index 88eec38..3921f4a 100644
> --- a/sound/arm/pxa2xx-ac97-lib.c
> +++ b/sound/arm/pxa2xx-ac97-lib.c
> @@ -20,7 +20,6 @@
> Â#include <sound/ac97_codec.h>
> Â#include <sound/pxa2xx-lib.h>
>
> -#include <asm/irq.h>
> Â#include <mach/regs-ac97.h>
> Â#include <mach/audio.h>
>
> @@ -314,9 +313,17 @@ EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_resume);
>
> Âint __devinit pxa2xx_ac97_hw_probe(struct platform_device *dev)
> Â{
> + Â Â Â int irq;
> Â Â Â Âint ret;
> Â Â Â Âpxa2xx_audio_ops_t *pdata = dev->dev.platform_data;
>
> + Â Â Â irq = platform_get_irq(dev, 0);
> + Â Â Â if (irq < 0) {
> + Â Â Â Â Â Â Â dev_err(&dev->dev, "no IRQ resource defined\n");
> + Â Â Â Â Â Â Â ret = -EINVAL;
> + Â Â Â Â Â Â Â goto err_conf;
> + Â Â Â }
> +
> Â Â Â Âif (pdata) {
> Â Â Â Â Â Â Â Âswitch (pdata->reset_gpio) {
> Â Â Â Â Â Â Â Âcase 95:
> @@ -359,7 +366,7 @@ int __devinit pxa2xx_ac97_hw_probe(struct platform_device *dev)
> Â Â Â Âif (ret)
> Â Â Â Â Â Â Â Âgoto err_clk2;
>
> - Â Â Â ret = request_irq(IRQ_AC97, pxa2xx_ac97_irq, IRQF_DISABLED, "AC97", NULL);
> + Â Â Â ret = request_irq(irq, pxa2xx_ac97_irq, IRQF_DISABLED, "AC97", NULL);
> Â Â Â Âif (ret < 0)
> Â Â Â Â Â Â Â Âgoto err_irq;
>
> @@ -383,7 +390,7 @@ EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_probe);
> Âvoid pxa2xx_ac97_hw_remove(struct platform_device *dev)
> Â{
> Â Â Â ÂGCR |= GCR_ACLINK_OFF;
> - Â Â Â free_irq(IRQ_AC97, NULL);
> + Â Â Â free_irq(platform_get_irq(dev, 0), NULL);
> Â Â Â Âif (ac97conf_clk) {
> Â Â Â Â Â Â Â Âclk_put(ac97conf_clk);
> Â Â Â Â Â Â Â Âac97conf_clk = NULL;
>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
[ALSA User]
[Linux Audio Users]
[Kernel Archive]
[Asterisk PBX]
[Photo Sharing]
[Linux Sound]
[Video 4 Linux]
[Gimp]
[Yosemite News]