From patchwork Fri May 25 09:32:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Jacques Hiblot X-Patchwork-Id: 920355 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="MJUYaTbA"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40sgz148mDz9s08 for ; Fri, 25 May 2018 19:33:01 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 42AE3C21E2C; Fri, 25 May 2018 09:32:57 +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=T_DKIM_INVALID 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 E2FD5C21C27; Fri, 25 May 2018 09:32:53 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A2C6AC21C2C; Fri, 25 May 2018 09:32:51 +0000 (UTC) Received: from fllnx209.ext.ti.com (fllnx209.ext.ti.com [198.47.19.16]) by lists.denx.de (Postfix) with ESMTPS id CD67FC21C27 for ; Fri, 25 May 2018 09:32:50 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id w4P9WlCx014867; Fri, 25 May 2018 04:32:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1527240767; bh=6wFuIhDDjHpyHbtJDMp6q/cdzaImAktMZXWdPD20c3w=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=MJUYaTbAUQu6so46RSr8DQ1u+xk9qjoHzv5KM5xoOcLUOZRYF0DgXWFZOOLe7VF5r TMDjbKpWoYpa2hoMR/Hz2KIYUaxzY0ydULOyxtvaDXvDbsXID12Fv8tEfvcH2Aqs5V oFbOIoOOukX08/Ce0CzDT+gSlL5maKyYzNjAK9Gw= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w4P9WleO031721; Fri, 25 May 2018 04:32:47 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 25 May 2018 04:32:46 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Fri, 25 May 2018 04:32:47 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w4P9Wkaw030150; Fri, 25 May 2018 04:32:46 -0500 From: Jean-Jacques Hiblot To: , Date: Fri, 25 May 2018 11:32:37 +0200 Message-ID: <1527240762-27114-3-git-send-email-jjhiblot@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527240762-27114-1-git-send-email-jjhiblot@ti.com> References: <1527240762-27114-1-git-send-email-jjhiblot@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v1 2/7] usb: introduce a separate config option for DM USB device 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Using CONFIG_DM_USB for this purpose prevents using DM_USB for host and not for device. Signed-off-by: Jean-Jacques Hiblot --- drivers/usb/Kconfig | 6 ++++++ drivers/usb/dwc3/core.c | 2 +- drivers/usb/dwc3/dwc3-generic.c | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig index 4fbe172..3587ba4 100644 --- a/drivers/usb/Kconfig +++ b/drivers/usb/Kconfig @@ -47,6 +47,12 @@ config DM_USB declared with the U_BOOT_USB_DEVICE() macro and will be automatically probed when found on the bus. +config DM_USB_DEV + bool "Enable driver model for USB (Peripheral mode)" + depends on DM_USB + help + Enable driver model for USB (Peripheral mode). + source "drivers/usb/host/Kconfig" source "drivers/usb/dwc3/Kconfig" diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 1ab5cee..d5ee6d9 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -789,7 +789,7 @@ MODULE_AUTHOR("Felipe Balbi "); MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("DesignWare USB3 DRD Controller Driver"); -#ifdef CONFIG_DM_USB +#ifdef CONFIG_DM_USB_DEV int dwc3_init(struct dwc3 *dwc) { diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c index ca63eac..2c1e696 100644 --- a/drivers/usb/dwc3/dwc3-generic.c +++ b/drivers/usb/dwc3/dwc3-generic.c @@ -21,7 +21,7 @@ #include "gadget.h" #include "linux-compat.h" -DECLARE_GLOBAL_DATA_PTR; +#ifdef CONFIG_DM_USB_DEV int usb_gadget_handle_interrupts(int index) { @@ -98,6 +98,8 @@ U_BOOT_DRIVER(dwc3_generic_peripheral) = { .flags = DM_FLAG_ALLOC_PRIV_DMA, }; +#endif + static int dwc3_generic_bind(struct udevice *parent) { const void *fdt = gd->fdt_blob;