mirror of
https://github.com/opnsense/src.git
synced 2026-06-13 10:40:19 -04:00
iichid(4): Do not power down opened device in attach handler
Some iichid(4) child devices, currently hkbd(4) only, opens parent
device in their attach handlers. That breaks internal iichid(4) state
leading to rejecting any incoming data on software and hardware levels.
Fix it with adding of extra state check in iichid(4) attach handler.
Reported by: many
Submitted by: trasz (initial version)
PR: 280290
MFC after: 3 days
(cherry picked from commit 018cb11cb7)
This commit is contained in:
parent
19cefbb3dd
commit
c53ec86f0e
1 changed files with 6 additions and 2 deletions
|
|
@ -1205,8 +1205,12 @@ iichid_attach(device_t dev)
|
|||
iichid_detach(dev);
|
||||
}
|
||||
done:
|
||||
(void)iichid_set_power(sc, I2C_HID_POWER_OFF);
|
||||
sc->power_on = false;
|
||||
iicbus_request_bus(device_get_parent(dev), dev, IIC_WAIT);
|
||||
if (!sc->open) {
|
||||
(void)iichid_set_power(sc, I2C_HID_POWER_OFF);
|
||||
sc->power_on = false;
|
||||
}
|
||||
iicbus_release_bus(device_get_parent(dev), dev);
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue