Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3060746ybt; Mon, 29 Jun 2020 14:14:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNA+yfRh1f2IjcQ5HJNApexJY55cuOJ5Z23fVjAPmcuLcZR9voRT1odvkIf6tnntl6YTLx X-Received: by 2002:a17:906:1e95:: with SMTP id e21mr16309965ejj.240.1593465262804; Mon, 29 Jun 2020 14:14:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593465262; cv=none; d=google.com; s=arc-20160816; b=NppdlP7iiVWu3FcpGozmccHkKrbMmZH2AWuchhnSN+caeQvFaoAZBbn0kITzvoBMUs fNaBKjDIvQ1tOrNwD5+6IC4VUm/CYU6sWVcLkenOkakjP10Evk6NEVIP+4HsZn7L+8lw Xb4i9VO45ooFMx6xMsygBaeRu+ju+2yzGPULYaVTr1jM1cU7qAVHWFmtCov42a71SAUF y6RM6V0o7y28s76yXLDtvK1qEJGY9E0Ah6JKYwjHglqK8nuIISreOPrZrQ7xTCuIvS5m a8kT8qzxunKZvFdbSJYTx1t/y1/lh9oBuwkIaX5215dWKmRpXAehfhyEqdDlOcyQyfT6 Rd7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=eAEmaN/NdVFefXDM6LfGtyV/V/D8hHRz0d76RasnyHc=; b=pBm/J+XMs6M2jQM7VgsLGxnpEiCmBF8w6vdKSxqZ1mdjfJRg0FpZxQaiuc0oi4lnNf kqAmgMuDvOnS2aoStWaAUv8M+qPiZLBGmglhtcNh01CmU61w/nAOC9ahehE+oH1+axzG tBVBuPfyxhp7mlPFrMhnxfd8evQ6hiVDHrcg3EanvqLVaPxPvi9jLxSR/LnWmCuI0zDD Q7o1dqKZJWlmHKc8PUZ9IksnKTfNc3eKfrS+HKxOZXaQAIiQKfQMNLz84G19IAnFLxlJ qqrjjnCTqF0y9ehSM64XzLpOhIPn91LUjToOvCi4T+VFV2xXRBmxCsMcA18idSANzBrD c53g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aUVNgh6t; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s24si421898ejd.737.2020.06.29.14.13.59; Mon, 29 Jun 2020 14:14:22 -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=@chromium.org header.s=google header.b=aUVNgh6t; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388131AbgF2VMh (ORCPT + 99 others); Mon, 29 Jun 2020 17:12:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730149AbgF2S5o (ORCPT ); Mon, 29 Jun 2020 14:57:44 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36F3DC030F1B for ; Mon, 29 Jun 2020 09:29:43 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id x62so13302281qtd.3 for ; Mon, 29 Jun 2020 09:29:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eAEmaN/NdVFefXDM6LfGtyV/V/D8hHRz0d76RasnyHc=; b=aUVNgh6tt8rsssN1Zw55aKmbKP1FBMvcU6Li23i8y2DGTLDckWw/CTpboiYvWDGDFE U1DxleAoFoNnmxvS84E+CNSUXnw9SzDbuEdu9Uk3O23rG09zQF/yAlaCZhvHE5XyPq+k z7z9o8GsnZKiEPRibPmxlmSJv9GgZciUoiK08= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eAEmaN/NdVFefXDM6LfGtyV/V/D8hHRz0d76RasnyHc=; b=eSV+i2bG/Pz0nqBdvSPWRYo71Y9P1ampP/QP8G16XJFD2a9+dDRVKEmv5/9zblF9ke DfNcJkRivtYy4Ncnt58EnWeik+VNNBUlXx3Md49sxOp+IGWbJtq9Vsh289dvsu8S/pBE rESeJsh666Y7NKQlw66ZI5EGwQN1rbiU92I/Ap+kbK3FhbNtjrEmAVhKyttf/jLt/lOp xZwmMM4+gGVBiezEgRYMN0sYZMwH3Ri1Ka5UX9vtop2W8HdJxgMap7ig/kW3kxsMrNh6 VLzv6blEA0sStgF6D/DcIVsDghmut1gp1vdxBxJ40ORSL3S9RuyOPUnPgJweOtX5JaEh v+7A== X-Gm-Message-State: AOAM531DFj9uS+UCf/uY+byqdlnGq92CfJxWhr0nBoOJakFKSgunKzv2 UtbOBMhrKYsTOLfgx71SPrxvIvfQRVMrYUxAMoldGQ== X-Received: by 2002:ac8:1991:: with SMTP id u17mr15942854qtj.93.1593448182155; Mon, 29 Jun 2020 09:29:42 -0700 (PDT) MIME-Version: 1.0 References: <20200629161333.2110327-1-pmalani@chromium.org> <20200629161333.2110327-2-pmalani@chromium.org> In-Reply-To: From: Prashant Malani Date: Mon, 29 Jun 2020 09:29:30 -0700 Message-ID: Subject: Re: [PATCH v2 2/2] platform/chrome: cros_ec_typec: Add PM support To: Guenter Roeck Cc: linux-kernel , Heikki Krogerus , Benson Leung , Enric Balletbo i Serra , Guenter Roeck Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Guenter, Thanks for reviewing the patch. On Mon, Jun 29, 2020 at 9:25 AM Guenter Roeck wrote: > > On Mon, Jun 29, 2020 at 9:13 AM Prashant Malani wrote: > > > > Define basic suspend resume functions for cros-ec-typec. On suspend, we > > simply ensure that any pending port update work is completed, and on > > resume, we re-poll the port state to account for any > > changes/disconnections that might have occurred during suspend. > > > > Signed-off-by: Prashant Malani > > --- > > > > Changes in v2: > > - Remove #ifdef-ery, add __maybe_unused tag to functions. > > > > drivers/platform/chrome/cros_ec_typec.c | 26 +++++++++++++++++++++++++ > > 1 file changed, 26 insertions(+) > > > > diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c > > index 630170fb2cbe..b2e7e928e788 100644 > > --- a/drivers/platform/chrome/cros_ec_typec.c > > +++ b/drivers/platform/chrome/cros_ec_typec.c > > @@ -725,11 +725,37 @@ static int cros_typec_probe(struct platform_device *pdev) > > return ret; > > } > > > > +static int __maybe_unused cros_typec_suspend(struct device *dev) > > +{ > > + struct cros_typec_data *typec = dev_get_drvdata(dev); > > + > > + cancel_work_sync(&typec->port_work); > > + > > + return 0; > > +} > > + > > +static int __maybe_unused cros_typec_resume(struct device *dev) > > +{ > > + struct cros_typec_data *typec = dev_get_drvdata(dev); > > + > > + /* Refresh port state. */ > > + schedule_work(&typec->port_work); > > + > > + return 0; > > +} > > + > > +static const struct dev_pm_ops cros_typec_pm_ops = { > > + SET_SYSTEM_SLEEP_PM_OPS(cros_typec_suspend, cros_typec_resume) > > +}; > > + > > +#define DEV_PM_OPS (&cros_typec_pm_ops) > > I don't think this define adds any value. Right. Sorry, got sloppy here. Will push another patchset. Thanks for catching this. Best regards, > > > + > > static struct platform_driver cros_typec_driver = { > > .driver = { > > .name = DRV_NAME, > > .acpi_match_table = ACPI_PTR(cros_typec_acpi_id), > > .of_match_table = of_match_ptr(cros_typec_of_match), > > + .pm = DEV_PM_OPS, > > }, > > .probe = cros_typec_probe, > > }; > > -- > > 2.27.0.212.ge8ba1cc988-goog > >