Skip to content

Commit 334c6be

Browse files
jjdalynhkartben
authored andcommitted
drivers: adc: microchip: Fix PR #80933
Fixed bug calculating offset of registers after unused space in the ADC register space for the SZ package parts. Signed-off-by: Jeff Daly <jeffd@silicom-usa.com>
1 parent 6a47f72 commit 334c6be

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/adc/adc_mchp_xec.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ enum adc_pm_policy_state_flag {
4747
ADC_PM_POLICY_STATE_FLAG_COUNT,
4848
};
4949

50+
#define XEC_ADC_MAX_HW_CHAN 16
5051
#define XEC_ADC_CFG_CHANNELS DT_INST_PROP(0, channels)
5152

5253
struct adc_xec_regs {
@@ -56,7 +57,7 @@ struct adc_xec_regs {
5657
uint32_t single_reg;
5758
uint32_t repeat_reg;
5859
uint32_t channel_read_reg[XEC_ADC_CFG_CHANNELS];
59-
uint32_t unused[10 + (MCHP_ADC_MAX_CHAN - XEC_ADC_CFG_CHANNELS)];
60+
uint32_t unused[10 + (XEC_ADC_MAX_HW_CHAN - XEC_ADC_CFG_CHANNELS)];
6061
uint32_t config_reg;
6162
uint32_t vref_channel_reg;
6263
uint32_t vref_control_reg;

0 commit comments

Comments
 (0)