linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Stelian Pop <stelian@popies.net>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>, linux-input@vger.kernel.org
Subject: Re: [PATCH] Input: appletouch - driver refactoring
Date: Sun, 12 Oct 2008 16:54:49 +0200	[thread overview]
Message-ID: <1223823289.10176.9.camel@johannes.berg> (raw)
In-Reply-To: <1223822674.9733.5.camel@galileo>

[-- Attachment #1: Type: text/plain, Size: 1715 bytes --]

On Sun, 2008-10-12 at 16:44 +0200, Stelian Pop wrote:
> The appletouch driver has grown up from supporting only a couple of
> touchpads into supporting many touchpads, which can have different
> number of sensors, different aspect ratios etc.
> 
> This patch cleans up the current driver code and makes it easy to
> support the features of each different touchpad.
> 
> As a side effect, this patch also modifies the 'Y' multiplication factor
> of the 'geyser3' and 'geyser4' touchpads (found on Core Duo and Core2
> Duo MacBook and MacBook Pro laptops) in order to make the touchpad
> output match the aspect ratio of the touchpad (Y factor changed from 43
> to 64).

Looks nice, will give it a test later, just a small comment.


> +static struct atp_info fountain_info = {
> +	.type		= ATP_FOUNTAIN,

> +static struct atp_info geyser1_info = {
> +	.type		= ATP_GEYSER1,

> +static struct atp_info geyser2_info = {
> +	.type		= ATP_GEYSER2,

> +static struct atp_info geyser3_info = {
> +	.type		= ATP_GEYSER3,

> +static struct atp_info geyser4_info = {
> +	.type		= ATP_GEYSER4,

Those have all different types.

>  	/* reorder the sensors values */
> -	if (dev->type == ATP_GEYSER2) {
> +	if (dev->info->type == ATP_GEYSER2) {

> +				if (dev->info->type == ATP_GEYSER2)
> +					dev->info->xsensors = 20;

> -	if (dev->type != ATP_FOUNTAIN) {
> +	if (dev->info->type != ATP_FOUNTAIN) {

And there are only three uses. Do we expect to add new uses of the
types, especially different structs that share the type? Otherwise I'd
suggest to use

if (dev->info == &geyser2_info) and &fountain_info respectively and just
remove the type thing completely.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2008-10-12 14:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-09  8:49 [PATCH] appletouch driver refactoring Stelian Pop
2008-10-11  3:21 ` Dmitry Torokhov
2008-10-12 14:41   ` Stelian Pop
2008-10-12 14:44     ` [PATCH] Input: appletouch - " Stelian Pop
2008-10-12 14:54       ` Johannes Berg [this message]
2008-10-12 16:00         ` Stelian Pop
2008-10-12 16:03           ` [PATCH v3] " Stelian Pop
2008-10-13  9:45             ` Johannes Berg
2008-10-14  2:57               ` Dmitry Torokhov
2008-10-14  8:10                 ` Johannes Berg
2008-10-28  3:03               ` Dmitry Torokhov
2008-10-28  7:23                 ` Johannes Berg
2008-10-29 16:01                   ` Stelian Pop

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=1223823289.10176.9.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=stelian@popies.net \
    /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).