aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/iicbus/iichid.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/iicbus/iichid.c')
-rw-r--r--sys/dev/iicbus/iichid.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c
index 5ca3f1b84e48..430066bd8f52 100644
--- a/sys/dev/iicbus/iichid.c
+++ b/sys/dev/iicbus/iichid.c
@@ -271,6 +271,8 @@ static int
iichid_cmd_read(struct iichid_softc* sc, void *buf, iichid_size_t maxlen,
iichid_size_t *actual_len)
{
+ int error;
+
/*
* 6.1.3 - Retrieval of Input Reports
* DEVICE returns the length (2 Bytes) and the entire Input Report.
@@ -280,7 +282,10 @@ iichid_cmd_read(struct iichid_softc* sc, void *buf, iichid_size_t maxlen,
struct iic_msg msgs[] = {
{ sc->addr, IIC_M_RD, maxlen, buf },
};
- int error;
+
+ if (!sc->reset_acked) {
+ msgs[0].len = 2;
+ }
error = iicbus_transfer(sc->dev, msgs, nitems(msgs));
if (error != 0)