From: Kirill A. Korinsky Subject: Re: sys/ihidev: respect RESET_RESPONSE and adjsut POWER ON timeout To: Marcus Glocker Cc: tech@openbsd.org, Mark Kettenis , mvs@openbsd.org Date: Sat, 04 Jan 2025 18:04:00 +0100 On Sat, 04 Jan 2025 17:33:42 +0100, Marcus Glocker wrote: > > > + for (i = 0; i < 50; i++) { > > + ihidev_sleep(sc, 100); > > + res = iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr, > > + NULL, 0, buf, sizeof(buf), 0); > > You could have fixed this line break if you anyway had to create a new > patch ;-) > I really thought I had fixed it by moving sc->sc_addr into the next line before NULL. But my diff juggling sems to framed me :) > > + DPRINTF(("%s: read attempt %d: 0x%x, 0x%x, res: %d\n", > > + sc->sc_dev.dv_xname, i, buf[0], buf[1], res)); > > + if (!res) > > + res = (buf[0] != 0x00 || buf[1] != 0x00); > > + if (!res) > > + break; > > + } > > + > > + break; > > + } > > default: > > printf("%s: unknown command %d\n", sc->sc_dev.dv_xname, > > hidcmd); > > @@ -557,7 +584,11 @@ ihidev_reset(struct ihidev_softc *sc) > > Have you intentionally removed the DPRINTF "resetting" from your last > patch? I think it would be better placed in the reset function itself, > as in your last patch. > Yep, to keep this changes as small as possible which just adds support of RESET RESPONSE and nothing else. -- wbr, Kirill