Skip to content

Commit

Permalink
hw/arm/stellaris: Convert ADC controller to Resettable interface
Browse files Browse the repository at this point in the history
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20240213155214.13619-2-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
philmd authored and pm215 committed Feb 15, 2024
1 parent 15f6c16 commit bebd89e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hw/arm/stellaris.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,9 @@ static void stellaris_adc_trigger(void *opaque, int irq, int level)
}
}

static void stellaris_adc_reset(StellarisADCState *s)
static void stellaris_adc_reset_hold(Object *obj)
{
StellarisADCState *s = STELLARIS_ADC(obj);
int n;

for (n = 0; n < 4; n++) {
Expand Down Expand Up @@ -946,7 +947,6 @@ static void stellaris_adc_init(Object *obj)
memory_region_init_io(&s->iomem, obj, &stellaris_adc_ops, s,
"adc", 0x1000);
sysbus_init_mmio(sbd, &s->iomem);
stellaris_adc_reset(s);
qdev_init_gpio_in(dev, stellaris_adc_trigger, 1);
}

Expand Down Expand Up @@ -1411,7 +1411,9 @@ static const TypeInfo stellaris_i2c_info = {
static void stellaris_adc_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
ResettableClass *rc = RESETTABLE_CLASS(klass);

rc->phases.hold = stellaris_adc_reset_hold;
dc->vmsd = &vmstate_stellaris_adc;
}

Expand Down

0 comments on commit bebd89e

Please sign in to comment.