From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] USB: dfu: Use barebox product id
Date: Fri, 14 Feb 2014 16:33:43 +0100 [thread overview]
Message-ID: <1392392023-9902-1-git-send-email-s.hauer@pengutronix.de> (raw)
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
reply other threads:[~2014-02-14 15:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1392392023-9902-1-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox