diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2015-05-11 18:20:06 +0200 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2015-05-11 18:20:06 +0200 |
commit | b57d2db1a3b4146f8b7f967da1d60f8f9608e689 (patch) | |
tree | 761112ab268346e85291cc456a83a9ffca1466dd | |
parent | 5fd93c2b8f262b9cd61c038b07fe1d0496280cc3 (diff) |
toradex: common: use define for product number offset
The USB product ID's for the Colibri/Apalis family of Toradex can
be calculated by using the Toradex product ID (as provided by the
config block) plus a fixed offset of 0x4000.
-rw-r--r-- | board/toradex/common/common.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/board/toradex/common/common.c b/board/toradex/common/common.c index ac1b73430bc..8f89a9fb749 100644 --- a/board/toradex/common/common.c +++ b/board/toradex/common/common.c @@ -9,6 +9,8 @@ #include <g_dnl.h> #include <libfdt.h> +#define TORADEX_USB_PRODUCT_NUM_OFFSET 0x4000 + static char trdx_serial_str[9]; static char trdx_board_rev_str[6]; @@ -134,7 +136,7 @@ int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name) unsigned short usb_pid = 0xffff; #ifdef CONFIG_TRDX_CONFIGBLOCK - usb_pid = 0x4000 + trdx_hw_tag.prodid; + usb_pid = TORADEX_USB_PRODUCT_NUM_OFFSET + trdx_hw_tag.prodid; #endif put_unaligned(usb_pid, &dev->idProduct); |