| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of the shim code is in zephyr/ rather than in the ECOS code. Move
the ADC one as well, to keep it consistent.
BUG=b:175881324
BRANCH=none
TEST=build Zephyr with lazor and some other CLs and see that the ADC
enum is now available and there are not build errors
Change-Id: Ib1b31c1b885e3ca5b184f4f708776357ac87cbbf
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2801171
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2810052
Tested-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
Commit-Queue: Eric Yilun Lin <yllin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some boards need to adjust ADC measurements with multiplication and
division factors so add support for these also in Zephyr.
BUG=b:175881324
BRANCH=none
TEST=Add mul and div factors in the dts file and verify measurements
with the "adc" console command
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: I6b716e20af18623249a4a972b6f3db8eec09a376
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2775487
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Commit-Queue: Wai-Hong Tam <waihong@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add ADC shim to connect the platform/ec ADC API to the Zephyr ADC API.
Generate needed global variables/types: enum adc_channel and
adc_channels from dts.
Once ADC_CMD config is enabled, it replaces the "adc" Zephyr console
function.
The shim assues only ADC_0 module.
More specific channel options can be added to named-adc.yaml e.g.
shift or gain.
BUG=b:175881324
BRANCH=none
TEST=build Zephyr
TEST=Run "adc" command, it should return current levels in mv of
configured channels
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: Ic9c03223e611f916bebc1296cbee614401098994
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2673418
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While we wait for an ADC shim, define this enum so that the code at
least compiles.
BUG=b:175881324
BRANCH=none
TEST=build zephyr for volteer
Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: I688e313afd78a0953c3e03da6a8039ae3112afdd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2595219
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ran the following command:
git grep -l 'Copyright (c)' | \
xargs sed -i 's/Copyright (c)/Copyright/g'
BRANCH=none
BUG=none
TEST=make buildall -j
Change-Id: I6cc4a0f7e8b30d5b5f97d53c031c299f3e164ca7
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1663262
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently HOOK_PRIO_INIT_ADC is defined as a macro in adc.h. This patch
moves the definition to enum hook_priority for better visibility and
consistency.
There will be no functional change.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=none
BRANCH=none
TEST=buildall
Change-Id: I1be65d034993652740d78adc901521621d23b118
Reviewed-on: https://chromium-review.googlesource.com/1520949
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The console adc command prints adc values in the
order they appear in hardware, however they are lableled
in the order they are enumerated in board.h, which is not
necessarily the same.
This prints the correct name and value pairs, and removes
the adc_read_all_channels function which is not otherwise
used.
BUG=chromium:571476
BRANCH=None
TEST="adc" command associates correct values with names now.
Change-Id: I688641953d20082224b4120eaefe0d634ad4c74c
Signed-off-by: Nick Sanders <nsanders@google.com>
Reviewed-on: https://chromium-review.googlesource.com/340892
Commit-Ready: Nick Sanders <nsanders@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for continuously writing ADC samples to a circular buffer.
CONFIG_ADC_PROFILE_FAST_CONTINUOUS should be defined and an
appropriate sized buffer must be passed to adc_read_all_channels().
BUG=chromium:569994
TEST=Manual on snoball. Verify 'adc' continues to function (single
mode). With pending commit, verify that continuous conversion interrupt
is called at appropriate frequency and values look consistent.
BRANCH=None
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I025825d72a698f8f1f4f95a89477df791bd5e67e
Reviewed-on: https://chromium-review.googlesource.com/318505
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added common priority for the ADC init to ensure board level
priority is defined for the ADC pre init.
BUG=none
TEST=make buildall -j
BRANCH=none
Change-Id: Id1649df6a68ab53bd110e58a0722bd4c70cbffc5
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/286040
Reviewed-by: Shawn N <shawnn@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace the stubs by an actual implementation for ADC and Analog
watchdog support on STM32F0xx chips.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=none
BUG=none
TEST=manually read ADC values on STM32F072B discovery.
TEST=read all ADC values at once.
TEST=Enable watchdog and check it fires when the voltage goes out of
range.
TEST=read ADC value(s) while watchdog is enabled.
TEST=Disable watchdog and check it's actually disabled.
Change-Id: Ie6fbd1aa95a3d76394fa47803e8cfc24bf5e4562
Reviewed-on: https://chromium-review.googlesource.com/190710
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
No code changes, other than renaming a couple of static functions.
BUG=none
BRANCH=none
TEST=build falco
Change-Id: I29b835d273aa1aba66d9d40536eae2eb12207f66
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174530
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
LM4 doesn't have implementation of adc_read_all_channels(). Let's use
adc_read_channel() in this case.
BUG=chrome-os-partner:18598
TEST=Build stress test for link. See no error about
adc_read_all_channels() undefined.
BRANCH=None
Change-Id: I5b13384468667cbd17b83faab9f9d3fdc48de91d
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49589
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes it possible to have ADC module monitor an input voltage and
trigger interrupt when it goes out of accepted range.
BUG=chrome-os-partner:18171
TEST=Manual
BRANCH=spring
Change-Id: Ia0c981fadd9bcaa40afe30ca2624c2f3644b95fe
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45277
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ADC config structs are now chip-specific; this saves code size
(several hundred bytes on LM4, since no need for 24-entry ADC channel
to GPIO mapping table).
BUG=chrome-os-partner:15579
BRANCH=none
TEST='adc' with system on and off; ChargerCurrent should be bigger when on.
Change-Id: Ia88b3f043438bec049f2d2ad39fc42dcf86d9424
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36798
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds basic ADC support for multiple channel conversion.
BUG=chrome-os-partner:14316
BRANCH=none
TEST=1. Boot on snow.
2. Use keyboard signal as input. Check read value changes as input
signal changes.
Change-Id: I3c15c37446fa9273d098f6d581573c11ced45b5e
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33883
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This covers modules which need to initialize before task_start(), but
don't particularly care in what order they're initialized.
Signed-off-by: Randall Spangler <rspangler@chromium.org>
BUG=none
TEST=if it boots, it works
Change-Id: I69829aac8d1c3c14ee04916a794b84bbf03a09eb
|
|
|
|
|
|
|
|
|
|
|
| |
Board-specific features like lightbar should be config'd at the board
level, not at the chip level.
BUG=none
TEST=build link, bds, daisy
Change-Id: If1df2ca0422f7b8bdc172d0df7bd9f6a1af6a9d2
Signed-off-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a trivial patch to fix compilation for boards that are not
based on LM4 (e.g. Discovery).
Signed-off-by: David Hendricks <dhendrix@chromium.org>
TEST=Compiled for Discovery
BUG=None
Change-Id: Ia1f29c61ff4a1f65fe65c43a8e58def7d1217ab2
|
|
|
|
|
|
|
|
|
|
| |
The ADC input pin was always configured as BDS. Modified it to configure
the correct pin.
BUG=none
TEST=On Link, "rw 0x4002451C" show 0xff instead of 0xf7.
Change-Id: I1efd5cd59ad65f55cd673529afa6153add63ecac
|
|
|
|
|
|
|
|
|
|
|
| |
Refactor ADC code and move board/chip-specific part to corresponding
directories.
Implement function and console command to read Link charger current.
BUG=chrome-os-partner:7527
TEST=Read EC temperature and POT input on BDS.
Change-Id: I7fafd310ea49d9b2781f10c3453f5488da29a08a
|
|
source files mainly done by Randall.
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Change-Id: Iaff83a842b17f3350fb6f2a3f1597ad4c29bd12a
|