diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2020-04-29 19:00:19 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2020-04-29 19:00:19 +0000 |
commit | eb2d9b0221e6f646524dd6b4226f056dfda42823 (patch) | |
tree | 504f9fceb13fccaf08a98b77fed056df644cadf3 /sys | |
parent | a30e54b89071291e749b8a07f1e4f658728cbaa2 (diff) |
Update the trickle charger diode defines based on the datasheet, and
enable the trickle charger.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/i2c/abx80x.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/i2c/abx80x.c b/sys/dev/i2c/abx80x.c index 7f55e24d2fc..2bfa8a31334 100644 --- a/sys/dev/i2c/abx80x.c +++ b/sys/dev/i2c/abx80x.c @@ -1,4 +1,4 @@ -/* $OpenBSD: abx80x.c,v 1.4 2020/04/29 18:44:28 patrick Exp $ */ +/* $OpenBSD: abx80x.c,v 1.5 2020/04/29 19:00:18 patrick Exp $ */ /* * Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org> * Copyright (c) 2018 Patrick Wildt <patrick@blueri.se> @@ -56,7 +56,8 @@ extern todr_chip_handle_t todr_handle; #define ABX8XX_TRICKLE_RESISTOR_6 (2 << 0) #define ABX8XX_TRICKLE_RESISTOR_11 (3 << 0) #define ABX8XX_TRICKLE_DIODE_SCHOTTKY (1 << 2) -#define ABX8XX_TRICKLE_DIODE_STANDARD (1 << 3) +#define ABX8XX_TRICKLE_DIODE_STANDARD (2 << 2) +#define ABX8XX_TRICKLE_ENABLE (0xa << 4) #define ABX8XX_NRTC_REGS 8 @@ -288,7 +289,7 @@ void abcrtc_trickle_charger(struct abcrtc_softc *sc, int node) { char diode[16] = { 0 }; - uint8_t reg = 0; + uint8_t reg = ABX8XX_TRICKLE_ENABLE; OF_getprop(node, "abracon,tc-diode", diode, sizeof(diode)); if (!strcmp(diode, "standard")) |