Skip to contentSkip to conversation

usb, g_dnl: make possibility to fixup the device_desc board specific

U-Boot Heiko Schocher 2 participants 2 messages Jun 4, 2013 USB

lore
Share & tools
lore
#0 lore raw

add a weak dummy function g_dnl_fixup to add the possibility to update the device_desc board specific. Used on the upcoming siemens board support, where idVendor and idProduct is stored in an eeprom.

Cc Marek Vasut <[email protected]>
Cc Lukasz Majewski <[email protected]>
Cc Kyungmin Park <[email protected]>
---
 drivers/usb/gadget/g_dnl.c | 7 +++++++
 include/g_dnl.h            | 2 +-

2 Dateien ge?ndert, 8 Zeilen hinzugef?gt(+), 1 Zeile entfernt(-)

drivers/usb/gadget/g_dnl.c +7 -0
index cc3f344..8a3777b 100644
@@ -125,6 +125,12 @@ static int g_dnl_config_register(struct usb_composite_dev *cdev)
 	return usb_add_config(cdev, &config);
 }
 
+__weak
+int g_dnl_bind_fixup(struct usb_device_descriptor *dev)
+{
+	return 0;
+}
+
 static int g_dnl_bind(struct usb_composite_dev *cdev)
 {
 	struct usb_gadget *gadget = cdev->gadget;
@@ -147,6 +153,7 @@ static int g_dnl_bind(struct usb_composite_dev *cdev)
 	g_dnl_string_defs[1].id = id;
 	device_desc.iProduct = id;
 
+	g_dnl_bind_fixup(&device_desc);
 	ret = g_dnl_config_register(cdev);
 	if (ret)
 		goto error;
include/g_dnl.h +1 -1
index f47395f..f8affd8 100644
@@ -23,7 +23,7 @@
 
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
-
+int g_dnl_bind_fixup(struct usb_device_descriptor *);
 int g_dnl_register(const char *s);
 void g_dnl_unregister(void);
 
Signature · 1 line
1.7.11.7
Reviewed-by
#1 lore raw

Hi Heiko,

Quoted 4 lines

add a weak dummy function g_dnl_fixup to add the possibility to update the device_desc board specific. Used on the upcoming siemens board support, where idVendor and idProduct is stored in an eeprom.

Quoted 47 lines
Cc Marek Vasut <[email protected]>
Cc Lukasz Majewski <[email protected]>
Cc Kyungmin Park <[email protected]>
---
 drivers/usb/gadget/g_dnl.c | 7 +++++++
 include/g_dnl.h            | 2 +-

2 Dateien ge?ndert, 8 Zeilen hinzugef?gt(+), 1 Zeile entfernt(-)

drivers/usb/gadget/g_dnl.c +7 -0
index cc3f344..8a3777b 100644
@@ -125,6 +125,12 @@ static int g_dnl_config_register(struct
 usb_composite_dev *cdev) return usb_add_config(cdev, &config);
 }
 
+__weak
+int g_dnl_bind_fixup(struct usb_device_descriptor *dev)
+{
+	return 0;
+}
+
 static int g_dnl_bind(struct usb_composite_dev *cdev)
 {
 	struct usb_gadget *gadget = cdev->gadget;
@@ -147,6 +153,7 @@ static int g_dnl_bind(struct usb_composite_dev
 *cdev) g_dnl_string_defs[1].id = id;
 	device_desc.iProduct = id;
 
+	g_dnl_bind_fixup(&device_desc);
 	ret = g_dnl_config_register(cdev);
 	if (ret)
 		goto error;
include/g_dnl.h +1 -1
index f47395f..f8affd8 100644
@@ -23,7 +23,7 @@
 
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
-
+int g_dnl_bind_fixup(struct usb_device_descriptor *);
 int g_dnl_register(const char *s);
 void g_dnl_unregister(void);
 
Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Poland Institute (SRPOL) | Linux Platform Group