mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: linux-acpi <linux-acpi@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Len Brown <lenb@kernel.org>, Richard Purdie <rpurdie@rpsys.net>,
	Matthew Garrett <mjg59@srcf.ucam.org>, Greg KH <greg@kroah.com>
Subject: Re: [PATCH 0/3] Generic sysfs support for ACPI ALS and other ALS devices
Date: Mon, 17 Aug 2009 16:32:43 +0800	[thread overview]
Message-ID: <1250497963.5351.33.camel@rzhang-dt> (raw)
In-Reply-To: <20090806095258.GA31370@elf.ucw.cz>

On Thu, 2009-08-06 at 17:52 +0800, Pavel Machek wrote:
> Hi!
> 
> > > Yes, so just export
> > > 
> > > ALS exports
> > > 1. the current ambient light illuminance
> > > 2. the current mapped ambient light illuminance
> > > 
> > In fact, only one attribute is enough.
> 
> Good. (I thought you would want to export the 1) too, mainly for debugging).
> 
> > The ALS driver can query the current illuminance, parse the mapping and
> > only export the display luminance adjustment values to user space.
> 
> > then user space just needs to
> > 1. set a brightness level as the base point
> > 2. get the display adjustment value and calculate a proper brightness
> > level at any time.
> > 
> > this is easier, but it makes me feel that this doesn't look like an
> > _ALS_ device any more.
> > We still should export some ALS properties to user space, shouldn't
> > we?
> 
> Why? Just because ACPI specs is ugly does not mean we should make
> Linux ugly, too. Please just use suggestion above.
> 
> > Could you please look at the documentation about ALS sysfs class in the
> > patch I sent out just now, and comment on that one please? thanks!
> 
> I did. The interface is too ugly to live.

Hi, Pavel,

I tried to convert the ALS sysfs I/F to two attributes only, i.e.
illuminance and adjustment.
But I found several potential problems.
1. the illuminance to display adjustment mappings can not be convert to
a brightness level smoothly.
for example,
	illuminance	adjustment
1	600		70
2	900		100
3	1500		120
when the current illuminance is not one of the values listed in the
mappings, e.g. 750, the ALS driver don't have enough knowledge to get
the proper display adjustment, especially that a proper display
adjustment would be easy to select a proper brightness level.
We'd better leave this to user space, which is more flexible.
2. I don't know if there will be laptops exporting buggy mappings that
needs to be overridden some day, but the current sysfs I/F is easy for
expanding.
what do you think?

thanks,
rui



> 								Pavel
> 


  reply	other threads:[~2009-08-17  8:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-03  9:10 Zhang Rui
2009-08-04  1:12 ` ykzhao
2009-08-04  7:30   ` Zhang Rui
2009-08-04 13:21 ` Pavel Machek
2009-08-04 15:10   ` Greg KH
2009-08-04 17:24     ` Valdis.Kletnieks
2009-08-04 17:36       ` Greg KH
2009-08-05  1:04         ` Zhang Rui
2009-08-05 16:10           ` Valdis.Kletnieks
2009-08-06  1:51             ` Zhang Rui
2009-08-05  0:55     ` Zhang Rui
2009-08-05  1:02   ` Zhang Rui
2009-08-05 16:19     ` Pavel Machek
2009-08-06  1:41       ` Zhang Rui
2009-08-06  7:13         ` Pavel Machek
2009-08-06  8:47           ` Zhang Rui
2009-08-06  9:52             ` Pavel Machek
2009-08-17  8:32               ` Zhang Rui [this message]
2009-08-21 11:51                 ` Pavel Machek
2009-08-25  1:13                   ` Zhang Rui

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=1250497963.5351.33.camel@rzhang-dt \
    --to=rui.zhang@intel.com \
    --cc=greg@kroah.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=pavel@ucw.cz \
    --cc=rpurdie@rpsys.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

all inboxes | Powered by JetHome®