Skip to content

Commit

Permalink
hw/adc: Fix CONV bit in NPCM7XX ADC CON register
Browse files Browse the repository at this point in the history
The correct bit for the CONV bit in NPCM7XX ADC is bit 13. This patch
fixes that in the module, and also lower the IRQ when the guest
is done handling an interrupt event from the ADC module.

Signed-off-by: Hao Wu <wuhaotsh@google.com>
Reviewed-by: Patrick Venture<venture@google.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20220714182836.89602-4-wuhaotsh@google.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
haowu4682 authored and pm215 committed Jul 18, 2022
1 parent f04383e commit 4a84e85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hw/adc/npcm7xx_adc.c
Expand Up @@ -36,7 +36,7 @@ REG32(NPCM7XX_ADC_DATA, 0x4)
#define NPCM7XX_ADC_CON_INT BIT(18)
#define NPCM7XX_ADC_CON_EN BIT(17)
#define NPCM7XX_ADC_CON_RST BIT(16)
#define NPCM7XX_ADC_CON_CONV BIT(14)
#define NPCM7XX_ADC_CON_CONV BIT(13)
#define NPCM7XX_ADC_CON_DIV(rv) extract32(rv, 1, 8)

#define NPCM7XX_ADC_MAX_RESULT 1023
Expand Down
2 changes: 1 addition & 1 deletion tests/qtest/npcm7xx_adc-test.c
Expand Up @@ -50,7 +50,7 @@
#define CON_INT BIT(18)
#define CON_EN BIT(17)
#define CON_RST BIT(16)
#define CON_CONV BIT(14)
#define CON_CONV BIT(13)
#define CON_DIV(rv) extract32(rv, 1, 8)

#define FST_RDST BIT(1)
Expand Down

0 comments on commit 4a84e85

Please sign in to comment.