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:
parent
72ee4f75ef
commit
d2892c1123
3 changed files with 26 additions and 2 deletions
|
@ -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, \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue