nusb/kb: work arround broken split transaction on raspi's dwc otg usb controller
This commit is contained in:
parent
83e20b4df1
commit
5bb7240ee9
2 changed files with 12 additions and 4 deletions
|
@ -15,6 +15,7 @@ enum {
|
||||||
Getreport = 0x01,
|
Getreport = 0x01,
|
||||||
Setreport = 0x09,
|
Setreport = 0x09,
|
||||||
Getproto = 0x03,
|
Getproto = 0x03,
|
||||||
|
Setidle = 0x0a,
|
||||||
Setproto = 0x0b,
|
Setproto = 0x0b,
|
||||||
|
|
||||||
/* protocols for SET_PROTO request */
|
/* protocols for SET_PROTO request */
|
||||||
|
|
|
@ -299,12 +299,19 @@ repparse(uchar *d, uchar *e,
|
||||||
static int
|
static int
|
||||||
setproto(Hiddev *f, int eid)
|
setproto(Hiddev *f, int eid)
|
||||||
{
|
{
|
||||||
int id, proto;
|
int proto;
|
||||||
Iface *iface;
|
Iface *iface;
|
||||||
|
|
||||||
iface = f->dev->usb->ep[eid]->iface;
|
iface = f->dev->usb->ep[eid]->iface;
|
||||||
id = iface->id;
|
|
||||||
f->nrep = usbcmd(f->dev, Rd2h|Rstd|Riface, Rgetdesc, Dreport<<8, id,
|
/*
|
||||||
|
* DWC OTG controller misses some split transaction inputs.
|
||||||
|
* Set nonzero idle time to return more frequent reports
|
||||||
|
* of keyboard state, to avoid losing key up/down events.
|
||||||
|
*/
|
||||||
|
usbcmd(f->dev, Rh2d|Rclass|Riface, Setidle, 8<<8, iface->id, nil, 0);
|
||||||
|
|
||||||
|
f->nrep = usbcmd(f->dev, Rd2h|Rstd|Riface, Rgetdesc, Dreport<<8, iface->id,
|
||||||
f->rep, sizeof(f->rep));
|
f->rep, sizeof(f->rep));
|
||||||
if(f->nrep > 0){
|
if(f->nrep > 0){
|
||||||
if(debug){
|
if(debug){
|
||||||
|
@ -335,7 +342,7 @@ setproto(Hiddev *f, int eid)
|
||||||
}
|
}
|
||||||
proto = Bootproto;
|
proto = Bootproto;
|
||||||
}
|
}
|
||||||
return usbcmd(f->dev, Rh2d|Rclass|Riface, Setproto, proto, id, nil, 0);
|
return usbcmd(f->dev, Rh2d|Rclass|Riface, Setproto, proto, iface->id, nil, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue