lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A324F00.7020602@tremplin-utc.net>
Date:	Fri, 12 Jun 2009 14:50:08 +0200
From:	Éric Piel <eric.piel@...mplin-utc.net>
To:	Daniel Mack <daniel@...aq.de>
Cc:	LKML <linux-kernel@...r.kernel.org>, Pavel Machek <pavel@....cz>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [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@...aq.de>
> Date: Thu, 11 Jun 2009 21:47:10 +0200
> Subject: [PATCH] lis3: add click function
> 

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

Thanks,
Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ