Skip to content

Commit f9acd8a

Browse files
Andrew McRaeChromeos LUCI
authored andcommitted
Revert "nissa: Workaround for ADC initial read error"
This reverts commit 5e4df0a. Reason for revert: Root cause of ADC issue fixed. Original change's description: > nissa: Workaround for ADC initial read error > > It appears the ADC comparator initialisation breaks > other ADCs that have not been read, so workaround > the issue by initially reading all ADCs so that they are correctly > initialised. > > Also add a check so that zero reads are detected and returned as an > error. > > BUG=b:224900226 > TEST=zmake build nivviks; flash and run and check ADCs work. > BRANCH=none > > Signed-off-by: Andrew McRae <[email protected]> > Change-Id: Ifcbebf2ca9b9a336f10fe3659fd3452223474ed3 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3528015 > Reviewed-by: Peter Marheine <[email protected]> > Commit-Queue: Peter Marheine <[email protected]> Bug: b:224900226 Change-Id: I97e3b71270767571eebbbe850ba18d5a3cc2869a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3541803 Auto-Submit: Andrew McRae <[email protected]> Reviewed-by: Peter Marheine <[email protected]> Tested-by: Andrew McRae <[email protected]> Commit-Queue: Andrew McRae <[email protected]>
1 parent d810425 commit f9acd8a

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

zephyr/projects/nissa/src/nivviks/board_config.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <kernel.h>
1111
#include <sys/printk.h>
1212

13-
#include "adc.h"
1413
#include "driver/charger/isl923x_public.h"
1514
#include "driver/retimer/anx7483_public.h"
1615
#include "gpio/gpio_int.h"
@@ -79,14 +78,6 @@ static void nivviks_subboard_init(void)
7978
gpio_pin_configure_dt(GPIO_DT_FROM_ALIAS(gpio_hpd_odl),
8079
GPIO_INPUT);
8180
}
82-
/*
83-
* Workaround for b/224900226.
84-
* Read all ADCs so that they are initialised.
85-
* TODO(b/224900226): Remove when fixed.
86-
*/
87-
for (enum adc_channel adc = 0; adc < ADC_CH_COUNT; adc++) {
88-
adc_read_channel(adc);
89-
}
9081
}
9182
DECLARE_HOOK(HOOK_INIT, nivviks_subboard_init, HOOK_PRIO_FIRST+1);
9283

zephyr/shim/src/adc.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,5 @@ int adc_read_channel(enum adc_channel ch)
8282
ADC_GAIN_1, CONFIG_PLATFORM_EC_ADC_RESOLUTION,
8383
&ret);
8484
ret = (ret * adc_channels[ch].factor_mul) / adc_channels[ch].factor_div;
85-
#ifdef CONFIG_BOARD_NIVVIKS
86-
/*
87-
* TODO(b/224900226): Remove when fixed.
88-
* Temporary workaround for b/224900226, where
89-
* the temperature ADCs sometimes read zero.
90-
*/
91-
if (ret == 0) {
92-
LOG_ERR("Zero read on sensor %d, ignored", ch);
93-
return -1;
94-
}
95-
#endif
9685
return ret;
9786
}

0 commit comments

Comments
 (0)