driver: sensor: npcx: add 'thr-sel' prop. for adc comparator

Add `thr-sel` prop. to select the relevant threshold register for adc
comparator since there're two adc modules in npcx4 series.

Signed-off-by: Kate Yen <htyen@nuvoton.com>
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
This commit is contained in:
Mulin Chao 2023-08-28 23:53:25 -07:00 committed by Carles Cufí
commit d2892c1123
3 changed files with 26 additions and 2 deletions

View file

@ -256,7 +256,7 @@ static const struct sensor_driver_api adc_cmp_npcx_api = {
static const struct adc_cmp_npcx_config adc_cmp_npcx_config_##inst = {\
.adc = DEVICE_DT_GET(DT_INST_IO_CHANNELS_CTLR(inst)), \
.chnsel = DT_INST_IO_CHANNELS_INPUT(inst), \
.th_sel = inst, \
.th_sel = DT_INST_STRING_TOKEN_OR(inst, thr_sel, inst), \
.thr_mv = DT_INST_PROP_OR(inst, threshold_mv, \
ADC_CMP_NPCX_UNDEFINED), \
.comparison = DT_INST_STRING_TOKEN_OR(inst, \