mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] USB: dfu: Use barebox product id
@ 2014-02-14 15:33 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2014-02-14 15:33 UTC (permalink / raw)
  To: barebox

We obtained a USB Product ID from Openmoko for barebox running
in DFU mode. Use it as default for the dfu command. Now we can
make the USB VID/PID arguments optional.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 commands/dfu.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/commands/dfu.c b/commands/dfu.c
index ec1197a..998c868 100644
--- a/commands/dfu.c
+++ b/commands/dfu.c
@@ -125,9 +125,14 @@ static int do_dfu(int argc, char *argv[])
 
 	argstr = argv[optind];
 
-	if (!idProduct || !idVendor) {
-		printf("productid or vendorid not given\n");
-		return 1;
+	if (!idProduct && !idVendor) {
+		idVendor = 0x1d50; /* Openmoko, Inc */
+		idProduct = 0x60a2; /* barebox bootloader USB DFU Mode */
+	}
+
+	if ((idProduct && !idVendor) || (!idProduct && idVendor)) {
+		printf("Only one of vendor id or product id given\n");
+		return -EINVAL;
 	}
 
 	for (n = 0; *argstr; n++) {
-- 
1.8.5.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-02-14 15:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-14 15:33 [PATCH] USB: dfu: Use barebox product id Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox