]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
musb_hdrc: Fix TEST_PACKET again
authorTony Lindgren <tony@atomide.com>
Fri, 27 Oct 2006 19:37:31 +0000 (22:37 +0300)
committerTony Lindgren <tony@atomide.com>
Fri, 27 Oct 2006 19:37:31 +0000 (22:37 +0300)
Also allow start sending it with echo T > /proc/driver/musb_hdrc

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
drivers/usb/musb/musb_procfs.c
drivers/usb/musb/plat_uds.c

index 4303cfcf52a72fef04519979bea06d614c98d578..9b8994068bc67f80f79626d61cbf5f98e97cfbb1 100644 (file)
@@ -626,6 +626,7 @@ done:
  * E rElinquish bus (OTG)
  * H request host mode
  * h cancel host request
+ * T start sending TEST_PACKET
  * D<num> set/query the debug level
  */
 static int musb_proc_write(struct file *file, const char __user *buffer,
@@ -696,6 +697,14 @@ static int musb_proc_write(struct file *file, const char __user *buffer,
                }
                break;
 
+       case 'T':
+               if (pBase) {
+                       musb_load_testpacket(musb);
+                       musb_writeb(pBase, MGC_O_HDRC_TESTMODE,
+                                       MGC_M_TEST_PACKET);
+               }
+               break;
+
 #if (MUSB_DEBUG>0)
                /* set/read debug level */
        case 'D':{
@@ -733,6 +742,7 @@ static int musb_proc_write(struct file *file, const char __user *buffer,
                INFO("I/i: hispeed enable/disable\n");
                INFO("F: force session start\n");
                INFO("H: host mode\n");
+               INFO("T: start sending TEST_PACKET\n");
                INFO("D: set/read dbug level\n");
                break;
 #endif
index 31a513531fec732740dc1c7af67e0d8fd1e73fc4..e02f672113b1c95fc9ad5b133c7f58f946ecefb5 100644 (file)
@@ -334,10 +334,12 @@ static const u8 musb_test_packet[53] = {
 
 void musb_load_testpacket(struct musb *musb)
 {
+       void __iomem    *regs = musb->aLocalEnd[0].regs;
+
        MGC_SelectEnd(musb->pRegs, 0);
        musb_write_fifo(musb->control_ep,
                        sizeof(musb_test_packet), musb_test_packet);
-       musb_writew(musb->pRegs, MGC_O_HDRC_CSR0, MGC_M_CSR0_TXPKTRDY);
+       musb_writew(regs, MGC_O_HDRC_CSR0, MGC_M_CSR0_TXPKTRDY);
 }
 
 /*-------------------------------------------------------------------------*/