lkml.org 
[lkml]   [2011]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Reporting screen/laptop orientation data to userspace
From
Date
On Sun, 2011-05-29 at 10:49 +0300, Alberto Mardegan wrote:
> Hi all,
> the WMI interfaces in some Lenovo Ideapad laptops provide notification
> callbacks when the laptop orientation changes, reporting 4 different
> values defining the new orientation.
>
> I'd like to extend the ideapad-laptop driver with this information; but
> how should it be reported to userspace? I initially thought of the input
> subsystem, but I cannot find any suitable event codes; then I would
> probably export it as a device under /sys, or are there better options?
>
> Are there other devices which provide coarse orientation data to
> userspace, which I might want to use as a reference?
> I guess that at least some display screens have this feature.

Do you also have a discrete accelerometer with that? Or you only ever
get notification through there?

If there is a discrete accelerometer, I'd drop the extra metadata, and
send an event through udev, and expect user-space to read from the
accelerometer instead.

If there isn't a discrete accelerometer, create a fake one, with some
hardcoded data based on the actual orientation of the device.

The accelerometer (whether real or fake) should show 3 axis (X/Y/Z).

As soon as it's seen some testing, I'll be showing the work I did for
GNOME support for automatic rotation based on orientation.

Cheers



\
 
 \ /
  Last update: 2011-06-03 18:05    [W:0.192 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site