From patchwork Fri Oct 17 17:16:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 38931 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 552C3202DB for ; Fri, 17 Oct 2014 17:18:04 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id 10sf717810lbg.9 for ; Fri, 17 Oct 2014 10:18:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=ylKH41wS5w62EDN3VwJGDFONy8geBePKgGzrMCqyaSA=; b=e7LlVUAO7wh0Vzm0423OHTMm0zCVp4Yx2NMZQZc63Exm3d/LlliP00TyqkfKA73kTJ aO06knSzVN/E8rX7QDRHBbKNIedZ7YEXMQgBDTiW3BHujkicVcd9adb026g7xmQpQEOY RTCqghkUcY4kDjV9I1MdpY+y3Khd68bCk7SH+Y3BNVFj4WKMvunqzJz1o/SMJN1l4JFi SLJfbBhlSk5BXpo6UW5mCu+1tupIb/vPssLeQPYiQH4yvuCFURacUqzd05iqC0U1i+/C 6QAqybFOvlYYyQk3Zhbq/X5tVc6SsQnrl8FkvlJjkLbwXRS5cpMA/RgWDBnwitzqqXJ6 fZUg== X-Gm-Message-State: ALoCoQnIg+rpTKSZYi+GN6QyDW6QWx/JqnOZBrraLgAo4SfT/lbQ5T2NW2Oyo71hYBdWZYeAeUQs X-Received: by 10.194.242.36 with SMTP id wn4mr628356wjc.4.1413566283174; Fri, 17 Oct 2014 10:18:03 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.133 with SMTP id r5ls256785laa.65.gmail; Fri, 17 Oct 2014 10:18:03 -0700 (PDT) X-Received: by 10.112.200.34 with SMTP id jp2mr10257370lbc.1.1413566283047; Fri, 17 Oct 2014 10:18:03 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id w8si3048049law.7.2014.10.17.10.18.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Oct 2014 10:18:03 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id q1so1042789lam.8 for ; Fri, 17 Oct 2014 10:18:03 -0700 (PDT) X-Received: by 10.152.6.228 with SMTP id e4mr10154598laa.71.1413566282971; Fri, 17 Oct 2014 10:18:02 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp268041lbz; Fri, 17 Oct 2014 10:18:01 -0700 (PDT) X-Received: by 10.70.90.235 with SMTP id bz11mr7510389pdb.74.1413566280452; Fri, 17 Oct 2014 10:18:00 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b7si1686618pdm.75.2014.10.17.10.17.59 for ; Fri, 17 Oct 2014 10:18:00 -0700 (PDT) Received-SPF: none (google.com: linux-usb-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753502AbaJQRR5 (ORCPT + 3 others); Fri, 17 Oct 2014 13:17:57 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:36359 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753356AbaJQRRz (ORCPT ); Fri, 17 Oct 2014 13:17:55 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s9HHHlOf028972; Fri, 17 Oct 2014 12:17:47 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9HHHl4D029333; Fri, 17 Oct 2014 12:17:47 -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.174.1; Fri, 17 Oct 2014 12:17:47 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9HHHkuC030910; Fri, 17 Oct 2014 12:17:47 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Greg KH , , Paul Zimmerman , , , , , , , Felipe Balbi Subject: [PATCH 20/67] usb: gadget: configfs: add suspend/resume Date: Fri, 17 Oct 2014 12:16:27 -0500 Message-ID: <1413566234-13537-21-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.1.0.GIT In-Reply-To: <1413566234-13537-1-git-send-email-balbi@ti.com> References: <1413566234-13537-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Andrzej Pietrasiewicz USB gadgets composed with configfs lack suspend and resume methods. This patch uses composite_suspend()/composite_resume() the same way e.g. composite_setup() or composite_disconnect() are used in a configfs-based gadget. Signed-off-by: Andrzej Pietrasiewicz Signed-off-by: Felipe Balbi --- drivers/usb/gadget/composite.c | 6 ++---- drivers/usb/gadget/configfs.c | 3 +++ include/linux/usb/composite.h | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index e071d58..6178353 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -2064,8 +2064,7 @@ fail: /*-------------------------------------------------------------------------*/ -static void -composite_suspend(struct usb_gadget *gadget) +void composite_suspend(struct usb_gadget *gadget) { struct usb_composite_dev *cdev = get_gadget_data(gadget); struct usb_function *f; @@ -2088,8 +2087,7 @@ composite_suspend(struct usb_gadget *gadget) usb_gadget_vbus_draw(gadget, 2); } -static void -composite_resume(struct usb_gadget *gadget) +void composite_resume(struct usb_gadget *gadget) { struct usb_composite_dev *cdev = get_gadget_data(gadget); struct usb_function *f; diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c index 3403433..d25f9f3 100644 --- a/drivers/usb/gadget/configfs.c +++ b/drivers/usb/gadget/configfs.c @@ -1453,6 +1453,9 @@ static const struct usb_gadget_driver configfs_driver_template = { .reset = composite_disconnect, .disconnect = composite_disconnect, + .suspend = composite_suspend, + .resume = composite_resume, + .max_speed = USB_SPEED_SUPER, .driver = { .owner = THIS_MODULE, diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index ed3811c..3d87def 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h @@ -506,6 +506,8 @@ extern int usb_string_ids_n(struct usb_composite_dev *c, unsigned n); extern void composite_disconnect(struct usb_gadget *gadget); extern int composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl); +extern void composite_suspend(struct usb_gadget *gadget); +extern void composite_resume(struct usb_gadget *gadget); /* * Some systems will need runtime overrides for the product identifiers