public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@cam.ac.uk>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org, Chris Hudson <chudson@kionix.com>
Subject: Re: [PATCH 1/1] input: Add support for Kionix KXTJ9 accelerometer
Date: Mon, 16 May 2011 09:40:14 +0100	[thread overview]
Message-ID: <4DD0E2EE.7010107@cam.ac.uk> (raw)
In-Reply-To: <20110513192710.5b4791ca@lxorguk.ukuu.org.uk>

I'll leave taking a proper look until you have cleared up the issues Alan pointed out.
But as I was taking a quick look...

Firstly I concur entirely with Alan in that most of the sysfs stuff should be
platform data for an input driver.
...
> 
>> +	memcpy(tj9->pdata, client->dev.platform_data, sizeof(*tj9->pdata));
>> +	if (tj9->pdata->init) {
>> +		err = tj9->pdata->init();
>> +		if (err < 0)
>> +			goto err2;
>> +	}
>> +
>> +	tj9->irq = gpio_to_irq(tj9->pdata->gpio);
> 
> What if it's not on a gpio. Probably better any gpio and irq conversion is
> done by the platform callback/init code
Perfectly good irq element in i2c_board_info structure.  This is exactly what
it is normally used for.
> 
> 
> And the sysfs nodes need documentation.
Would be nice to have some docs on that platform data struct as well.
Most of it is fairly obvious, but data_odr_init etc aren't!
> 
> 
> Overall it looks like a lot of input drivers that get posted here
> 
> - Nobody has considered locking between actions and sysfs (or multiple
>   sysfs actions in parallel)
> - Enable/disable is implemented in blissful ignorance of what happens if
>   a disable occurs during a sysfs or other action
> 
> Most of the rest looks like it just needs a good polish.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


      reply	other threads:[~2011-05-16  8:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-13 18:13 [PATCH]input: Add support for Kionix KXTJ9 accelerometer Chris, Hudson
2011-05-13 18:13 ` [PATCH 1/1] input: " Chris, Hudson
2011-05-13 18:17   ` Chris Hudson
2011-05-13 18:27   ` Alan Cox
2011-05-16  8:40     ` Jonathan Cameron [this message]

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=4DD0E2EE.7010107@cam.ac.uk \
    --to=jic23@cam.ac.uk \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=chudson@kionix.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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