mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
Merge tag 'fixes-for-v4.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus
Felipe writes: usb: fixes for v4.13-rc4 Another fix for isochronous transfers on dwc3. This time around, we're making sure that we use correct PIDs in all transfer sizes. MSM PHY driver got a fix for the use of devm_regulator_bulk_get() API which will avoid kernel crashes. Renesas DRD driver got 3 fixes: a fix on giveback, a fix for proper controller programming and the removal of set-but-never-used variable.
This commit is contained in:
commit
2326744159
228 changed files with 1973 additions and 1526 deletions
|
|
@ -896,9 +896,40 @@ static void __dwc3_prepare_one_trb(struct dwc3_ep *dep, struct dwc3_trb *trb,
|
|||
if (!node) {
|
||||
trb->ctrl = DWC3_TRBCTL_ISOCHRONOUS_FIRST;
|
||||
|
||||
/*
|
||||
* USB Specification 2.0 Section 5.9.2 states that: "If
|
||||
* there is only a single transaction in the microframe,
|
||||
* only a DATA0 data packet PID is used. If there are
|
||||
* two transactions per microframe, DATA1 is used for
|
||||
* the first transaction data packet and DATA0 is used
|
||||
* for the second transaction data packet. If there are
|
||||
* three transactions per microframe, DATA2 is used for
|
||||
* the first transaction data packet, DATA1 is used for
|
||||
* the second, and DATA0 is used for the third."
|
||||
*
|
||||
* IOW, we should satisfy the following cases:
|
||||
*
|
||||
* 1) length <= maxpacket
|
||||
* - DATA0
|
||||
*
|
||||
* 2) maxpacket < length <= (2 * maxpacket)
|
||||
* - DATA1, DATA0
|
||||
*
|
||||
* 3) (2 * maxpacket) < length <= (3 * maxpacket)
|
||||
* - DATA2, DATA1, DATA0
|
||||
*/
|
||||
if (speed == USB_SPEED_HIGH) {
|
||||
struct usb_ep *ep = &dep->endpoint;
|
||||
trb->size |= DWC3_TRB_SIZE_PCM1(ep->mult - 1);
|
||||
unsigned int mult = ep->mult - 1;
|
||||
unsigned int maxp = usb_endpoint_maxp(ep->desc);
|
||||
|
||||
if (length <= (2 * maxp))
|
||||
mult--;
|
||||
|
||||
if (length <= maxp)
|
||||
mult--;
|
||||
|
||||
trb->size |= DWC3_TRB_SIZE_PCM1(mult);
|
||||
}
|
||||
} else {
|
||||
trb->ctrl = DWC3_TRBCTL_ISOCHRONOUS;
|
||||
|
|
|
|||
|
|
@ -838,21 +838,32 @@ static struct renesas_usb3_request *usb3_get_request(struct renesas_usb3_ep
|
|||
return usb3_req;
|
||||
}
|
||||
|
||||
static void __usb3_request_done(struct renesas_usb3_ep *usb3_ep,
|
||||
struct renesas_usb3_request *usb3_req,
|
||||
int status)
|
||||
{
|
||||
struct renesas_usb3 *usb3 = usb3_ep_to_usb3(usb3_ep);
|
||||
|
||||
dev_dbg(usb3_to_dev(usb3), "giveback: ep%2d, %u, %u, %d\n",
|
||||
usb3_ep->num, usb3_req->req.length, usb3_req->req.actual,
|
||||
status);
|
||||
usb3_req->req.status = status;
|
||||
usb3_ep->started = false;
|
||||
list_del_init(&usb3_req->queue);
|
||||
spin_unlock(&usb3->lock);
|
||||
usb_gadget_giveback_request(&usb3_ep->ep, &usb3_req->req);
|
||||
spin_lock(&usb3->lock);
|
||||
}
|
||||
|
||||
static void usb3_request_done(struct renesas_usb3_ep *usb3_ep,
|
||||
struct renesas_usb3_request *usb3_req, int status)
|
||||
{
|
||||
struct renesas_usb3 *usb3 = usb3_ep_to_usb3(usb3_ep);
|
||||
unsigned long flags;
|
||||
|
||||
dev_dbg(usb3_to_dev(usb3), "giveback: ep%2d, %u, %u, %d\n",
|
||||
usb3_ep->num, usb3_req->req.length, usb3_req->req.actual,
|
||||
status);
|
||||
usb3_req->req.status = status;
|
||||
spin_lock_irqsave(&usb3->lock, flags);
|
||||
usb3_ep->started = false;
|
||||
list_del_init(&usb3_req->queue);
|
||||
__usb3_request_done(usb3_ep, usb3_req, status);
|
||||
spin_unlock_irqrestore(&usb3->lock, flags);
|
||||
usb_gadget_giveback_request(&usb3_ep->ep, &usb3_req->req);
|
||||
}
|
||||
|
||||
static void usb3_irq_epc_pipe0_status_end(struct renesas_usb3 *usb3)
|
||||
|
|
|
|||
|
|
@ -197,6 +197,7 @@ struct msm_otg {
|
|||
struct regulator *v3p3;
|
||||
struct regulator *v1p8;
|
||||
struct regulator *vddcx;
|
||||
struct regulator_bulk_data supplies[3];
|
||||
|
||||
struct reset_control *phy_rst;
|
||||
struct reset_control *link_rst;
|
||||
|
|
@ -1731,7 +1732,6 @@ static int msm_otg_reboot_notify(struct notifier_block *this,
|
|||
|
||||
static int msm_otg_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct regulator_bulk_data regs[3];
|
||||
int ret = 0;
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
struct msm_otg_platform_data *pdata;
|
||||
|
|
@ -1817,17 +1817,18 @@ static int msm_otg_probe(struct platform_device *pdev)
|
|||
return motg->irq;
|
||||
}
|
||||
|
||||
regs[0].supply = "vddcx";
|
||||
regs[1].supply = "v3p3";
|
||||
regs[2].supply = "v1p8";
|
||||
motg->supplies[0].supply = "vddcx";
|
||||
motg->supplies[1].supply = "v3p3";
|
||||
motg->supplies[2].supply = "v1p8";
|
||||
|
||||
ret = devm_regulator_bulk_get(motg->phy.dev, ARRAY_SIZE(regs), regs);
|
||||
ret = devm_regulator_bulk_get(motg->phy.dev, ARRAY_SIZE(motg->supplies),
|
||||
motg->supplies);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
motg->vddcx = regs[0].consumer;
|
||||
motg->v3p3 = regs[1].consumer;
|
||||
motg->v1p8 = regs[2].consumer;
|
||||
motg->vddcx = motg->supplies[0].consumer;
|
||||
motg->v3p3 = motg->supplies[1].consumer;
|
||||
motg->v1p8 = motg->supplies[2].consumer;
|
||||
|
||||
clk_set_rate(motg->clk, 60000000);
|
||||
|
||||
|
|
|
|||
|
|
@ -639,14 +639,11 @@ static int usbhsg_ep_disable(struct usb_ep *ep)
|
|||
struct usbhsg_uep *uep = usbhsg_ep_to_uep(ep);
|
||||
struct usbhs_pipe *pipe;
|
||||
unsigned long flags;
|
||||
int ret = 0;
|
||||
|
||||
spin_lock_irqsave(&uep->lock, flags);
|
||||
pipe = usbhsg_uep_to_pipe(uep);
|
||||
if (!pipe) {
|
||||
ret = -EINVAL;
|
||||
if (!pipe)
|
||||
goto out;
|
||||
}
|
||||
|
||||
usbhsg_pipe_disable(uep);
|
||||
usbhs_pipe_free(pipe);
|
||||
|
|
|
|||
|
|
@ -20,9 +20,13 @@
|
|||
/* Low Power Status register (LPSTS) */
|
||||
#define LPSTS_SUSPM 0x4000
|
||||
|
||||
/* USB General control register 2 (UGCTRL2), bit[31:6] should be 0 */
|
||||
/*
|
||||
* USB General control register 2 (UGCTRL2)
|
||||
* Remarks: bit[31:11] and bit[9:6] should be 0
|
||||
*/
|
||||
#define UGCTRL2_RESERVED_3 0x00000001 /* bit[3:0] should be B'0001 */
|
||||
#define UGCTRL2_USB0SEL_OTG 0x00000030
|
||||
#define UGCTRL2_VBUSSEL 0x00000400
|
||||
|
||||
static void usbhs_write32(struct usbhs_priv *priv, u32 reg, u32 data)
|
||||
{
|
||||
|
|
@ -34,7 +38,8 @@ static int usbhs_rcar3_power_ctrl(struct platform_device *pdev,
|
|||
{
|
||||
struct usbhs_priv *priv = usbhs_pdev_to_priv(pdev);
|
||||
|
||||
usbhs_write32(priv, UGCTRL2, UGCTRL2_RESERVED_3 | UGCTRL2_USB0SEL_OTG);
|
||||
usbhs_write32(priv, UGCTRL2, UGCTRL2_RESERVED_3 | UGCTRL2_USB0SEL_OTG |
|
||||
UGCTRL2_VBUSSEL);
|
||||
|
||||
if (enable) {
|
||||
usbhs_bset(priv, LPSTS, LPSTS_SUSPM, LPSTS_SUSPM);
|
||||
|
|
|
|||
Loading…
Reference in a new issue