>-----Original Message-----
>From: [email protected] 
>[mailto:[email protected]] On Behalf Of Brian Swetland
>Sent: Tuesday, January 13, 2009 10:48 PM
>To: [email protected]
>Subject: [android-porting] Re: Backlight adjustment on Eee PC 
>and other platforms
>
>
>["Xiaoyang Yu (Max)" <[email protected]>]
>> 
>> Current Android code for backlight adjustment do not work 
>properly for
>> systems other than G1. This is mainly because:
>> 
>> 1) The corresponding sysfs file changed. In "mydroid/hardware/
>> libhardware/power/power.c", LCD_BACKLIGHT is hard coded to 
>"/sys/class/
>> leds/lcd-backlight/brightness". While it should be "/sys/class/
>> backlight/eeepc/backlight/brightness" for Eee PC.
>> 
>> 2) The backlight range is assumed to be from 0 - 255 as in "mydroid/
>> packages/apps/Settings/src/com/android/settings/
>> BrightnessPreference.java". While it should be from 0 - 7 for Eee PC.
>> 
>> For 1), we can use a property to set the value for the LCD_BACKLIGHT,
>> instead of hard code it.
>> For 2), we can check sysfs file "max_brightness" to get the max
>> backlight level.
>
>I'd prefer that we not use system properties for things that are static
>build configurations, not likely to change at runtime.  Right now
>there's some abuse of properties along this line, which I'm hoping to
>address in the future, but for the time being, it's best to 
>avoid adding
>more properties.
>

One question: What should be a proper way to config such "static build 
configuration" for different platforms if property is designed for runtime 
config? 
I think the Android should retain a stable hw/control interfaces and leave the 
specific implementation to the platform vendor. 
I believe there should be some other similar cases and it might not be good or 
even not be feasible to use the runtime searching for some of them. 
How about symbol link? But in userspace, it seems not be able to create symbol 
link under /sys. 

Thanks
Jackie 

>It might not be unreasonable to have the generic power code check for
>/sys/class/backlight/... (scan, not look for hardcoded names 
>like eeepc)
>and if it doesn't find something there, see if there's a
>/sys/class/leds/lcd-backlight/...
>
>Picking up the max value from sysfs seems like the way to go.
>
>Brian
>
>>
>

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---

Reply via email to