Brian,

Thanks a lot for your advice. I've just submitted the patch. Would you please 
take a look at it and see whether it fits? 

http://review.source.android.com/8900 


Thanks
Max (Xiaoyang)
 
Tel:+86.10.82171428 Fax:+86.10.82861407 iNet:87581428

-----Original Message-----
From: android-porting@googlegroups.com 
[mailto:android-port...@googlegroups.com] On Behalf Of Brian Swetland
Sent: 2009年1月13日 22:48
To: android-porting@googlegroups.com
Subject: [android-porting] Re: Backlight adjustment on Eee PC and other 
platforms


["Xiaoyang Yu (Max)" <max.a...@intel.com>]
> 
> 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.

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: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---

Reply via email to