From patchwork Wed Jun 8 09:03:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 69602 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2387079qgf; Wed, 8 Jun 2016 02:15:01 -0700 (PDT) X-Received: by 10.66.153.209 with SMTP id vi17mr4726661pab.0.1465377301558; Wed, 08 Jun 2016 02:15:01 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vw4si373932pab.180.2016.06.08.02.15.01; Wed, 08 Jun 2016 02:15:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423318AbcFHJEo (ORCPT + 31 others); Wed, 8 Jun 2016 05:04:44 -0400 Received: from arroyo.ext.ti.com ([198.47.19.12]:59208 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422994AbcFHJEh (ORCPT ); Wed, 8 Jun 2016 05:04:37 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id u5894RTa001962; Wed, 8 Jun 2016 04:04:27 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id u5894RZt028699; Wed, 8 Jun 2016 04:04:27 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.294.0; Wed, 8 Jun 2016 04:04:26 -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 u5893q5U001659; Wed, 8 Jun 2016 04:04:22 -0500 From: Roger Quadros To: CC: , , , , , , , , , , , , , , , , , Roger Quadros Subject: [PATCH v9 06/14] usb: gadget.h: Add OTG to gadget interface Date: Wed, 8 Jun 2016 12:03:38 +0300 Message-ID: <1465376626-30122-7-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1465376626-30122-1-git-send-email-rogerq@ti.com> References: <1465376626-30122-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 457651b..51e3bde 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -1100,6 +1100,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); +}; /*-------------------------------------------------------------------------*/