From patchwork Fri Sep 8 17:34:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 112113 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1959010ybm; Fri, 8 Sep 2017 10:43:27 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4VecfPoTHQQqGBpm/+1MbWEoN8XzJ76pADNNsAtkKnPwabkM2jvIevIW4fqn1w/tuI00uU X-Received: by 10.80.204.217 with SMTP id b25mr637028edj.44.1504892607772; Fri, 08 Sep 2017 10:43:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504892607; cv=none; d=google.com; s=arc-20160816; b=KTNK0Xo/H7gA578TFb5wyWzFtJcWIfvGMnolwNgaFk0A9iJj2S2S6YvJx13oEPgSjY yqSJLGeaTUX74ZUMeMoPcjRHeaYJrY4skQSuFerS1zX7AK6K/YeIDX9JdT/jh4k3FkeW h1KxJIo4kqN8tiCtBcALEpoHNGjB29h9Z+lmLO/WLvk2yStguDEncz6CWboIQbukWfHw fbQ9QAyyuqyqfXgOiS/Oo/15J/UCGbU+JLg3gwo+w3UH+pq8OJ9U6p1j/92+WupSoUui PEIAm98zpTMdyrCf8pkMfyUSh5ASnMU5qGwoGZhvgUSBQr+QkG2eQwWz8q8bg2D09eKK E/JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:references :in-reply-to:message-id:date:to:from:arc-authentication-results; bh=oGW/uQEpGLSx9FlKU3ZtA9ODtvPQUtooYWDZVEYrU04=; b=GYiSFlaEJzEW4rTBz+r45w2/s35/bqhExlXFFvTUsSyLCPhzaBQ3oV7QGByL+ZRuL4 EXHqm2DZbNKnUMQQMUKgU5m21iYjd6mb2mPRwyUlGd6K6KeN96L3sO0BNOqf2QdWceuM qmCS2793mM4NWsC74/QCOD1+d6/hU5Knng0inr++p8T+V5N2DCstPskmVRLf0k+2coY9 fR5bIMHsj0oLVs+MEx+wH/CUryzRjqvrMB4Xt5zb/tEBghYaygTmMAnZ0TwyfEMjpzGI X/XgecpcwoXUvPqYULnvh8WG5NgwtmBLF7ao/yqTDt0vU9vtt2zrM09EAvaVFksmqZmk 3zZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id j10si2522588edl.249.2017.09.08.10.43.27; Fri, 08 Sep 2017 10:43:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 42DD8C21F0B; Fri, 8 Sep 2017 17:43:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 8E259C21F56; Fri, 8 Sep 2017 17:34:56 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BA8D9C21F47; Fri, 8 Sep 2017 17:34:41 +0000 (UTC) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id 0C546C21E42 for ; Fri, 8 Sep 2017 17:34:36 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 8246820882; Fri, 8 Sep 2017 19:34:34 +0200 (CEST) Received: from localhost (LFbn-TOU-1-209-191.w86-201.abo.wanadoo.fr [86.201.56.191]) by mail.free-electrons.com (Postfix) with ESMTPSA id 5217320882; Fri, 8 Sep 2017 19:34:34 +0200 (CEST) From: Maxime Ripard To: Tom Rini , Jagan Teki Date: Fri, 8 Sep 2017 19:34:17 +0200 Message-Id: X-Mailer: git-send-email 2.13.5 In-Reply-To: References: In-Reply-To: References: Cc: Thomas Petazzoni , marex@denx.de, u-boot@lists.denx.de, Maxime Ripard Subject: [U-Boot] [PATCH 06/13] usb: gadget: usb_ether: Move settings to common X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The usb_ether gadget duplicates the USB settings for the manufacturer, product ID and vendor ID. Make sure we use the common option so that we can expect a single VID/PID couple for a single device. Signed-off-by: Maxime Ripard Reviewed-by: Lukasz Majewski Reviewed-by: Simon Glass --- configs/sama5d2_ptc_nandflash_defconfig | 1 + configs/sama5d2_ptc_spiflash_defconfig | 1 + configs/vinco_defconfig | 1 + drivers/usb/gadget/ether.c | 16 ++++++++-------- include/configs/ma5d4evk.h | 1 - include/configs/sama5d2_ptc.h | 1 - include/configs/vinco.h | 1 - scripts/config_whitelist.txt | 1 - 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/configs/sama5d2_ptc_nandflash_defconfig b/configs/sama5d2_ptc_nandflash_defconfig index 6672a5ce11f7..431056a50a8b 100644 --- a/configs/sama5d2_ptc_nandflash_defconfig +++ b/configs/sama5d2_ptc_nandflash_defconfig @@ -29,5 +29,6 @@ CONFIG_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_STORAGE=y CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_MANUFACTURER="Atmel SAMA5D2_PTC" CONFIG_USB_GADGET_ATMEL_USBA=y CONFIG_USB_ETHER=y diff --git a/configs/sama5d2_ptc_spiflash_defconfig b/configs/sama5d2_ptc_spiflash_defconfig index 9a23a808f1b3..66bb671820a6 100644 --- a/configs/sama5d2_ptc_spiflash_defconfig +++ b/configs/sama5d2_ptc_spiflash_defconfig @@ -30,5 +30,6 @@ CONFIG_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_STORAGE=y CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_MANUFACTURER="Atmel SAMA5D2_PTC" CONFIG_USB_GADGET_ATMEL_USBA=y CONFIG_USB_ETHER=y diff --git a/configs/vinco_defconfig b/configs/vinco_defconfig index b0df6b3c7805..8d7f9f99ab81 100644 --- a/configs/vinco_defconfig +++ b/configs/vinco_defconfig @@ -33,3 +33,4 @@ CONFIG_USB_STORAGE=y CONFIG_USB_GADGET=y CONFIG_USB_GADGET_ATMEL_USBA=y CONFIG_USB_ETHER=y +CONFIG_USB_GADGET_MANUFACTURER="L+G VInCo" diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 2cf5c8d31e25..dbb578258f96 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -273,8 +273,8 @@ static inline int BITRATE(struct usb_gadget *g) * static ushort idProduct; */ -#if defined(CONFIG_USBNET_MANUFACTURER) -static char *iManufacturer = CONFIG_USBNET_MANUFACTURER; +#if defined(CONFIG_USB_GADGET_MANUFACTURER) +static char *iManufacturer = CONFIG_USB_GADGET_MANUFACTURER; #else static char *iManufacturer = "U-Boot"; #endif @@ -2073,11 +2073,11 @@ static int eth_bind(struct usb_gadget *gadget) * to choose the right configuration otherwise. */ if (rndis) { -#if defined(CONFIG_USB_RNDIS_VENDOR_ID) && defined(CONFIG_USB_RNDIS_PRODUCT_ID) +#if defined(CONFIG_USB_GADGET_VENDOR_NUM) && defined(CONFIG_USB_GADGET_PRODUCT_NUM) device_desc.idVendor = - __constant_cpu_to_le16(CONFIG_USB_RNDIS_VENDOR_ID); + __constant_cpu_to_le16(CONFIG_USB_GADGET_VENDOR_NUM); device_desc.idProduct = - __constant_cpu_to_le16(CONFIG_USB_RNDIS_PRODUCT_ID); + __constant_cpu_to_le16(CONFIG_USB_GADGET_PRODUCT_NUM); #else device_desc.idVendor = __constant_cpu_to_le16(RNDIS_VENDOR_NUM); @@ -2092,9 +2092,9 @@ static int eth_bind(struct usb_gadget *gadget) * supporting one submode of the "SAFE" variant of MDLM.) */ } else { -#if defined(CONFIG_USB_CDC_VENDOR_ID) && defined(CONFIG_USB_CDC_PRODUCT_ID) - device_desc.idVendor = cpu_to_le16(CONFIG_USB_CDC_VENDOR_ID); - device_desc.idProduct = cpu_to_le16(CONFIG_USB_CDC_PRODUCT_ID); +#if defined(CONFIG_USB_GADGET_VENDOR_NUM) && defined(CONFIG_USB_GADGET_PRODUCT_NUM) + device_desc.idVendor = cpu_to_le16(CONFIG_USB_GADGET_VENDOR_NUM); + device_desc.idProduct = cpu_to_le16(CONFIG_USB_GADGET_PRODUCT_NUM); #else if (!cdc) { device_desc.idVendor = diff --git a/include/configs/ma5d4evk.h b/include/configs/ma5d4evk.h index 6d25d84c6eb6..3aeb7e6ef136 100644 --- a/include/configs/ma5d4evk.h +++ b/include/configs/ma5d4evk.h @@ -97,7 +97,6 @@ #ifdef CONFIG_CMD_USB /* USB device */ -#define CONFIG_USBNET_MANUFACTURER "AriesEmbedded" #define CONFIG_USB_FUNCTION_MASS_STORAGE #define CONFIG_SYS_DFU_DATA_BUF_SIZE (1 * 1024 * 1024) #define DFU_DEFAULT_POLL_TIMEOUT 300 diff --git a/include/configs/sama5d2_ptc.h b/include/configs/sama5d2_ptc.h index 543592e3a574..2328c7614ed7 100644 --- a/include/configs/sama5d2_ptc.h +++ b/include/configs/sama5d2_ptc.h @@ -60,7 +60,6 @@ #endif /* USB device */ -#define CONFIG_USBNET_MANUFACTURER "Atmel SAMA5D2_PTC" /* Ethernet Hardware */ #define CONFIG_MACB diff --git a/include/configs/vinco.h b/include/configs/vinco.h index d3d5dc8f7732..265da84fc0cc 100644 --- a/include/configs/vinco.h +++ b/include/configs/vinco.h @@ -64,7 +64,6 @@ #endif /* USB device */ -#define CONFIG_USBNET_MANUFACTURER "L+G VInCo" /* Ethernet Hardware */ #define CONFIG_PHY_SMSC diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index c1285ce27fec..1020d6db9f8c 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -4993,7 +4993,6 @@ CONFIG_USBD_SERIAL_OUT_PKTSIZE CONFIG_USBD_VENDORID CONFIG_USBID_ADDR CONFIG_USBNET_DEV_ADDR -CONFIG_USBNET_MANUFACTURER CONFIG_USBTTY CONFIG_USB_AM35X CONFIG_USB_ATMEL