Skip to contentSkip to conversation

usb: musb: set target address for non-multipoint devices

PATCH New Mike Frysinger 3 participants 6 messages Aug 9, 2010 – Aug 12, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: musb: set target address for non-multipoint devices

From: Bryan Wu <[email protected]>

---
 drivers/usb/musb/musb_hcd.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/usb/musb/musb_hcd.c +7 -0
index dd2aa7f..abb84b2 100644
@@ -917,6 +917,13 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
 
 	dev->status = 0;
 	dev->act_len = len;
+
+#ifdef MUSB_NO_MULTIPOINT
+	/* Set device address to USB_FADDR register */
+	if (setup->request == USB_REQ_SET_ADDRESS)
+		writew(dev->devnum, &musbr->faddr);
+#endif
+
 	return len;
 }
 
Signature · 1 line
1.7.2
#1 lore raw

PATCH 1/1 usb: musb: set target address for non-multipoint devices

Quoted 14 lines · Mike Frysinger

From: Bryan Wu <[email protected]>

---
 drivers/usb/musb/musb_hcd.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/usb/musb/musb_hcd.c +0 -0
index dd2aa7f..abb84b2 100644

drivers/usb/musb/musb_hcd.c int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer, · line 924

Quoted 8 lines
drivers/usb/musb/musb_hcd.c +5 -0
@@ -917,6 +917,13 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
 
 	dev->status = 0;
 	dev->act_len = len;
+
+#ifdef MUSB_NO_MULTIPOINT
+	/* Set device address to USB_FADDR register */
+	if (setup->request == USB_REQ_SET_ADDRESS)
+		writew(dev->devnum, &musbr->faddr);

FAddr is a 8-bit regisrer, isn't it?

WBR, Sergei

#2 lore raw

PATCH 1/1 usb: musb: set target address for non-multipoint devices

Quoted 14 lines · Sergei Shtylyov

drivers/usb/musb/musb_hcd.c int submit_control_msg(struct usb_device *dev, · line 924

Quoted 11 lines · Mike Frysinger
drivers/usb/musb/musb_hcd.c +5 -0
@@ -917,6 +917,13 @@ int submit_control_msg(struct usb_device *dev,
 unsigned long pipe, void *buffer,
 ? ? ? ?dev->status = 0;
 ? ? ? ?dev->act_len = len;
+
+#ifdef MUSB_NO_MULTIPOINT
+ ? ? ? /* Set device address to USB_FADDR register */
+ ? ? ? if (setup->request == USB_REQ_SET_ADDRESS)
+ ? ? ? ? ? ? ? writew(dev->devnum, &musbr->faddr);

? FAddr is a 8-bit regisrer, isn't it?

on Blackfin systems, it is 16bit ... i'll have to double check to see what the hardware does with an 8bit access. i see there are other places in the code where 8bit is already being done, so those might need to be addressed as well ...
-mike

#3 lore raw

PATCH 1/1 usb: musb: set target address for non-multipoint devices

Quoted 16 lines · Mike Frysinger
Quoted 14 lines · Sergei Shtylyov

drivers/usb/musb/musb_hcd.c int submit_control_msg(struct usb_device *dev, · line 924

Quoted 11 lines · Mike Frysinger
drivers/usb/musb/musb_hcd.c +5 -0
@@ -917,6 +917,13 @@ int submit_control_msg(struct usb_device *dev,
 unsigned long pipe, void *buffer,
 ? ? ? ?dev->status = 0;
 ? ? ? ?dev->act_len = len;
+
+#ifdef MUSB_NO_MULTIPOINT
+ ? ? ? /* Set device address to USB_FADDR register */
+ ? ? ? if (setup->request == USB_REQ_SET_ADDRESS)
+ ? ? ? ? ? ? ? writew(dev->devnum, &musbr->faddr);

? FAddr is a 8-bit regisrer, isn't it?

Quoted 4 lines

on Blackfin systems, it is 16bit ... i'll have to double check to see what the hardware does with an 8bit access. ?i see there are other places in the code where 8bit is already being done, so those might need to be addressed as well ...

yeah, Blackfin hardware likes to reject 8bit accesses to this mmr. although, i just remembered that in the musb code only, we specifically rewrite all readb/writeb to readw/writew for Blackfin systems. so i'll change this patch to writeb as you suggested. -mike

#4 lore raw

PATCH v2 1/1 usb: musb: set target address for non-multipoint devices

In reply to Mike Frysinger

From: Bryan Wu <[email protected]>

---
v2
- use writeb instead of writew as pointed out by Sergei Shtylyov

 drivers/usb/musb/musb_hcd.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/usb/musb/musb_hcd.c +7 -0
index dd2aa7f..8a761df 100644
@@ -917,6 +917,13 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
 
 	dev->status = 0;
 	dev->act_len = len;
+
+#ifdef MUSB_NO_MULTIPOINT
+	/* Set device address to USB_FADDR register */
+	if (setup->request == USB_REQ_SET_ADDRESS)
+		writeb(dev->devnum, &musbr->faddr);
+#endif
+
 	return len;
 }
 
Signature · 1 line
1.7.2