From patchwork Fri Jun 10 13:07:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 69766 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp284786qgf; Fri, 10 Jun 2016 06:08:32 -0700 (PDT) X-Received: by 10.66.144.228 with SMTP id sp4mr2322651pab.107.1465564111156; Fri, 10 Jun 2016 06:08:31 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xw5si12092516pac.189.2016.06.10.06.08.30; Fri, 10 Jun 2016 06:08:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932261AbcFJNIR (ORCPT + 5 others); Fri, 10 Jun 2016 09:08:17 -0400 Received: from bear.ext.ti.com ([198.47.19.11]:38335 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161022AbcFJNIO (ORCPT ); Fri, 10 Jun 2016 09:08:14 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id u5AD80nr016749; Fri, 10 Jun 2016 08:08:00 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id u5AD80x4014343; Fri, 10 Jun 2016 08:08:00 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.294.0; Fri, 10 Jun 2016 08:07:59 -0500 Received: from lta0400828d.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id u5AD7ODh000644; Fri, 10 Jun 2016 08:07:55 -0500 From: Roger Quadros To: CC: , , , , , , , , , , , , , , , , , , Roger Quadros Subject: [PATCH v10 06/14] usb: gadget.h: Add OTG to gadget interface Date: Fri, 10 Jun 2016 16:07:15 +0300 Message-ID: <1465564043-27163-7-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1465564043-27163-1-git-send-email-rogerq@ti.com> References: <1465564043-27163-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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(+) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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); +}; /*-------------------------------------------------------------------------*/