[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 25/34] hw/arm/spitz: Use max111x properties to set initial values
From: |
Peter Maydell |
Subject: |
[PULL 25/34] hw/arm/spitz: Use max111x properties to set initial values |
Date: |
Fri, 3 Jul 2020 17:53:56 +0100 |
Use the new max111x qdev properties to set the initial input
values rather than calling max111x_set_input(); this means that
on system reset the inputs will correctly return to their initial
values.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20200628142429.17111-10-peter.maydell@linaro.org
---
hw/arm/spitz.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
index 11e413723f4..93a25edcb5b 100644
--- a/hw/arm/spitz.c
+++ b/hw/arm/spitz.c
@@ -731,11 +731,14 @@ static void spitz_ssp_attach(SpitzMachineState *sms)
qdev_get_gpio_in(sms->mpu->gpio, SPITZ_GPIO_TP_INT));
bus = qdev_get_child_bus(sms->mux, "ssi2");
- sms->max1111 = ssi_create_slave(bus, "max1111");
+ sms->max1111 = qdev_new("max1111");
max1111 = sms->max1111;
- max111x_set_input(sms->max1111, MAX1111_BATT_VOLT, SPITZ_BATTERY_VOLT);
- max111x_set_input(sms->max1111, MAX1111_BATT_TEMP, 0);
- max111x_set_input(sms->max1111, MAX1111_ACIN_VOLT, SPITZ_CHARGEON_ACIN);
+ qdev_prop_set_uint8(sms->max1111, "input1" /* BATT_VOLT */,
+ SPITZ_BATTERY_VOLT);
+ qdev_prop_set_uint8(sms->max1111, "input2" /* BATT_TEMP */, 0);
+ qdev_prop_set_uint8(sms->max1111, "input3" /* ACIN_VOLT */,
+ SPITZ_CHARGEON_ACIN);
+ ssi_realize_and_unref(sms->max1111, bus, &error_fatal);
qdev_connect_gpio_out(sms->mpu->gpio, SPITZ_GPIO_LCDCON_CS,
qdev_get_gpio_in(sms->mux, 0));
--
2.20.1
- [PULL 16/34] hw/display/bcm2835_fb.c: Initialize all fields of struct, (continued)
- [PULL 16/34] hw/display/bcm2835_fb.c: Initialize all fields of struct, Peter Maydell, 2020/07/03
- [PULL 17/34] hw/arm/spitz: Detabify, Peter Maydell, 2020/07/03
- [PULL 19/34] hw/arm/spitz: Keep pointers to MPU and SSI devices in SpitzMachineState, Peter Maydell, 2020/07/03
- [PULL 18/34] hw/arm/spitz: Create SpitzMachineClass abstract base class, Peter Maydell, 2020/07/03
- [PULL 20/34] hw/arm/spitz: Keep pointers to scp0, scp1 in SpitzMachineState, Peter Maydell, 2020/07/03
- [PULL 21/34] hw/arm/spitz: Implement inbound GPIO lines for bit5 and power signals, Peter Maydell, 2020/07/03
- [PULL 22/34] hw/misc/max111x: provide QOM properties for setting initial values, Peter Maydell, 2020/07/03
- [PULL 23/34] hw/misc/max111x: Don't use vmstate_register(), Peter Maydell, 2020/07/03
- [PULL 24/34] ssi: Add ssi_realize_and_unref(), Peter Maydell, 2020/07/03
- [PULL 26/34] hw/misc/max111x: Use GPIO lines rather than max111x_set_input(), Peter Maydell, 2020/07/03
- [PULL 25/34] hw/arm/spitz: Use max111x properties to set initial values,
Peter Maydell <=
- [PULL 27/34] hw/misc/max111x: Create header file for documentation, TYPE_ macros, Peter Maydell, 2020/07/03
- [PULL 28/34] hw/arm/spitz: Encapsulate misc GPIO handling in a device, Peter Maydell, 2020/07/03
- [PULL 29/34] hw/gpio/zaurus.c: Use LOG_GUEST_ERROR for bad guest register accesses, Peter Maydell, 2020/07/03
- [PULL 30/34] hw/arm/spitz: Use LOG_GUEST_ERROR for bad guest register accesses, Peter Maydell, 2020/07/03
- [PULL 32/34] hw/arm/spitz: Provide usual QOM macros for corgi-ssp and spitz-lcdtg, Peter Maydell, 2020/07/03
- [PULL 33/34] Replace uses of FROM_SSI_SLAVE() macro with QOM casts, Peter Maydell, 2020/07/03
- [PULL 34/34] Deprecate TileGX port, Peter Maydell, 2020/07/03
- [PULL 31/34] hw/arm/pxa2xx_pic: Use LOG_GUEST_ERROR for bad guest register accesses, Peter Maydell, 2020/07/03
- Re: [PULL 00/34] target-arm queue, no-reply, 2020/07/03
- Re: [PULL 00/34] target-arm queue, Peter Maydell, 2020/07/04