Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2110525ybz; Thu, 23 Apr 2020 11:46:27 -0700 (PDT) X-Google-Smtp-Source: APiQypIciD6azuwPYlUWGEiSxndJB0+eVUCw4ous6lP9e3rczzO1i8ZDmFgWzsg1enLJzxoDawJH X-Received: by 2002:a17:906:2511:: with SMTP id i17mr4040899ejb.165.1587667587501; Thu, 23 Apr 2020 11:46:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587667587; cv=none; d=google.com; s=arc-20160816; b=to8laS/ukRsgLKSpV0NoYDBd18ucGlt/JPWmesRgX81y/bZA/VQP6fuSXtwozAa25B u4Yp3ADh2xlpvyvhwKBsV/apWWVzux7RVZrIx2vwzgPEHgzrFGqeV7fc5W8a3vlo5uZG XA152Yg+JLdr1jZKUxLJKQ1uGPzxCEWJwL9GZ1laKeHzlNdai7hDSuv5kplGYub/Iv8g 0eeyUaR0PR21Fgbq8DPXZuJsUbYiPptvqOORRxL3MUgrvr4KkLUayHnKyk1smkwKZaoY 9ZJuA1OVHH9h1y4DNQLbOobAyGlFFL6cOWCVg8baJi6Z0578C/kn0Goas1/T0MxRl058 Pcaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=XOcOfmk0mzp2LNDxp8A7DBUhCmQQA1WzS4pxBJFuT4I=; b=eCeTt3kvKKeJno5IZDkmeyB1Ak7ADIuFBi4Q+lONqI4A9f/apv38awmJFNnEbfQftA B6pT8vUZVL/8JF5IYYpmjdcgWdfEUKuXaSJubOfuU6te7Kbi/Nx3lGtRPgP9IdZ8CaM5 bp28bgjiOzEB3sqW7knZWZbctC5YkTDzs/GI+iNbJIjmZbuPHvDcn/HZ+ptX8AEiqzfv 473wVq42ZqRsN3ipQSyHbSRJXzHgipHHWRdwstAOHr1Cx4V3X64s6/Pl84TwtkGHK0Zb ocMXCqJcSHXEipG7wW+u9inAfEtlIiAoA8tJI3D82gaRHLsK0E1Rml17eqB0QI+qAuUY BUHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=xhTn1DqC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x22si1745243eju.478.2020.04.23.11.46.03; Thu, 23 Apr 2020 11:46:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=xhTn1DqC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728271AbgDWL4k (ORCPT + 99 others); Thu, 23 Apr 2020 07:56:40 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:35754 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728224AbgDWL40 (ORCPT ); Thu, 23 Apr 2020 07:56:26 -0400 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03NBqKO8011770; Thu, 23 Apr 2020 13:56:19 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=XOcOfmk0mzp2LNDxp8A7DBUhCmQQA1WzS4pxBJFuT4I=; b=xhTn1DqCTNiB6MC3QSOhHXOHl+6uENMYp+BHRabyiljbI1s9yITrmlCkfO2Bt7zZ/d5k KBsbFDgMWOgpVHkdbI1EWEYYvm6A/d3Po2R64rk3q3QLStmGITOkNwCC5pTUe3e+RsbO 2x4Eu5cS4AcLh6RRdHBnOZ5k+xsi6psipKmKgBzLH7820fc4RodphPMwVpi0lR8MAOC9 dS0jOus+tNZEJSAvsm31ctnXePrkFqkssyVScpgYlvMZjB2Vm83seuXs7rr/n31sKjMl SuHMi21UKK81EVxB7qtxQcmY2kMdS8emGdeCj8FTfRpOj2aSSxaxY3gN6+M3ismhhMTg 9g== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 30fq11vjj7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Apr 2020 13:56:19 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4029C10002A; Thu, 23 Apr 2020 13:56:19 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag5node3.st.com [10.75.127.15]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 371C72B8A00; Thu, 23 Apr 2020 13:56:19 +0200 (CEST) Received: from localhost (10.75.127.45) by SFHDAG5NODE3.st.com (10.75.127.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 23 Apr 2020 13:56:18 +0200 From: Fabrice Gasnier To: , , CC: , , , , Subject: [PATCH v2 4/4] usb: gadget: f_acm: add suspend resume callbacks Date: Thu, 23 Apr 2020 13:55:56 +0200 Message-ID: <1587642956-8157-5-git-send-email-fabrice.gasnier@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1587642956-8157-1-git-send-email-fabrice.gasnier@st.com> References: <1587642956-8157-1-git-send-email-fabrice.gasnier@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.45] X-ClientProxiedBy: SFHDAG2NODE2.st.com (10.75.127.5) To SFHDAG5NODE3.st.com (10.75.127.15) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-04-23_07:2020-04-22,2020-04-23 signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add suspend resume callbacks to notify u_serial of the bus suspend/resume state. Signed-off-by: Fabrice Gasnier --- drivers/usb/gadget/function/f_acm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/usb/gadget/function/f_acm.c b/drivers/usb/gadget/function/f_acm.c index 7c152c2..200596e 100644 --- a/drivers/usb/gadget/function/f_acm.c +++ b/drivers/usb/gadget/function/f_acm.c @@ -723,6 +723,20 @@ static void acm_free_func(struct usb_function *f) kfree(acm); } +static void acm_resume(struct usb_function *f) +{ + struct f_acm *acm = func_to_acm(f); + + gserial_resume(&acm->port); +} + +static void acm_suspend(struct usb_function *f) +{ + struct f_acm *acm = func_to_acm(f); + + gserial_suspend(&acm->port); +} + static struct usb_function *acm_alloc_func(struct usb_function_instance *fi) { struct f_serial_opts *opts; @@ -750,6 +764,8 @@ static struct usb_function *acm_alloc_func(struct usb_function_instance *fi) acm->port_num = opts->port_num; acm->port.func.unbind = acm_unbind; acm->port.func.free_func = acm_free_func; + acm->port.func.resume = acm_resume; + acm->port.func.suspend = acm_suspend; return &acm->port.func; } -- 2.7.4