* As of now the code account only max_brightness > 255
-> Check if max_brightness != 255 and apply the scaling
even if the max_brightness is less then 255
Change-Id: I809ece5844c8ccf20ae6507f23d308fe3ddfe94b
* Use O_WRONLY for write
* Return errno for write
* Log all failures
* Fix read_int():
We would always treat strtol(...) = 0 as an error,
although the real value can very well be 0.
Check the end pointer to fix this.
Change-Id: Id2bc9acc103a7a6400dd06f3904af37cbb0b5174
The old exynos4x12 lights HAL had logic for scaling the brightness of
lights according to the light's type and also scaling each R/G/B colour.
Bring this logic across, and make the battery LED not eye-searing at
night.
Based on work by Daniel Hillenbrand.
REGRESSION-66
Change-Id: Ia6108468f57c3b6c6a1a68da76a1c3362fd982a5