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

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

 



On Mon, Jun 6, 2011 at 12:21 AM, Marco Chiappero <marco@xxxxxxxxxx> wrote:
> 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.

It bothers me a bit that due to the fact that Sony implemented complex
formulas using floating point arithmetic, that would require us to use
floating point within the kernel. In fact in Sony Windows drivers
everything is done in user-space. Hiding the calculation of the lux
values and handling interrupt set-up in the kernel seems like a good
thing, but moving all management there, not.

>From what I'm researching, in newer models, brightness and backlight
calculation are also related to power status and other aspects, so
putting that into a driver will generate lots of dependencies.

Javier
--
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