[alsa-devel] [PATCH] Allow passing platform_data to devices attached to AC97 bus

Anton Vorontsov avorontsov at ru.mvista.com
Wed Jul 22 00:34:24 CEST 2009


On Wed, Jul 22, 2009 at 12:13:12AM +0200, Marek Vasut wrote:
> Btw. I also reworked the wm97xx-battery a little more. Also, CCing power-
> supply people.

> From 0c04c7f9cac26de8b4e401c17e65051c7f44ec3e Mon Sep 17 00:00:00 2001
> From: Marek Vasut <marek.vasut at gmail.com>
> Date: Tue, 21 Jul 2009 18:52:28 +0200
> Subject: [PATCH 3/4] Convert WM97xx driver to use platform_data
> 
> This patch converts the wm97xx driver to use platform_data supplied by
> ac97 bus. Also, this fixes the related wm97xx-battery driver to use
> it's platform_data and prepares a structure for touchscreen driver.
> 
> Signed-off-by: Marek Vasut <marek.vasut at gmail.com>
> ---

Acked-by: Anton Vorontsov <cbouatmailru at gmail.com>

> +		ret = set_irq_type(gpio_to_irq(pdata->charge_gpio),
> +				IRQ_TYPE_EDGE_BOTH);
> +		if (ret)
> +			goto err2;

I always thought that request_irq() would set trigger type
as necessary if you pass IRQF_TRIGGER_* flags, so there is
no need for explicit set_irq_type() call?

This code in kernel/irq/manage.c:__setup_irq():

                /* Setup the type (level, edge polarity) if configured: */
                if (new->flags & IRQF_TRIGGER_MASK) {
                        ret = __irq_set_trigger(desc, irq,
                                        new->flags & IRQF_TRIGGER_MASK);


> +		ret = request_irq(gpio_to_irq(pdata->charge_gpio),
> +				wm97xx_chrg_irq, IRQF_DISABLED,
> +				"AC Detect", 0);
> +		if (ret)
> +			goto err3;

-- 
Anton Vorontsov
email: cbouatmailru at gmail.com
irc://irc.freenode.net/bd2


More information about the Alsa-devel mailing list