linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <groeck@google.com>
To: Evan Green <evgreen@chromium.org>
Cc: Benson Leung <bleung@chromium.org>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	Furquan Shaikh <furquan@chromium.org>,
	Rajat Jain <rajatja@chromium.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Guenter Roeck <groeck@chromium.org>,
	Lee Jones <lee.jones@linaro.org>
Subject: Re: [PATCH v3 1/2] mfd: cros_ec: Add host_sleep_event_v1 command
Date: Thu, 4 Apr 2019 07:42:21 -0700	[thread overview]
Message-ID: <CABXOdTdgcyhb+K6tW=yQx9R6c38u7aTyWR1OpM0N7EHX6GcW2Q@mail.gmail.com> (raw)
In-Reply-To: <20190403213428.89920-2-evgreen@chromium.org>

On Wed, Apr 3, 2019 at 2:34 PM Evan Green <evgreen@chromium.org> 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 <evgreen@chromium.org>
>

Reviewed-by: Guenter Roeck <groeck@chromium.org>

> ---
>
> 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
>

  parent reply	other threads:[~2019-04-04 14:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-03 21:34 [PATCH v3 0/2] platform/chrome: Add support for host sleep event command v1 Evan Green
2019-04-03 21:34 ` [PATCH v3 1/2] mfd: cros_ec: Add host_sleep_event_v1 command Evan Green
2019-04-04  8:23   ` Lee Jones
2019-04-04 14:42   ` Guenter Roeck [this message]
2019-04-04 18:38   ` Rajat Jain
2019-04-05  9:54     ` Enric Balletbo Serra
2019-05-08  7:10   ` Lee Jones
2019-04-03 21:34 ` [PATCH v3 2/2] platform/chrome: Add support for v1 of host sleep event Evan Green
2019-04-04  8:26   ` Lee Jones
2019-04-04 14:43   ` Guenter Roeck
2019-04-04 18:38   ` Rajat Jain
2019-04-05  9:57     ` Enric Balletbo Serra
2019-05-08  7:10   ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABXOdTdgcyhb+K6tW=yQx9R6c38u7aTyWR1OpM0N7EHX6GcW2Q@mail.gmail.com' \
    --to=groeck@google.com \
    --cc=bleung@chromium.org \
    --cc=enric.balletbo@collabora.com \
    --cc=evgreen@chromium.org \
    --cc=furquan@chromium.org \
    --cc=groeck@chromium.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rajatja@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).