Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1563324yba; Thu, 4 Apr 2019 13:23:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2GmnMtz2nvqGCYHoE4ch9Rx2rApNjLPWH5E6zH2tjCmqTRl7eBoushI6AZaHz+27ZEL2z X-Received: by 2002:aa7:8b0c:: with SMTP id f12mr7981351pfd.154.1554409383172; Thu, 04 Apr 2019 13:23:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554409383; cv=none; d=google.com; s=arc-20160816; b=j/nsspbv6Grqw9JLod+atDmq/7sMDTu/dyGXsuXtmnUNYaOQodZxakYIz398FyLfo3 SISLZ7pTkxiOBYpksLwlabNb7AKJxaYz7uiUF/P5ZuJMGkqMAUf/I1eHddAMk/CkHPFE CP5Zi0PG1ywu9clo9tNmynNwv/3a43FQyZrPTFR0HKsB2JS2GWM408NaxwYd4r5nO0ga Teiyqq7/jNjSgFsZn87BqJTqlX9Mpk8TBBeFKcEcLE4lm1SPR8ygAtXGh9IVUJeH/ivN 37Q0P/18clbg6wn129QDm3gQXAST/WXOpT/C9kZo2ydPYA+YkmMC6fLOHci0GRih40FW oAZg== 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=PNrm5ZvqyIO3flw+yxvvQFZ3RopGnN4GuMnZWR2rV0s=; b=uyi7yFkcH4255qmhZZn78JhteFIKshMrSMECh+zwh5qlcuWac2HlE+pm/MtC19Si7k +V/YahwqbiOXstADYQ0xaqO7iI7WCXMDAZ0adsfKcV4BFYJXFm+8A4HOAMaBXjZRa6/i e6pcvhQ2OwOcZm3B3gQqDYEwJMnCNo+8DCDiIZQqbivbmdP2Il4bR3A1dy/oFCX8Jf1E HPUy4ADHedWUdhR+s/vMvb27YQ0cUSu1etcR4o08Xan+m0AmDfOfZQZHe86SVoMyxvPI eIOhQTvKtOBrzj2CaaPC49OfRmPohNfn4zkT23nML25Mgk/EMNO/5fQWFIEVID+6hAMa vcdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=NDCdyVGU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1si17911182pla.243.2019.04.04.13.22.47; Thu, 04 Apr 2019 13:23:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=NDCdyVGU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729871AbfDDSj3 (ORCPT + 99 others); Thu, 4 Apr 2019 14:39:29 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:37640 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728699AbfDDSj3 (ORCPT ); Thu, 4 Apr 2019 14:39:29 -0400 Received: by mail-lj1-f196.google.com with SMTP id v13so3006236ljk.4 for ; Thu, 04 Apr 2019 11:39:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PNrm5ZvqyIO3flw+yxvvQFZ3RopGnN4GuMnZWR2rV0s=; b=NDCdyVGUuwAxZjc8gSl3az2JsLdZZsIyynbtjdeXuTJ/uqAT+dRbNUPw05TPHfUiTH c+V2Tighxy2lY3djJfjzdMPlrOkKkhiQxkKv2p2pzx6cmH0HbKbqqLQm9znPNqf54AXd Btsbd6dkUjclOl0X3HjwEuSHmi8Cs9fWmvkWtuw04dNkVvoYPt2/GPROJa2NuzynCzNX D064hpAID8kk+WgodY/BZ9Y8Gkuobro/AB6sPI5l+FRekx0HXzgH0MPDtUaHr7jGS/Qe MOF/QBwqWGSJxLAm4QJYK69ut0kqwwmm3J8ow5RbO54HaWhaLdoN/ztgT0C3WQSD0uZP I8rw== 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=PNrm5ZvqyIO3flw+yxvvQFZ3RopGnN4GuMnZWR2rV0s=; b=KoFoVvF6as3RFG7/mZ7zuI6wM3GRBT4M/ohdbRNV3tOFNf3SzclXLy6pafl+EOz/5x jfjbQeFVKhZM5d52HPCJa+FVCk+QqFegAmCpMZq+bsUcD/OjAJDIxo6Vrn65QtWcHF4j vTHTlWu9RiE+ANmyegGTBKUCiKnTAfHUAu5qC6xZbT0FMAngM038OvmH2GrTZWjykSOi XeQ9B5smmDwPHZecffTsUBxZVrFIstXq+s6F8Ix3eXTX/ukiIaRzPfx+nwAg/eJJn6ke UEbd9ndLyX/7yIkyN5nko7zJ/OsNJxAPgfvNuu67/qiW7tFGoIWCZlorSKxAGdgV7TBT OemQ== X-Gm-Message-State: APjAAAVbtTZcUZYk3LRdUDKTrjAgzOKs2VWT9u6pb/Ppt5Qp91NKi9k5 n7pV/4ie3Nma6A7EAbUz0tkGDv8DS0eZ3bsUS/rhaQ== X-Received: by 2002:a2e:6a14:: with SMTP id f20mr4543410ljc.65.1554403166808; Thu, 04 Apr 2019 11:39:26 -0700 (PDT) MIME-Version: 1.0 References: <20190403213428.89920-1-evgreen@chromium.org> <20190403213428.89920-2-evgreen@chromium.org> In-Reply-To: <20190403213428.89920-2-evgreen@chromium.org> From: Rajat Jain Date: Thu, 4 Apr 2019 11:38:50 -0700 Message-ID: Subject: Re: [PATCH v3 1/2] mfd: cros_ec: Add host_sleep_event_v1 command To: Evan Green Cc: Benson Leung , Enric Balletbo i Serra , Furquan Shaikh , Rajat Jain , Linux Kernel Mailing List , Guenter Roeck , Lee Jones 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 On Wed, Apr 3, 2019 at 2:34 PM Evan Green wrote: > > Introduce the command and response structures for the second revision > of the host sleep event. These structures are part of a new EC change > that enables detection of failure to enter S0ix. The EC waits a > kernel-specified timeout (or a default amount of time) for the S0_SLP > pin to change, and wakes the system if that change does not occur in > time. > > Signed-off-by: Evan Green Reviewed-by: Rajat Jain > > --- > > Changes in v3: None > Changes in v2: > - Made unions anonymous > - Replaced reserved union members with a comment > > include/linux/mfd/cros_ec_commands.h | 57 ++++++++++++++++++++++++++++ > 1 file changed, 57 insertions(+) > > diff --git a/include/linux/mfd/cros_ec_commands.h b/include/linux/mfd/cros_ec_commands.h > index fc91082d4c35..1cdb07c0ece1 100644 > --- a/include/linux/mfd/cros_ec_commands.h > +++ b/include/linux/mfd/cros_ec_commands.h > @@ -2729,6 +2729,63 @@ struct ec_params_host_sleep_event { > uint8_t sleep_event; > } __packed; > > +/* > + * Use a default timeout value (CONFIG_SLEEP_TIMEOUT_MS) for detecting sleep > + * transition failures > + */ > +#define EC_HOST_SLEEP_TIMEOUT_DEFAULT 0 > + > +/* Disable timeout detection for this sleep transition */ > +#define EC_HOST_SLEEP_TIMEOUT_INFINITE 0xFFFF > + > +struct ec_params_host_sleep_event_v1 { > + /* The type of sleep being entered or exited. */ > + uint8_t sleep_event; > + > + /* Padding */ > + uint8_t reserved; > + union { > + /* Parameters that apply for suspend messages. */ > + struct { > + /* > + * The timeout in milliseconds between when this message > + * is received and when the EC will declare sleep > + * transition failure if the sleep signal is not > + * asserted. > + */ > + uint16_t sleep_timeout_ms; > + } suspend_params; > + > + /* No parameters for non-suspend messages. */ > + }; > +} __packed; > + > +/* A timeout occurred when this bit is set */ > +#define EC_HOST_RESUME_SLEEP_TIMEOUT 0x80000000 > + > +/* > + * The mask defining which bits correspond to the number of sleep transitions, > + * as well as the maximum number of suspend line transitions that will be > + * reported back to the host. > + */ > +#define EC_HOST_RESUME_SLEEP_TRANSITIONS_MASK 0x7FFFFFFF > + > +struct ec_response_host_sleep_event_v1 { > + union { > + /* Response fields that apply for resume messages. */ > + struct { > + /* > + * The number of sleep power signal transitions that > + * occurred since the suspend message. The high bit > + * indicates a timeout occurred. > + */ > + uint32_t sleep_transitions; > + } resume_response; > + > + /* No response fields for non-resume messages. */ > + }; > +} __packed; > + > /*****************************************************************************/ > /* Smart battery pass-through */ > > -- > 2.20.1 >