All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Daniel Mack <daniel@caiaq.de>
Cc: linux-kernel@vger.kernel.org, Eric Piel <eric.piel@tremplin-utc.net>
Subject: Re: [PATCH] lis3: add click function
Date: Thu, 11 Jun 2009 23:07:55 +0200	[thread overview]
Message-ID: <20090611210755.GC27376@elf.ucw.cz> (raw)
In-Reply-To: <1244750146-31215-1-git-send-email-daniel@caiaq.de>

On Thu 2009-06-11 21:55:46, Daniel Mack wrote:
> The LIS3 accelerometer chip has a 'click' feature which can be used to
> detect sudden motion on any of the three axis. Configuration data is
> passed via spi platform_data and no action is taken if that's not
> specified, so it won't harm any existing platform.
> 
> To make the configuration effective, the IRQ lines need to be set up
> appropriately. This patch also adds a way to do that from board support
> code.
> 
> The DD_* definitions were removed because I couldn't find any reference
> of them in the datasheet and the overlapped with the CLICK_ register
> space.
> 
> Signed-off-by: Daniel Mack <daniel@caiaq.de>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: Eric Piel <eric.piel@tremplin-utc.net>

Well, patch looks mostly okay, but it would be nice to separate
cleanups onto separate patch... 
 
> index 07ae74b..8d50ef2 100644
> --- a/drivers/hwmon/lis3lv02d_spi.c
> +++ b/drivers/hwmon/lis3lv02d_spi.c
> @@ -66,21 +66,22 @@ static int __devinit lis302dl_spi_probe(struct spi_device *spi)
>  	if (ret < 0)
>  		return ret;
>  
> -	lis3_dev.bus_priv = spi;
> -	lis3_dev.init = lis3_spi_init;
> -	lis3_dev.read = lis3_spi_read;
> -	lis3_dev.write = lis3_spi_write;
> -	lis3_dev.irq = spi->irq;
> -	lis3_dev.ac = lis3lv02d_axis_normal;
> +	lis3_dev.bus_priv	= spi;
> +	lis3_dev.init		= lis3_spi_init;
> +	lis3_dev.read		= lis3_spi_read;
> +	lis3_dev.write		= lis3_spi_write;
> +	lis3_dev.irq		= spi->irq;
> +	lis3_dev.ac		= lis3lv02d_axis_normal;
> +	lis3_dev.pdata		= spi->dev.platform_data;
>  	spi_set_drvdata(spi, &lis3_dev);
>  
> -	ret = lis3lv02d_init_device(&lis3_dev);
> -	return ret;
> +	return lis3lv02d_init_device(&lis3_dev);
>  }
>  
>  static int __devexit lis302dl_spi_remove(struct spi_device *spi)
>  {
>  	struct lis3lv02d *lis3 = spi_get_drvdata(spi);
> +
>  	lis3lv02d_joystick_disable();
>  	lis3lv02d_poweroff(lis3);
>  	return 0;

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2009-06-11 21:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-11 19:55 [PATCH] lis3: add click function Daniel Mack
2009-06-11 21:07 ` Pavel Machek [this message]
2009-06-12 10:13   ` Daniel Mack
2009-06-12 10:18     ` Pavel Machek
     [not found]       ` <1244803042-2913-1-git-send-email-daniel@caiaq.de>
2009-06-12 11:44         ` Éric Piel
2009-06-12 12:31           ` Daniel Mack
2009-06-12 12:50             ` Éric Piel
2009-06-12 12:55               ` Daniel Mack

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=20090611210755.GC27376@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=daniel@caiaq.de \
    --cc=eric.piel@tremplin-utc.net \
    --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 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.