linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@cam.ac.uk>
To: Alberto Mardegan <mardy@users.sourceforge.net>
Cc: Bastien Nocera <hadess@hadess.net>,
	linux-kernel@vger.kernel.org,
	"Javier S. Pedro" <maemo@javispedro.com>,
	linux-input@vger.kernel.org
Subject: Re: Reporting screen/laptop orientation data to userspace
Date: Mon, 06 Jun 2011 09:42:58 +0100	[thread overview]
Message-ID: <4DEC9312.3080608@cam.ac.uk> (raw)
In-Reply-To: <4DEC796E.1050307@users.sourceforge.net>

On 06/06/11 07:53, Alberto Mardegan wrote:
> On 06/03/2011 06:55 PM, Bastien Nocera wrote:
>> Do you also have a discrete accelerometer with that? Or you only ever
>> get notification through there?
> 
> There's a discrete accelerometer, but I suspect that it might be hard for its driver to get accepted into the mainline kernel, since it's directly playing with the EC I/O ports. It's this one:
> 
> https://gitorious.org/iaps/iaps/blobs/master/iaps.c
> 
> The coarse data OTOH comes via a clean WMI interface.
> 
>> 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.
> 
> You mean, send an event through udev when the WMI interface reports that the orientation has changed, and then expect the userspace to read the values from the accelerometer?
> IMHO, reporting an event with no context data, it's inefficient and ugly (because it forces the userspace to perform additional acctions in order to get the data).
> 
>> If there isn't a discrete accelerometer, create a fake one, with some
>> hardcoded data based on the actual orientation of the device.
> 
> This could be a solution in both cases (i.e., even if a discrete accelerometer is available). But it would be nice to have some flags on the input device which tell that this accelerometer is not as precise as one could desire. Is there such a thing?
> 
>> 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.
> 
> Do you support choosing the accelerometer device to be used?
> 
> The device that I wanted to create is actually something much simpler than an accelerometer; it would just report screen orientation. I believe that some computer screens might have something similar, detecting the screen orientation based on the angle formed between the screen base (or wall mount) and the screen panel... I would assume that if such information exists, this Lenovo Ideapad screen orientation should be reported in a similar way.
Just for reference, there are devices on the market which do just
orientation detection (using an accelerometer inside).  I think
the ST FC30 is an example of this. Quoting from data sheet:

"When in a steady position, it is able to detect 6
different orientations with respect to the gravity
field, with notification provided through dedicated
signal lines."

Guess that fits into what you are discussing as well.

Personally I like the convenience of a 'fake' accelerometer
output.  Devices with decent orientation detection support
are, I think, less common that unprocessed accelerometers so
best to use an interface that will work with them as well
(maybe with some smart stuff to change their threshold interrupts
to provide equivalent functionality.)


  reply	other threads:[~2011-06-06  8:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-29  7:49 Reporting screen/laptop orientation data to userspace Alberto Mardegan
2011-06-02 22:19 ` Pavel Machek
2011-06-03 15:55 ` Bastien Nocera
2011-06-04 17:13   ` Mohamed Ikbel Boulabiar
2011-06-06 17:53     ` Bastien Nocera
2011-06-06  6:53   ` Alberto Mardegan
2011-06-06  8:42     ` Jonathan Cameron [this message]
2011-06-06 17:50     ` Bastien Nocera
2011-06-06 18:41       ` Alan Cox
2011-06-20 14:53         ` Bastien Nocera

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=4DEC9312.3080608@cam.ac.uk \
    --to=jic23@cam.ac.uk \
    --cc=hadess@hadess.net \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maemo@javispedro.com \
    --cc=mardy@users.sourceforge.net \
    /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;
as well as URLs for NNTP newsgroup(s).