linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: linux-input@vger.kernel.org,
	uclinux-dist-devel@blackfin.uclinux.org,
	Michael Hennerich <michael.hennerich@analog.com>
Subject: Re: [PATCH v2] Input: ad7879: split bus logic out
Date: Tue, 19 Jan 2010 00:26:52 -0800	[thread overview]
Message-ID: <20100119082652.GA19338@core.coreip.homeip.net> (raw)
In-Reply-To: <1263876764-6464-1-git-send-email-vapier@gentoo.org>

Hi Mike,

On Mon, Jan 18, 2010 at 11:52:44PM -0500, Mike Frysinger wrote:
> The ad7879 driver is using the old bus method of only supporting one at a
> time (I2C or SPI).  So refactor it like the other input drivers that
> support multiple busses simultaneously.
> 

Nice patch, thank you. A couple of suggestions though:

> -
>  struct ad7879 {
> -	bus_device		*bus;
> +	struct ad7879_bus_ops	bops;

Could you change it to 'const struct ad7879_bus_ops *bops;' and add a
separate pointer to private transport data so that bus ops are truly
shared between instances (if any).

>  	struct input_dev	*input;
>  	struct work_struct	work;
>  	struct timer_list	timer;

Also I dont see the reason for having the following typedefs:

> +
> +typedef int (ad7879_read_t) (void *bus_data, u8 reg);
> +typedef int (ad7879_multi_read_t) (void *bus_data, u8 first_reg, u8 count, u16 *buf);
> +typedef int (ad7879_write_t) (void *bus_data, u8 reg, u16 val);
> +
> +struct ad7879_bus_ops {
> +	void *bus_data;
> +	int irq;
> +	ad7879_read_t *read;
> +	ad7879_multi_read_t *multi_read;
> +	ad7879_write_t *write;
> +};
> +
> +int ad7879_disable(struct device *dev);
> +int ad7879_enable(struct device *dev);
> +int ad7879_probe(struct device *dev, struct ad7879_bus_ops *bops, u8 devid, u16 bustype);
> +int ad7879_remove(struct device *dev);

Hmm, I liked when these accepted "struct ad7879" better.

Thanks.

-- 
Dmitry

  reply	other threads:[~2010-01-19  8:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-17 15:38 [PATCH] Input: ad7879: split bus logic out Mike Frysinger
2010-01-19  4:52 ` [PATCH v2] " Mike Frysinger
2010-01-19  8:26   ` Dmitry Torokhov [this message]
2010-01-19  8:46     ` [Uclinux-dist-devel] " Mike Frysinger
2010-01-19  8:51       ` Dmitry Torokhov
2010-01-19  8:57         ` Mike Frysinger
2010-01-19  8:56     ` [PATCH v3] " Mike Frysinger
2010-05-21  8:10       ` [Uclinux-dist-devel] " Mike Frysinger

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=20100119082652.GA19338@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=uclinux-dist-devel@blackfin.uclinux.org \
    --cc=vapier@gentoo.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).