Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1426274

Re: [PATCH v10 06/14] usb: gadget.h: Add OTG to gadget interface

Path csiph.com!aioe.org!newsfeed.CARNet.hr!news.spin.it!bofh.it!news.nic.it!robomod
From Felipe Balbi <balbi@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v10 06/14] usb: gadget.h: Add OTG to gadget interface
Date Mon, 20 Jun 2016 09:30:01 +0200
Message-ID <rM1OF-5eM-9@gated-at.bofh.it> (permalink)
References <rIumd-4YI-3@gated-at.bofh.it> <rIumd-4YI-1@gated-at.bofh.it>
X-Extloop1 1
X-Ironport-Av E=Sophos;i="5.26,497,1459839600"; d="asc'?scan'208";a="831514359"
User-Agent Notmuch/0.22+11~g124a67e (http://notmuchmail.org) Emacs/25.0.93.2 (x86_64-pc-linux-gnu)
MIME-Version 1.0
Content-Type multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature"
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 75
Organization linux.* mail to news gateway
X-Original-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, Roger Quadros <rogerq@ti.com>
X-Original-Date Mon, 20 Jun 2016 10:21:22 +0300
X-Original-Message-ID <87k2hkxr4d.fsf@linux.intel.com>
X-Original-References <1465564043-27163-1-git-send-email-rogerq@ti.com> <1465564043-27163-7-git-send-email-rogerq@ti.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1426274

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi,

Roger Quadros <rogerq@ti.com> 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 <rogerq@ti.com>
> ---
>  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 {
>  };
>  
>  
> +/*-------------------------------------------------------------------------*/
> +
> +/**
> + * 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);
> +};

you shouldn't need these at all. They are already part of the gadget
framework as ->udc_start(), ->udc_stop() and ->pullup()

-- 
balbi

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH v10 06/14] usb: gadget.h: Add OTG to gadget interface Felipe Balbi <balbi@kernel.org> - 2016-06-20 09:30 +0200
  Re: [PATCH v10 06/14] usb: gadget.h: Add OTG to gadget interface Roger Quadros <rogerq@ti.com> - 2016-06-20 09:30 +0200
    Re: [PATCH v10 06/14] usb: gadget.h: Add OTG to gadget interface Felipe Balbi <balbi@kernel.org> - 2016-06-20 10:20 +0200
      Re: [PATCH v10 06/14] usb: gadget.h: Add OTG to gadget interface Roger Quadros <rogerq@ti.com> - 2016-06-20 10:40 +0200
        Re: [PATCH v10 06/14] usb: gadget.h: Add OTG to gadget interface Felipe Balbi <balbi@kernel.org> - 2016-06-20 11:30 +0200
          Re: [PATCH v10 06/14] usb: gadget.h: Add OTG to gadget interface Roger Quadros <rogerq@ti.com> - 2016-06-20 12:00 +0200

csiph-web