FreeBSD Bugzilla – Attachment 216223 Details for
Bug 247576
[regression] v356609 breaks i2c on Allwinner H5
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix twsi bug
twsi.diff (text/plain), 1.49 KB, created by
Emmanuel Vadot
on 2020-07-05 17:12:43 UTC
(
hide
)
Description:
Fix twsi bug
Filename:
MIME Type:
Creator:
Emmanuel Vadot
Created:
2020-07-05 17:12:43 UTC
Size:
1.49 KB
patch
obsolete
>diff --git a/sys/dev/iicbus/twsi/twsi.c b/sys/dev/iicbus/twsi/twsi.c >index 8124b9a1367a..998b6654f9b8 100644 >--- a/sys/dev/iicbus/twsi/twsi.c >+++ b/sys/dev/iicbus/twsi/twsi.c >@@ -535,13 +535,13 @@ twsi_intr(void *arg) > debugf(sc->dev, "Got interrupt Current msg=%x\n", sc->msg_idx); > > status = TWSI_READ(sc, sc->reg_status); >- debugf(sc->dev, "initial status=%x\n", status); >+ debugf(sc->dev, "reg control=%x\n", TWSI_READ(sc, sc->reg_control)); > > switch (status) { > case TWSI_STATUS_START: > case TWSI_STATUS_RPTD_START: > /* Transmit the address */ >- debugf(sc->dev, "Send the address\n"); >+ debugf(sc->dev, "Send the address (%x)", sc->msgs[sc->msg_idx].slave); > > if (sc->msgs[sc->msg_idx].flags & IIC_M_RD) > TWSI_WRITE(sc, sc->reg_data, >@@ -631,9 +631,10 @@ twsi_intr(void *arg) > TWSI_WRITE(sc, sc->reg_control, > sc->control_val | TWSI_CONTROL_STOP); > } else { >- debugf(sc->dev, "No ack when receiving data\n"); >- sc->error = ENXIO; >- sc->control_val = 0; >+ debugf(sc->dev, "No ack when receiving data, sending stop anyway\n"); >+ if (!(sc->msgs[sc->msg_idx].flags & IIC_M_NOSTOP)) >+ TWSI_WRITE(sc, sc->reg_control, >+ sc->control_val | TWSI_CONTROL_STOP); > } > sc->transfer = 0; > transfer_done = 1; >@@ -647,6 +648,9 @@ twsi_intr(void *arg) > wakeup(sc); > break; > } >+ debugf(sc->dev, "Refresh reg_control\n"); >+ TWSI_WRITE(sc, sc->reg_control, >+ sc->control_val | TWSI_CONTROL_IFLG); > > debugf(sc->dev, "Done with interrupts\n\n"); > if (transfer_done == 1) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 247576
: 216223 |
216261