[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5d5443650902272151g7595deb4gc91145a4c6938b74@mail.gmail.com>
Date: Sat, 28 Feb 2009 11:21:39 +0530
From: Trilok Soni <soni.trilok@...il.com>
To: Felipe Balbi <me@...ipebalbi.com>
Cc: linux-kernel@...r.kernel.org, linux-input@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Felipe Balbi <felipe.balbi@...ia.com>,
David Brownell <dbrownell@...rs.sourceforge.net>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Samuel Ortiz <sameo@...nedhand.com>
Subject: Re: [PATCH 1/2] input: misc: add twl4030-pwrbutton driver
Hi Felipe,
> +++ b/drivers/input/misc/twl4030-pwrbutton.c
> @@ -0,0 +1,147 @@
> +/**
> + * drivers/i2c/chips/twl4030-pwrbutton.c
> + *
Please remove this file path.
> +
> +static struct input_dev *powerbutton_dev;
> +static struct device *dbg_dev;
> +
> +static irqreturn_t powerbutton_irq(int irq, void *dev_id)
> +{
> + int err;
> + u8 value;
> +
> +#ifdef CONFIG_LOCKDEP
> + /* WORKAROUND for lockdep forcing IRQF_DISABLED on us, which
> + * we don't want and can't tolerate. Although it might be
> + * friendlier not to borrow this thread context...
> + */
> + local_irq_enable();
> +#endif
> +
> + err = twl4030_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &value,
> + STS_HW_CONDITIONS);
> + if (!err) {
> + input_report_key(powerbutton_dev, KEY_POWER,
> + value & PWR_PWRON_IRQ);
input_sync(...) please.
> + } else {
> + dev_err(dbg_dev, "twl4030: i2c error %d while reading TWL4030"
> + " PM_MASTER STS_HW_CONDITIONS register\n", err);
> + }
> +
> +static int __devexit twl4030_pwrbutton_remove(struct platform_device *pdev)
> +{
> + int irq = platform_get_irq(pdev, 0);
> +
> + free_irq(irq, NULL);
> + input_unregister_device(powerbutton_dev);
> + input_free_device(powerbutton_dev);
No need of input_free_device after input_unregister_device.
> +
> + return 0;
> +}
> +
> +struct platform_driver twl4030_pwrbutton_driver = {
> + .probe = twl4030_pwrbutton_probe,
> + .remove = twl4030_pwrbutton_remove,
__devexit_p(...)
--
---Trilok Soni
http://triloksoni.wordpress.com
http://www.linkedin.com/in/triloksoni
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists