public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Éric Piel" <eric.piel@tremplin-utc.net>
To: Daniel Mack <daniel@caiaq.de>
Cc: LKML <linux-kernel@vger.kernel.org>, Pavel Machek <pavel@ucw.cz>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] lis3: add click function
Date: Fri, 12 Jun 2009 14:50:08 +0200	[thread overview]
Message-ID: <4A324F00.7020602@tremplin-utc.net> (raw)
In-Reply-To: <20090612123156.GE29236@buzzloop.caiaq.de>

Op 12-06-09 14:31, Daniel Mack schreef:
:
> 
> It's not so much black magic but follows the standard procedure for
> passing device specific data to probed SPI devices. What you find in
> board support code for embedded devices is a defintion of an
> spi_board_info struct. On my platform, it looks like this for the lis3
> device:
> 
> static struct lis3lv02d_platform_data lis3_pdata = {
>         .click_flags    = LIS3_CLICK_SINGLE_X |
>                           LIS3_CLICK_SINGLE_Y |
>                           LIS3_CLICK_SINGLE_Z,
>         .click_thresh_x = 10,
>         .click_thresh_y = 10,
>         .click_thresh_z = 10,
>         .irq_cfg        = LIS3_IRQ1_CLICK,
>                           LIS3_IRQ_ACTIVE_HIGH,
> };
> 
> static struct spi_board_info my_spi_devices[] __initdata = {
>         {
>                 .modalias       = "lis3lv02d_spi",
>                 .max_speed_hz   = 1000000,
>                 .bus_num        = 0,
>                 .chip_select    = 0,
>                 .controller_data = (void *) mfp_to_gpio(GPIO_ACCEL_CS),
>                 .platform_data  = &lis3_pdata,
>                 .irq            = gpio_to_irq(mfp_to_gpio(GPIO_ACCEL_IRQ)),
>         },
> 
I see. So your platform is not among the one contained in the vanilla
kernel? Shouldn't this above code be written somewhere so that people
know about it? Some of the values do not seem especially obvious!

> I don't know ACPI, so I can't say how a similiar abstraction could be
> achieved.
> 
>> Also, it seems to only set up the "click" feature, without ever using
>> it. How do you access this information from userspace? Is it specific to
>> SPI? Maybe it could also generate button events in the joystick interface?
> 
> We're using the IRQ outputs of that chips directly as source to other
> circuity, so there is no userspace logic in the game. If anyone needs
> that, a simple callback function would be easy to add at some later
> point.
I guess that to have the functionality in ACPI, a complete handling of
the interruptions, up to the generation of button events would be
needed. This can be done later on, whenever someone finds the need...

> 
> See the updated patch below.
Looks good to me.

> 
> From 17d749d1f7b9c1287cc5b8109921e7a6f149b8bc Mon Sep 17 00:00:00 2001
> From: Daniel Mack <daniel@caiaq.de>
> Date: Thu, 11 Jun 2009 21:47:10 +0200
> Subject: [PATCH] lis3: add click function
> 

Acked-by: Eric Piel <eric.piel@tremplin-utc.net>

Thanks,
Eric

  reply	other threads:[~2009-06-12 12:50 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
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 [this message]
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=4A324F00.7020602@tremplin-utc.net \
    --to=eric.piel@tremplin-utc.net \
    --cc=akpm@linux-foundation.org \
    --cc=daniel@caiaq.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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