mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-29 05:13:54 -06:00
allwinner-i2c, adm1272: Use device_cold_reset() for software-triggered reset
Rather than directly calling the device's implementation of its 'hold' reset phase, call device_cold_reset(). This means we don't have to adjust this callsite when we add another argument to the function signature for the hold and exit reset methods. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Luc Michel <luc.michel@amd.com> Message-id: 20240412160809.1260625-3-peter.maydell@linaro.org
This commit is contained in:
parent
1e0f2b38ac
commit
ef6ab2922f
2 changed files with 2 additions and 3 deletions
|
@ -385,8 +385,7 @@ static void allwinner_i2c_write(void *opaque, hwaddr offset,
|
||||||
break;
|
break;
|
||||||
case TWI_SRST_REG:
|
case TWI_SRST_REG:
|
||||||
if (((value & TWI_SRST_MASK) == 0) && (s->srst & TWI_SRST_MASK)) {
|
if (((value & TWI_SRST_MASK) == 0) && (s->srst & TWI_SRST_MASK)) {
|
||||||
/* Perform reset */
|
device_cold_reset(DEVICE(s));
|
||||||
allwinner_i2c_reset_hold(OBJECT(s));
|
|
||||||
}
|
}
|
||||||
s->srst = value & TWI_SRST_MASK;
|
s->srst = value & TWI_SRST_MASK;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -386,7 +386,7 @@ static int adm1272_write_data(PMBusDevice *pmdev, const uint8_t *buf,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ADM1272_MFR_POWER_CYCLE:
|
case ADM1272_MFR_POWER_CYCLE:
|
||||||
adm1272_exit_reset((Object *)s);
|
device_cold_reset(DEVICE(s));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ADM1272_HYSTERESIS_LOW:
|
case ADM1272_HYSTERESIS_LOW:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue