From patchwork Mon May 2 12:18:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 67016 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp9400qge; Mon, 2 May 2016 05:20:14 -0700 (PDT) X-Received: by 10.98.100.71 with SMTP id y68mr51376781pfb.84.1462191603033; Mon, 02 May 2016 05:20:03 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id by2si3630127pab.168.2016.05.02.05.20.02; Mon, 02 May 2016 05:20:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753707AbcEBMT4 (ORCPT + 7 others); Mon, 2 May 2016 08:19:56 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:35816 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753610AbcEBMTl (ORCPT ); Mon, 2 May 2016 08:19:41 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id u42CJSuc013376; Mon, 2 May 2016 07:19:28 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id u42CJS4V002041; Mon, 2 May 2016 07:19:28 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Mon, 2 May 2016 07:19:28 -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 u42CIxXu027290; Mon, 2 May 2016 07:19:24 -0500 From: Roger Quadros To: CC: , , , , , , , , , , , , , , Roger Quadros Subject: [PATCH v7 06/14] usb: gadget.h: Add OTG to gadget interface Date: Mon, 2 May 2016 15:18:49 +0300 Message-ID: <1462191537-10314-7-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1462191537-10314-1-git-send-email-rogerq@ti.com> References: <1462191537-10314-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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 Reviewed-by: Peter Chen --- include/linux/usb/gadget.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe devicetree" 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 5d4e151..8c0ae64 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -1100,6 +1100,20 @@ 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 + */ +struct otg_gadget_ops { + int (*start)(struct usb_gadget *gadget); + int (*stop)(struct usb_gadget *gadget); +}; /*-------------------------------------------------------------------------*/