From patchwork Mon Aug 18 14:28:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 381040 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 1DE78140086 for ; Tue, 19 Aug 2014 01:11:20 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 691134B5F1; Mon, 18 Aug 2014 17:09:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9qmTmWpvzbgE; Mon, 18 Aug 2014 17:09:44 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5FAF84B629; Mon, 18 Aug 2014 17:08:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 319834A04A for ; Mon, 18 Aug 2014 16:29:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JKu-yBtaV+Dp for ; Mon, 18 Aug 2014 16:29:21 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=ERR(-1.5) (only DNSBL check requested) Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by theia.denx.de (Postfix) with ESMTPS id 0020D4A053 for ; Mon, 18 Aug 2014 16:28:59 +0200 (CEST) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s7IESwuJ004501 for ; Mon, 18 Aug 2014 09:28:58 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s7IESwE3006459 for ; Mon, 18 Aug 2014 09:28:58 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.174.1; Mon, 18 Aug 2014 09:28:58 -0500 Received: from a0393678lt.apr.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s7IESbM8003614; Mon, 18 Aug 2014 09:28:56 -0500 From: Kishon Vijay Abraham I To: , , , , , , Date: Mon, 18 Aug 2014 19:58:29 +0530 Message-ID: <1408372115-4570-8-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1408372115-4570-1-git-send-email-kishon@ti.com> References: <1408372115-4570-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 18 Aug 2014 17:07:53 +0200 Subject: [U-Boot] [UBOOT RFC PATCH 07/13] usb: gadget: g_dnl: Explicitly set the max packet size in descriptor X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Explicity set the max packet size in the device descriptor to 0x40 as specified in the device class specification for device firmware upgrade. Also changed debug to printf to explicitly notify the user if the device has been enumerated. Signed-off-by: Kishon Vijay Abraham I --- drivers/usb/gadget/composite.c | 3 +-- drivers/usb/gadget/g_dnl.c | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 7bd2562..60ca9a5 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -331,7 +331,7 @@ static int set_config(struct usb_composite_dev *cdev, } else result = 0; - debug("%s: %s speed config #%d: %s\n", __func__, + printf("%s: %s speed config #%d: %s\n", __func__, ({ char *speed; switch (gadget->speed) { case USB_SPEED_LOW: @@ -987,7 +987,6 @@ static int composite_bind(struct usb_gadget *gadget) memcpy(&cdev->desc, composite->dev, sizeof(struct usb_device_descriptor)); - cdev->desc.bMaxPacketSize0 = gadget->ep0->maxpacket; debug("%s: ready\n", composite->name); return 0; diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c index 25611ac..8128b86 100644 --- a/drivers/usb/gadget/g_dnl.c +++ b/drivers/usb/gadget/g_dnl.c @@ -59,6 +59,7 @@ static struct usb_device_descriptor device_desc = { .bcdUSB = __constant_cpu_to_le16(0x0200), .bDeviceClass = USB_CLASS_COMM, .bDeviceSubClass = 0x02, /*0x02:CDC-modem , 0x00:CDC-serial*/ + .bMaxPacketSize0 = 0x40, .idVendor = __constant_cpu_to_le16(CONFIG_G_DNL_VENDOR_NUM), .idProduct = __constant_cpu_to_le16(CONFIG_G_DNL_PRODUCT_NUM),