summaryrefslogtreecommitdiff
path: root/zephyr
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2021-03-19 12:53:07 -0700
committerCommit Bot <commit-bot@chromium.org>2021-03-24 00:36:26 +0000
commitb8cee54d69416a4035e5a34be196656bf68036c5 (patch)
tree204cbc5cc7a8576f49ebe6fbf986226e42c51787 /zephyr
parentae877144d1a7a448af3fe5b74a8bebf6abc7f9cf (diff)
downloadchrome-ec-b8cee54d69416a4035e5a34be196656bf68036c5.tar.gz
zephyr: lazor: define ADC mul and div factors
Copy the mul and div factors from board/lazor/board.c. The ADC_PSYS doesn't need the hack to handle the overflow; just set the mul factor to 124000. BUG=b:182398910 BRANCH=None TEST=Tested on Lazor: uart:~$ adc ADC_VBUS = 5060 mV ADC_AMON_BMON = 611 mV ADC_PSYS = 0 mV Change-Id: I3bd4a30eae04c584efaa2ed302b2b65e4fb4ced7 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2779749 Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'zephyr')
-rw-r--r--zephyr/projects/trogdor/boards/arm/trogdor/trogdor.dts14
1 files changed, 14 insertions, 0 deletions
diff --git a/zephyr/projects/trogdor/boards/arm/trogdor/trogdor.dts b/zephyr/projects/trogdor/boards/arm/trogdor/trogdor.dts
index 1f02a06f68..58fefcf80f 100644
--- a/zephyr/projects/trogdor/boards/arm/trogdor/trogdor.dts
+++ b/zephyr/projects/trogdor/boards/arm/trogdor/trogdor.dts
@@ -78,14 +78,28 @@
vbus {
label = "ADC_VBUS";
channel = <1>;
+ /* Measure VBUS through a 1/10 voltage divider */
+ mul = <10>;
};
amon_bmon {
label = "ADC_AMON_BMON";
channel = <2>;
+ /*
+ * Adapter current output or battery charging/
+ * discharging current (uV) 18x amplification on
+ * charger side.
+ */
+ mul = <1000>;
+ div = <18>;
};
psys {
label = "ADC_PSYS";
channel = <3>;
+ /*
+ * ISL9238 PSYS output is 1.44 uA/W over 5.6K resistor,
+ * to read 0.8V @ 99 W, i.e. 124000 uW/mV.
+ */
+ mul = <124000>;
};
};