Re: [PATCH] Allow passing platform_data to devices attached to AC97 bus

Anton Vorontsov
2009-07-21T22:34:26Z

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@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@gmail.com>
> ---

Acked-by: Anton Vorontsov <cbouatmailru@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@gmail.com
irc://irc.freenode.net/bd2