usb: renesas_usbhs: add support for USB-DMAC
Some Renesas SoCs have the USB-DMAC. It is able to terminate transfers when a short packet is received, even if less bytes than the transfer counter size have been received. Also, it is able to send a short packet even if the packet size is not multiples of 8bytes. Since the previous code has used the interruption of USBHS controller when receiving packets even if this driver has used a dmac, a lot of interruptions has happened. This patch will reduce such interruptions. This patch allows to use the USB-DMAC on R-Car H2 and M2. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:

committed by
Felipe Balbi

parent
9b53d9af7a
commit
ab330cf388
@@ -275,6 +275,16 @@ int usbhs_set_device_config(struct usbhs_priv *priv, int devnum,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* interrupt functions
|
||||
*/
|
||||
void usbhs_xxxsts_clear(struct usbhs_priv *priv, u16 sts_reg, u16 bit)
|
||||
{
|
||||
u16 pipe_mask = (u16)GENMASK(usbhs_get_dparam(priv, pipe_size), 0);
|
||||
|
||||
usbhs_write(priv, sts_reg, ~(1 << bit) & pipe_mask);
|
||||
}
|
||||
|
||||
/*
|
||||
* local functions
|
||||
*/
|
||||
@@ -487,6 +497,15 @@ static struct renesas_usbhs_platform_info *usbhs_parse_dt(struct device *dev)
|
||||
if (gpio > 0)
|
||||
dparam->enable_gpio = gpio;
|
||||
|
||||
switch (dparam->type) {
|
||||
case USBHS_TYPE_R8A7790:
|
||||
case USBHS_TYPE_R8A7791:
|
||||
dparam->has_usb_dmac = 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user