Commit Graph

18 Commits

Author SHA1 Message Date
Dominggoes Isakh b31f428d60 Resolve compiler errors
* remove all unused variables
* remove all unused functions
* build with -no-error

Change-Id: I8cdf30b9e650b4905c6c122122cd3630bf153275
2018-08-14 22:26:31 +02:00
Diego Wilson 6b2b66ca41 liblights: Move device dependent modules to /vendor
Change-Id: Ia7534e9188048b95e6c85497cfeb5e28a279629b
2017-11-26 19:21:45 +00:00
Jason Vidal e95e9c31a1 liblights: Fix fast blinking notification LEDs.
Seems that the fast blinking notification LEDs experienced on some
Samsung devices was due to the removal of these two lines that clean
the 'blink' array. Propose re-inserting to correct the fast blinking
LED issue.

Change-Id: I88ea828a50468aae494b1dd54290607308de543a
2017-06-19 13:54:09 +00:00
Dominggoes Isakh df15802d15 liblights: Add BLN support
Change-Id: I3745b7c4ca7adadd62e116c71cd7357a4e8ed015
2017-06-15 22:17:47 +02:00
Paul Keith ab9abf68b7 liblights: Fix variable button brightness code
* Because we're using #ifdef in set_light_buttons(),
  defining VAR_BUTTON_BRIGHTNESS to anything, including 0,
  results in the button brightness code being enabled
* That results in broken touchkey backlight for devices
  that don't override the samsung_lights header, or defined
  this macro to 0 in their device's samsung_lights header
* Comment out the macro to correct this logic

Change-Id: Icf554b0deac975f729f1a70e517341dae74f3657
2017-06-02 21:23:51 -05:00
Dominggoes Isakh d81a0a3b06 liblights: Add support for variable touchkey brightness
Change-Id: Icc5c589e88dc342ae50b432187bae65a9b3a23d7
2017-05-30 22:14:32 +00:00
Christopher N. Hesse e37aedde2e lights: Put back fd checks before closing
While close(NULL) is indeed a harmless noop, fd can
end up being < 0 for us.

Change-Id: I56dcd7fb61c72d3ce750b13329ff42e11ab63c84
2017-04-05 18:58:09 +02:00
Christopher N. Hesse 235c298767 lights_helper: I/O API cleanup
* buf => buffer for consistency
 * explicitly cast strtol retval to int
 * close(NULL) is a no-op, remove superfluous checking
 * replace variying buffer sizes by INT_MAX_STRLEN
 * always return signed errno codes

Change-Id: I972e33e2435ec7d68a8ffdc5ab88a14d8005ff55
2017-04-02 17:27:58 +02:00
Luca Stefani a042209f66 liblights: Always apply linear scaling if max brightness isn't 255
* 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
2017-03-13 15:11:53 +01:00
Christopher N. Hesse f154b17b79 lights: Add a log tag
Change-Id: I7f4643324ed5c52b60ceede5f1ad8f24131cf3c0
2017-03-04 16:03:33 +01:00
Christopher N. Hesse 209f5deec3 lights: Cleanup read/write API
* 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
2017-03-04 15:42:49 +01:00
Christopher N. Hesse b5b9500a62 lights: Remove superfluous log newlines
Change-Id: Id1522dfe92c9e585000edd7067b50968f38c07ca
2017-03-04 15:04:16 +01:00
Simon Shields 310d1999e5 liblights: add support for adjusting notification LED brightness
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
2017-02-24 12:53:18 +00:00
Christopher N. Hesse a8fe2a112f liblights: Check for hardware support on HAL open
Change-Id: I601a987914e1774c9d1d12574f143f19f22b12e9
2016-12-31 17:14:47 +01:00
Christopher N. Hesse 898e1fe432 liblights: Expose panel brightness in helper lib
Change-Id: I810166818eac84466dfe2c4b88dff47e83a181c0
2016-12-21 14:23:38 -08:00
Christopher N. Hesse f3c6a42a21 liblights: Scale brightness if necessary
Change-Id: Ia9fdbe0c0f709e8e2e16f9cd2fb757c6f53e7c50
2016-12-08 14:56:11 +01:00
Christopher N. Hesse ae27148492 liblights: Allow devices to override node paths
* Update the copyrights while we're at it.

Change-Id: Ie1bbf1f5150428a47baf6615f32d703d578efb82
2016-12-03 05:56:19 -08:00
Christopher N. Hesse 79a9b15147 Initial unified Samsung lights HAL
Originally written by Andreas Schneider for Slte.

Change-Id: Iccff1e4532bc460896940451093470ece9086fb9
2016-01-28 22:11:16 +01:00