summaryrefslogtreecommitdiff
path: root/driver/led/lm3630a.c
Commit message (Collapse)AuthorAgeFilesLines
* Update license boilerplate text in source code filesMike Frysinger2022-09-121-1/+1
| | | | | | | | | | | | | | | Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icd3a1723c20595356af83d190b2c6a9078b3013b Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3891203 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* driver/led/lm3630a.c: Format with clang-formatJack Rosenthal2022-06-281-11/+8
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Ibfce9d69a1ad2a0126c0e2d6816aafd83fd46734 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730015 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* driver/led: Remove unused functionTom Hughes2021-10-051-6/+0
| | | | | | | | | | | | | | | | | Building with clang: driver/led/lm3630a.c:23:19: error: unused function 'lm3630a_read' [-Werror,-Wunused-function] static inline int lm3630a_read(uint8_t reg, int *val) BRANCH=none BUG=b:172020503 TEST=make CC=arm-none-eabi-clang BOARD=aleena Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: If4a26261d41f470c2cb86208e3c1eaada0b2ff3e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3202999 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Remove __7b, __8b and __7bfDenis Brockus2019-07-201-3/+3
| | | | | | | | | | | | | | | | | | | The extentions were added to make the compiler perform most of the verification that the conversion was being done correctly to remove 8bit addressing as the standard I2C/SPI address type. Now that the compiler has verified the code, the extra extentions are being removed BUG=chromium:971296 BRANCH=none TEST=make buildall -j TEST=verify sensor functionality on arcada_ish Change-Id: I36894f8bb9daefb5b31b5e91577708f6f9af2a4f Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1704792 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Use 7bit I2C/SPI slave addresses in ECDenis Brockus2019-07-191-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opt for 7bit slave addresses in EC code. If 8bit is expected by a driver, make it local and show this in the naming. Use __7b, __7bf and __8b as name extensions for i2c/spi addresses used in the EC codebase. __7b indicates a 7bit address by itself. __7bf indicates a 7bit address with optional flags attached. __8b indicates a 8bit address by itself. Allow space for 10bit addresses, even though this is not currently being used by any of our attached devices. These extensions are for verification purposes only and will be removed in the last pass of this ticket. I want to make sure the variable names reflect the type to help eliminate future 7/8/7-flags confusion. BUG=chromium:971296 BRANCH=none TEST=make buildall -j Change-Id: I2fc3d1b52ce76184492b2aaff3060f486ca45f45 Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1699893 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* driver/led/lm3630a: Wait 1ms for I2C to be readyEdward Hill2018-12-231-0/+6
| | | | | | | | | | | | | | | | | | | LM3630A will NAK I2C transactions for 1ms (tWAIT in the datasheet) after HWEN asserted or after SW reset. Add msleep(1) to start of lm3630a_poweron(). BUG=b:119849255 BRANCH=grunt TEST=keyboard backlight still works after resume from S3: suspend_stress_test -c 1 --suspend_min=15 --suspend_max=20 ectool pwmsetkblight 0 ectool pwmsetkblight 100 Change-Id: Ie98e8759c85db6a6f2d8beeee834cabbecfec2c0 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1389060 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* driver/led/lm3630a: Only set brightness after 100+ms.Nicolas Boichat2018-09-201-6/+16
| | | | | | | | | | | | | | | | | | | | On whiskers, after setting up the banks, the backlight blinks for a short duration (~100ms). This can be prevented by setting the brightness only ~100ms after setting up the rest of the registers. We probably do not want to sleep for too long in the init function, so set the brightness in a deferred function. BRANCH=nocturne BUG=b:111010124 TEST=Connect whiskers, see that backlight does not blink. TEST=Backlight control is still functional. Change-Id: Ie7490ea1f9f6731ede3efba63e6793525c5ea786 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1126698 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Revert "driver/led/lm3630a: Configure 261ms startup ramp time"Nicolas Boichat2018-09-201-4/+0
| | | | | | | | | | | | | | This reverts commit 5a09049c5cc9a30ddfbe69e11b833146d8f5f04f, which does not appear to fully work... BRANCH=nocturne BUG=b:111010124 TEST=N/A Change-Id: Ibf27ff27d8da685009377ef7a6c66ed86f279229 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1234749 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* driver/led/lm3630a: Configure 261ms startup ramp timeNicolas Boichat2018-09-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | It appears that, on startup, LM3630A starts by assuming some high input PWM value, so when the brightness is set to 0xff, it first drives the output, and slowly dims it as the PWM input LPF takes effect (takes about 50ms). We workaround this issue by adding a 261ms start-up ramp, to prevent LM3630A from driving backlight right after the brightness value is set. AFAICT, this has no effect on the user, even when transitioning from off to on backlight, as the ramp only applies when the brightness is first set. BRANCH=nocturne BUG=b:111010124 TEST=Connect whiskers, no backlight blip Change-Id: Ia4dafe9a54aa40a4eae865581a06670e94eb6364 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1230973 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* driver/led/lm3630a: Disable Bank B, avoid race setting brightnessNicolas Boichat2018-02-071-9/+8
| | | | | | | | | | | | | | | | | | | | It is not necessary to enable Bank B, as we do not use it. Also, we have seen a race between enabling the banks and writing the brightness register to 0xFF, where the chip would reset the value after it has been set by EC. Adding a short 100us sleep fixes the issue. BRANCH=none BUG=b:69379749 TEST=Flash whiskers, pwm 0 50 works, even after a cold reset. Change-Id: Ic523a2475c3874c8433eb1b39e927793dd893e8f Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/906165 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Benjamin Gordon <bmgordon@chromium.org>
* driver/led: Add LM3630A driverBenjamin Gordon2018-01-251-0/+69
This chip controls the keyboard backlight. The backlight level is set through PWM, but the chip needs to be enabled and configured before PWM settings are recognized. This will be initially used for grunt and zoombini. BUG=b:69379749 BRANCH=none TEST=In EC console for grunt: kblight 100; kblight 0 Change-Id: I5576d709687d8f61b5757485baa239ffd6b41a74 Signed-off-by: Benjamin Gordon <bmgordon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/879082 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>