Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248858
b: refs/heads/master
c: af5c580
h: refs/heads/master
v: v3
  • Loading branch information
Greg Kroah-Hartman committed May 12, 2011
1 parent 2808115 commit 3f78982
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3abeca998a44205cfd837fa0bf1f7c24f8294acb
refs/heads/master: af5c5805013d3c97d7f0bc27a56c49baa34b1f8a
13 changes: 11 additions & 2 deletions trunk/drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ static int acm_probe(struct usb_interface *intf,
u8 ac_management_function = 0;
u8 call_management_function = 0;
int call_interface_num = -1;
int data_interface_num;
int data_interface_num = -1;
unsigned long quirks;
int num_rx_buf;
int i;
Expand Down Expand Up @@ -937,7 +937,11 @@ static int acm_probe(struct usb_interface *intf,
if (!union_header) {
if (call_interface_num > 0) {
dev_dbg(&intf->dev, "No union descriptor, using call management descriptor\n");
data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = call_interface_num));
/* quirks for Droids MuIn LCD */
if (quirks & NO_DATA_INTERFACE)
data_interface = usb_ifnum_to_if(usb_dev, 0);
else
data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = call_interface_num));
control_interface = intf;
} else {
if (intf->cur_altsetting->desc.bNumEndpoints != 3) {
Expand Down Expand Up @@ -1535,6 +1539,11 @@ static const struct usb_device_id acm_ids[] = {
.driver_info = NOT_A_MODEM,
},

/* Support for Droids MuIn LCD */
{ USB_DEVICE(0x04d8, 0x000b),
.driver_info = NO_DATA_INTERFACE,
},

/* control interfaces without any protocol set */
{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
USB_CDC_PROTO_NONE) },
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/usb/class/cdc-acm.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,4 @@ struct acm {
#define SINGLE_RX_URB 2
#define NO_CAP_LINE 4
#define NOT_A_MODEM 8
#define NO_DATA_INTERFACE 16
12 changes: 6 additions & 6 deletions trunk/drivers/usb/renesas_usbhs/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,11 @@ static int __devinit usbhs_probe(struct platform_device *pdev)
/* call pipe and module init */
ret = usbhs_pipe_probe(priv);
if (ret < 0)
goto probe_end_mod_exit;
goto probe_end_iounmap;

ret = usbhs_mod_probe(priv);
if (ret < 0)
goto probe_end_iounmap;
goto probe_end_pipe_exit;

/* dev_set_drvdata should be called after usbhs_mod_init */
dev_set_drvdata(&pdev->dev, priv);
Expand All @@ -346,7 +346,7 @@ static int __devinit usbhs_probe(struct platform_device *pdev)
ret = usbhs_platform_call(priv, hardware_init, pdev);
if (ret < 0) {
dev_err(&pdev->dev, "platform prove failed.\n");
goto probe_end_pipe_exit;
goto probe_end_mod_exit;
}

/* reset phy for connection */
Expand All @@ -372,10 +372,10 @@ static int __devinit usbhs_probe(struct platform_device *pdev)

probe_end_call_remove:
usbhs_platform_call(priv, hardware_exit, pdev);
probe_end_pipe_exit:
usbhs_pipe_remove(priv);
probe_end_mod_exit:
usbhs_mod_remove(priv);
probe_end_pipe_exit:
usbhs_pipe_remove(priv);
probe_end_iounmap:
iounmap(priv->base);
probe_end_kfree:
Expand Down Expand Up @@ -403,8 +403,8 @@ static int __devexit usbhs_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);

usbhs_platform_call(priv, hardware_exit, pdev);
usbhs_pipe_remove(priv);
usbhs_mod_remove(priv);
usbhs_pipe_remove(priv);
iounmap(priv->base);
kfree(priv);

Expand Down
29 changes: 13 additions & 16 deletions trunk/drivers/usb/renesas_usbhs/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ static void usbhsp_pipe_select(struct usbhs_pipe *pipe)
static int usbhsp_pipe_barrier(struct usbhs_pipe *pipe)
{
struct usbhs_priv *priv = usbhsp_pipe_to_priv(pipe);
struct device *dev = usbhs_priv_to_dev(priv);
int timeout = 1024;
u16 val;

Expand All @@ -206,6 +205,7 @@ static int usbhsp_pipe_barrier(struct usbhs_pipe *pipe)
* - "Pipe Control Registers Switching Procedure"
*/
usbhs_write(priv, CFIFOSEL, 0);
usbhs_fifo_disable(pipe);

do {
val = usbhsp_pipectrl_get(pipe);
Expand All @@ -217,21 +217,6 @@ static int usbhsp_pipe_barrier(struct usbhs_pipe *pipe)

} while (timeout--);

/*
* force NAK
*/
timeout = 1024;
usbhs_fifo_disable(pipe);
do {
val = usbhsp_pipectrl_get(pipe);
val &= PBUSY;
if (!val)
return 0;

} while (timeout--);

dev_err(dev, "pipe barrier failed\n");

return -EBUSY;
}

Expand Down Expand Up @@ -270,10 +255,22 @@ static void __usbhsp_pid_try_nak_if_stall(struct usbhs_pipe *pipe)

void usbhs_fifo_disable(struct usbhs_pipe *pipe)
{
int timeout = 1024;
u16 val;

/* see "Pipe n Control Register" - "PID" */
__usbhsp_pid_try_nak_if_stall(pipe);

usbhsp_pipectrl_set(pipe, PID_MASK, PID_NAK);

do {
val = usbhsp_pipectrl_get(pipe);
val &= PBUSY;
if (!val)
break;

udelay(10);
} while (timeout--);
}

void usbhs_fifo_enable(struct usbhs_pipe *pipe)
Expand Down

0 comments on commit 3f78982

Please sign in to comment.