From patchwork Tue Apr 5 14:05:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 65091 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp486924lbc; Tue, 5 Apr 2016 07:06:38 -0700 (PDT) X-Received: by 10.98.13.77 with SMTP id v74mr29838928pfi.162.1459865194569; Tue, 05 Apr 2016 07:06:34 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m21si4506960pfi.38.2016.04.05.07.06.34; Tue, 05 Apr 2016 07:06:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-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-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933501AbcDEOGY (ORCPT + 3 others); Tue, 5 Apr 2016 10:06:24 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:57992 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933488AbcDEOGV (ORCPT ); Tue, 5 Apr 2016 10:06:21 -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 u35E5mF8025859; Tue, 5 Apr 2016 09:05:48 -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 u35E5m9o022500; Tue, 5 Apr 2016 09:05:48 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Tue, 5 Apr 2016 09:05:48 -0500 Received: from lta0400828d.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u35E5NP8032137; Tue, 5 Apr 2016 09:05:44 -0500 From: Roger Quadros To: , , , CC: , , , , , , , , , , Roger Quadros Subject: [PATCH v6 05/12] usb: gadget.h: Add OTG to gadget interface Date: Tue, 5 Apr 2016 17:05:10 +0300 Message-ID: <1459865117-7032-6-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1459865117-7032-1-git-send-email-rogerq@ti.com> References: <1459865117-7032-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" 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); +}; /*-------------------------------------------------------------------------*/