All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Felipe Balbi <me@felipebalbi.com>
Cc: Sriramakrishnan <srk@ti.com>,
	linux-omap@vger.kernel.org, linux-input@vger.kernel.org
Subject: Re: [PATCH 1/3] TCA6416 keypad : Implement keypad driver for keys interfaced to TCA6416
Date: Fri, 26 Feb 2010 00:28:04 -0800	[thread overview]
Message-ID: <20100226082803.GC17444@core.coreip.homeip.net> (raw)
In-Reply-To: <20100225184702.GA5125@gandalf>

On Thu, Feb 25, 2010 at 08:47:03PM +0200, Felipe Balbi wrote:
> Hi,
> 
> On Thu, Feb 25, 2010 at 06:44:59PM +0530, Sriramakrishnan wrote:
> > This patch implements a simple Keypad driver that functions
> > as an I2C client. It handles key press events for keys
> > connected to TCA6416 I2C based IO expander.
> 
> what's wrong with gpio-keys ??
> 
> > + * Implementation based on drivers/input/keyboard/gpio_keys.c
> 
> I see,
> 
> shouldn't you instead provide a gpiolib driver for tca6416 and use the
> generic gpio_keys driver ??
> 

Right. The fact that the driver precludes all otehr gpios from being
used is a major drawback.


> > +	if (!chip->use_polling) {
> 
> IMO, you should only use polling if the irq line isn't connected.
> 
> > +		if (pdata->irq_is_gpio)
> > +			chip->irqnum = gpio_to_irq(pdata->irqnum);
> 
> you can pass the irq number via i2c_board_info. Use it.
> 
> > +		else
> > +			chip->irqnum = pdata->irqnum;
> > +
> > +		ret = request_irq(chip->irqnum, tca6416_keys_isr,
> 
> it's an i2c driver!!! this should be request_threaded_irq()
> 

Threaded IRQ probably does not fit well when you want to support both
interrupt and polling in the same driver...

-- 
Dmitry

  reply	other threads:[~2010-02-26  8:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-25 13:14 [PATCH 0/3] Add support for TCA6416 based Keypad driver Sriramakrishnan
2010-02-25 13:14 ` [PATCH 1/3] TCA6416 keypad : Implement keypad driver for keys interfaced to TCA6416 Sriramakrishnan
2010-02-25 13:15   ` [PATCH 2/3] AM3517 EVM : Enable TCA6416 keypad Sriramakrishnan
2010-02-25 13:15     ` [PATCH 3/3] AM3517: Board hookup for TCA6416 keypad driver Sriramakrishnan
2010-02-25 18:47   ` [PATCH 1/3] TCA6416 keypad : Implement keypad driver for keys interfaced to TCA6416 Felipe Balbi
2010-02-26  8:28     ` Dmitry Torokhov [this message]
2010-02-26 14:43       ` Govindarajan, Sriramakrishnan
2010-02-27  9:00         ` Dmitry Torokhov
2010-03-05 15:06           ` Govindarajan, Sriramakrishnan
2010-02-27 18:57   ` Anirudh Ghayal

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=20100226082803.GC17444@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=me@felipebalbi.com \
    --cc=srk@ti.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.