lkml.org 
[lkml]   [2009]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] lis3: add click function
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


\
 
 \ /
  Last update: 2009-06-12 14:53    [from the cache]
©2003-2011 Jasper Spaans