usb: fixes for v4.2-rc5
BCD driver now reads correct register to fetch HW dequeue pointer address. f_uac2 got a fix for bInterval calculation. Both f_hid and f_printer can now correctly limit number of instances when used through configfs. Signed-off-by: Felipe Balbi <balbi@ti.com> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJVtn8HAAoJEIaOsuA1yqREXv0QAILNvJw7uE3y2HKl2KPvBuJ9 9rzWsEqSOwegZeH+2KaWUo6GZgkuaziHNZvcsERs5zqzXO4TmWOBvpwy9oIgYilf AZI8oun5HUQ16Uk3i05uCJQYZfgzqLqbz45yvtEAU1BMuDMYbnZbjaSW7gf0jYjc D9QrTULYI44MCK91iGh9mwIF5hCRdZomXF7BFweZVh86BhWmaQbURAJR29WAbfJB yIDbVNhQiqiTBBENnQX+R4fZiiwPi3HRBNQVD/+B8QbqbYsSeNwW4djKk8IXcuM1 80hbO7lbVtYQW0wdWxK2tKYaKjdI6nHM+gpJrKxOQg5KPrIXSPP5YZJjyrLKFKwv vhIBJCnex2c6fjTKDIchSGZMr0uii/UHYYQ4ylVpzY3ArckPofsFsR6gz35WErnQ 45+Xvrqm+hXqBDg7QE+eMhsfcpQ3j+uFXcXTdiRaDiVf9IGzbYQUzquKgu8ZdW+b hDIVwUXQk7KPEhdrnTiN+CNuPkQp1Gp4xO9/EatQMkKkFJVDaRb745c7WRmtOMCC 1uiKwzNilHxiewQ/4t6dWPm1oHz/dJk6+bX/v+ezSnKOT1KR20idGikfxomKTnQb wCsWWsuI6PlMN4xJxd2th3u2SeD3G7GUPPTgDWgCdhhk1cFw7Obq6uG8X3dRzX4T OpsGZxeWhYzaj71CF8Vu =pjHS -----END PGP SIGNATURE----- Merge tag 'fixes-for-v4.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus Felipe writes: usb: fixes for v4.2-rc5 BCD driver now reads correct register to fetch HW dequeue pointer address. f_uac2 got a fix for bInterval calculation. Both f_hid and f_printer can now correctly limit number of instances when used through configfs. Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
commit
84b6b023cb
@ -699,6 +699,10 @@ static inline int hidg_get_minor(void)
|
||||
int ret;
|
||||
|
||||
ret = ida_simple_get(&hidg_ida, 0, 0, GFP_KERNEL);
|
||||
if (ret >= HIDG_MINORS) {
|
||||
ida_simple_remove(&hidg_ida, ret);
|
||||
ret = -ENODEV;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -1248,7 +1248,15 @@ static struct config_item_type printer_func_type = {
|
||||
|
||||
static inline int gprinter_get_minor(void)
|
||||
{
|
||||
return ida_simple_get(&printer_ida, 0, 0, GFP_KERNEL);
|
||||
int ret;
|
||||
|
||||
ret = ida_simple_get(&printer_ida, 0, 0, GFP_KERNEL);
|
||||
if (ret >= PRINTER_MINORS) {
|
||||
ida_simple_remove(&printer_ida, ret);
|
||||
ret = -ENODEV;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline void gprinter_put_minor(int minor)
|
||||
|
@ -1162,14 +1162,14 @@ afunc_set_alt(struct usb_function *fn, unsigned intf, unsigned alt)
|
||||
factor = 1000;
|
||||
} else {
|
||||
ep_desc = &hs_epin_desc;
|
||||
factor = 125;
|
||||
factor = 8000;
|
||||
}
|
||||
|
||||
/* pre-compute some values for iso_complete() */
|
||||
uac2->p_framesize = opts->p_ssize *
|
||||
num_channels(opts->p_chmask);
|
||||
rate = opts->p_srate * uac2->p_framesize;
|
||||
uac2->p_interval = (1 << (ep_desc->bInterval - 1)) * factor;
|
||||
uac2->p_interval = factor / (1 << (ep_desc->bInterval - 1));
|
||||
uac2->p_pktsize = min_t(unsigned int, rate / uac2->p_interval,
|
||||
prm->max_psize);
|
||||
|
||||
|
@ -779,7 +779,7 @@ static int ep_dequeue(struct bdc_ep *ep, struct bdc_req *req)
|
||||
/* The current hw dequeue pointer */
|
||||
tmp_32 = bdc_readl(bdc->regs, BDC_EPSTS0(0));
|
||||
deq_ptr_64 = tmp_32;
|
||||
tmp_32 = bdc_readl(bdc->regs, BDC_EPSTS0(1));
|
||||
tmp_32 = bdc_readl(bdc->regs, BDC_EPSTS1(0));
|
||||
deq_ptr_64 |= ((u64)tmp_32 << 32);
|
||||
|
||||
/* we have the dma addr of next bd that will be fetched by hardware */
|
||||
|
Loading…
Reference in New Issue
Block a user