From: Lukasz Majewski <l.majewski@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1 4/5] usb, g_dnl: make bcdDevice value configurable
Date: Tue, 22 Oct 2013 14:20:17 +0200 [thread overview]
Message-ID: <20131022142017.4ab99f46@amdc308.digital.local> (raw)
In-Reply-To: <1382437545-23720-5-git-send-email-hs@denx.de>
Hi Heiko,
> add the possibility to set the bcdDevice number board specific.
> Therefore the weak function g_dnl_get_board_bcd_device_number()
> is introduced. Used on the siemens boards.
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
>
> Signed-off-by: Heiko Schocher <hs@denx.de>
> Cc: Marek Vasut <marek.vasut@gmail.com>
> Cc: Lukasz Majewski <l.majewski@samsung.com>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> drivers/usb/gadget/g_dnl.c | 23 +++++++++++++++++++----
> 1 file changed, 19 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
> index 5f09d66..942920e 100644
> --- a/drivers/usb/gadget/g_dnl.c
> +++ b/drivers/usb/gadget/g_dnl.c
> @@ -142,6 +142,23 @@ int g_dnl_bind_fixup(struct
> usb_device_descriptor *dev) return 0;
> }
>
> +__weak int g_dnl_get_board_bcd_device_number(int gcnum)
> +{
> + return gcnum;
> +}
> +
> +static int g_dnl_get_bcd_device_number(struct usb_composite_dev
> *cdev) +{
> + struct usb_gadget *gadget = cdev->gadget;
> + int gcnum;
> +
> + gcnum = usb_gadget_controller_number(gadget);
> + if (gcnum > 0)
> + gcnum += 0x200;
> +
> + return g_dnl_get_board_bcd_device_number(gcnum);
> +}
> +
> static int g_dnl_bind(struct usb_composite_dev *cdev)
> {
> struct usb_gadget *gadget = cdev->gadget;
> @@ -178,11 +195,9 @@ static int g_dnl_bind(struct usb_composite_dev
> *cdev) if (ret)
> goto error;
>
> - gcnum = usb_gadget_controller_number(gadget);
> -
> - debug("gcnum: %d\n", gcnum);
> + gcnum = g_dnl_get_bcd_device_number(cdev);
> if (gcnum >= 0)
> - device_desc.bcdDevice = cpu_to_le16(0x0200 + gcnum);
> + device_desc.bcdDevice = cpu_to_le16(gcnum);
> else {
> debug("%s: controller '%s' not recognized\n",
> shortname, gadget->name);
--
Best regards,
Lukasz Majewski
Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
next prev parent reply other threads:[~2013-10-22 12:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-22 10:25 [U-Boot] [PATCH v1 0/5] arm, am33xx: update for the am33xx based siemens boards Heiko Schocher
2013-10-22 10:25 ` [U-Boot] [PATCH v1 1/5] bootcount: store bootcount var in environment Heiko Schocher
2013-10-24 11:31 ` Vaibhav Bedia
2013-10-22 10:25 ` [U-Boot] [PATCH v1 2/5] arm, am33x: make RTC32K OSC enable configurable Heiko Schocher
2013-10-22 10:25 ` [U-Boot] [PATCH v1 3/5] usb, g_dnl: make iSerialNumber board configurable Heiko Schocher
2013-10-22 12:37 ` Lukasz Majewski
2013-10-22 12:52 ` Heiko Schocher
2013-10-22 13:34 ` Lukasz Majewski
2013-10-22 10:25 ` [U-Boot] [PATCH v1 4/5] usb, g_dnl: make bcdDevice value configurable Heiko Schocher
2013-10-22 12:20 ` Lukasz Majewski [this message]
2013-10-22 10:25 ` [U-Boot] [PATCH v1 5/5] arm, am335x: update for the siemens boards Heiko Schocher
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=20131022142017.4ab99f46@amdc308.digital.local \
--to=l.majewski@samsung.com \
--cc=u-boot@lists.denx.de \
/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