Re: [PATCH 23/25] sony-laptop: add ALS support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Il 05/06/2011 07:31, Mattia Dongili ha scritto:
To my understanding, SNC will receive GPEs in two cases under managed
mode:
  1. when the user request a backlight change via the standard acpi_video
  2. when ambient light changes

Right, more in detail:

When managed mode is set to 1, automatic backlight is desired by the user and a userspace tool is supposed to take control of every backlight change, to be applied via als_backlight node (which offers a fine grain backlight control for smooth transitions). It will receive two different types of ALS events, depending on the source of the event, as you said: 1 - ambient light change 2 - backlight change request via backlight device (in linux, the standard acpi_video backlight device). When either of the two events occurs, this software will calculate a new backlight level (using a model specific formula) and set it by writing in the als_backlight file mentioned earlier. (NOTE: this is how the hardware has been designed and it supposed to work even though workarounds are possible).

When managed mode is set to 0, no automatic backlight control is requested by the user and no userspace software is doing any backlight regulation based on the ALS readings. This implies that no ALS events are generated (regardless the source) and the standard ACPI backlight methods (used by the acpi_video backlight device) will work properly as usual.

In both cases your code sends an acpi event to userspace. Let alone the
acpi event discussion that belongs to another thread, why aren't we
just setting the requested brightness?

Simply because any calculation can be done in userspace, but if we can include the calculation stuff inside the driver, then we can get rid of the daemon, everything will be easier and we can avoid the als_backlight file too. Is it possible? The formulas are a bit complex but just a few lines of code, while the keyboard backlight based on the ambient light is just a matter of a threshold check.

--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux