From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752858AbcFTIQM (ORCPT ); Mon, 20 Jun 2016 04:16:12 -0400 Received: from mga11.intel.com ([192.55.52.93]:34823 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751628AbcFTIQD (ORCPT ); Mon, 20 Jun 2016 04:16:03 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,497,1459839600"; d="asc'?scan'208";a="722119432" From: Felipe Balbi To: Roger Quadros , peter.chen@freescale.com Cc: tony@atomide.com, gregkh@linuxfoundation.org, dan.j.williams@intel.com, mathias.nyman@linux.intel.com, Joao.Pinto@synopsys.com, sergei.shtylyov@cogentembedded.com, jun.li@freescale.com, grygorii.strashko@ti.com, yoshihiro.shimoda.uh@renesas.com, robh@kernel.org, nsekhar@ti.com, b-liu@ti.com, joe@perches.com, linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v10 06/14] usb: gadget.h: Add OTG to gadget interface In-Reply-To: <57679B30.6030809@ti.com> References: <1465564043-27163-1-git-send-email-rogerq@ti.com> <1465564043-27163-7-git-send-email-rogerq@ti.com> <87k2hkxr4d.fsf@linux.intel.com> <57679B30.6030809@ti.com> User-Agent: Notmuch/0.22+11~g124a67e (http://notmuchmail.org) Emacs/25.0.93.2 (x86_64-pc-linux-gnu) Date: Mon, 20 Jun 2016 11:13:37 +0300 Message-ID: <87d1ncxopa.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Roger Quadros writes: > [ Unknown signature status ] > On 20/06/16 10:21, Felipe Balbi wrote: >>=20 >> Hi, >>=20 >> Roger Quadros writes: >>> The OTG core will use struct otg_gadget_ops to >>> start/stop the gadget controller. >>> >>> The main purpose of this interface is to avoid directly >>> calling usb_gadget_start/stop() from the OTG core as they >>> wouldn't be defined in the built-in symbol table if >>> CONFIG_USB_GADGET is m. >>> >>> Signed-off-by: Roger Quadros >>> --- >>> include/linux/usb/gadget.h | 16 ++++++++++++++++ >>> 1 file changed, 16 insertions(+) >>> >>> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h >>> index 2dd9e6b..f4fc0aa 100644 >>> --- a/include/linux/usb/gadget.h >>> +++ b/include/linux/usb/gadget.h >>> @@ -639,6 +639,22 @@ struct usb_gadget_driver { >>> }; >>>=20=20 >>>=20=20 >>> +/*--------------------------------------------------------------------= -----*/ >>> + >>> +/** >>> + * struct otg_gadget_ops - Interface between OTG core and gadget >>> + * >>> + * Provided by the gadget core to allow the OTG core to start/stop the= gadget >>> + * >>> + * @start: function to start the gadget >>> + * @stop: function to stop the gadget >>> + * @connect_control: function to connect/disconnect from the bus >>> + */ >>> +struct otg_gadget_ops { >>> + int (*start)(struct usb_gadget *gadget); >>> + int (*stop)(struct usb_gadget *gadget); >>> + int (*connect_control)(struct usb_gadget *gadget, bool connect); >>> +}; >>=20 >> you shouldn't need these at all. They are already part of the gadget >> framework as ->udc_start(), ->udc_stop() and ->pullup() >>=20 > > This is to avoid the undefined symbol errors during build when OTG has is > built-in because USB (host) is built-in but GADGET is still a module. change your Kconfig dependencies. OTG layer shouldn't be built-in unless both Gadget and Host are built-in. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXZ6WxAAoJEIaOsuA1yqREPEwQAIbydRmtZUjksjNQQnYHUQUp Nz11gd0+S8MqrybPD8Y7WPw4tXfZi9eWFuf/WaGm79+vDzf93VxmRVIJmfcZyide OjgARsKPDJ3RA5bnG0OTnR6QiT3soIxjlMjUGCd0Mx3+/81pqPNArgnPjOSA3U81 7PoqyWwlRfkwyP40TLP9uXY77w6ZoRLZ+p/I7U9SSVj9vZkFAKmo+YNjxfVHhoV2 cF7YgWEgpGByl5jqyiM6mn+uDWdivUpP5ejBLFprM4SwN7/K02o24akLrF/4BCXp komrfBYyzQpse9sV4n06fXzpQjHGlwz8PuNqSGcFxInHIV++D7Q/H2OUiyGLjA56 MQkOn/91qvHWqpaTETWVaj1fTO0KSQ2/ubiUMInRmq806YSHqQHW3hY9Bdw7yHcX guhztz+wy0e6RrdP+mu0ADpqe04XB5JczIkcpdOrb4lawQyWLcjbQzL5QCVygFUf 8jvuMfzlBJ9GdgnvIjuFWv2ZYrkios3btzd5lR62uXjTI2hIX8MNIBzhsSWV3bm1 iEunZHIjGINbImdwvgLxi6aM+5emhNqI7f0jbDmHYvD0VaDcVbYBqZez6PCUO6A9 TO5kI46fYmDfTn8wz+Fy3Pix30q7tEl2mKATgvvPN8xvJMM7fB3UVMVCrS/OzLyv wM/Z5UQVv9CmudjKouxL =mJvn -----END PGP SIGNATURE----- --=-=-=--