mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Enric Balletbo i Serra <enric.balletbo@collabora.com>
To: Olof Johansson <olof@lixom.net>,
	Benson Leung <bleung@chromium.org>,
	Lee Jones <lee.jones@linaro.org>
Cc: linux-kernel@vger.kernel.org, Nicolas Boichat <drinkcat@chromium.org>
Subject: [PATCH 02/13] mfd: cros_ec: Add EC console read structures definitions
Date: Fri, 17 Mar 2017 14:57:43 +0100	[thread overview]
Message-ID: <20170317135754.1684-3-enric.balletbo@collabora.com> (raw)
In-Reply-To: <20170317135754.1684-1-enric.balletbo@collabora.com>

From: Nicolas Boichat <drinkcat@chromium.org>

ec_params_console_read_v1 is used to capture EC logs from kernel,
and ec_params_get_cmd_versions_v1 is used to probe whether EC
supports that command.

Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
---
 include/linux/mfd/cros_ec_commands.h | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/include/linux/mfd/cros_ec_commands.h b/include/linux/mfd/cros_ec_commands.h
index f1ef638..3497e1a 100644
--- a/include/linux/mfd/cros_ec_commands.h
+++ b/include/linux/mfd/cros_ec_commands.h
@@ -625,6 +625,10 @@ struct ec_params_get_cmd_versions {
 	uint8_t cmd;      /* Command to check */
 } __packed;
 
+struct ec_params_get_cmd_versions_v1 {
+	uint16_t cmd;     /* Command to check */
+} __packed;
+
 struct ec_response_get_cmd_versions {
 	/*
 	 * Mask of supported versions; use EC_VER_MASK() to compare with a
@@ -2281,13 +2285,28 @@ struct ec_params_charge_control {
 #define EC_CMD_CONSOLE_SNAPSHOT 0x97
 
 /*
- * Read next chunk of data from saved snapshot.
+ * Read data from the saved snapshot. If the subcmd parameter is
+ * CONSOLE_READ_NEXT, this will return data starting from the beginning of
+ * the latest snapshot. If it is CONSOLE_READ_RECENT, it will start from the
+ * end of the previous snapshot.
+ *
+ * The params are only looked at in version >= 1 of this command. Prior
+ * versions will just default to CONSOLE_READ_NEXT behavior.
  *
  * Response is null-terminated string.  Empty string, if there is no more
  * remaining output.
  */
 #define EC_CMD_CONSOLE_READ 0x98
 
+enum ec_console_read_subcmd {
+	CONSOLE_READ_NEXT = 0,
+	CONSOLE_READ_RECENT
+};
+
+struct ec_params_console_read_v1 {
+	uint8_t subcmd; /* enum ec_console_read_subcmd */
+} __packed;
+
 /*****************************************************************************/
 
 /*
-- 
2.9.3

  parent reply	other threads:[~2017-03-17 13:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-17 13:57 [PATCH 00/13] platform/chrome: Add console debugfs, lpc and lightbar programming support Enric Balletbo i Serra
2017-03-17 13:57 ` [PATCH 01/13] mfd: cros_ec: Add helper for event notifier Enric Balletbo i Serra
2017-03-17 13:57 ` Enric Balletbo i Serra [this message]
2017-03-17 13:57 ` [PATCH 03/13] mfd: cros_ec: add debugfs, console log file Enric Balletbo i Serra
2017-03-17 13:57 ` [PATCH 04/13] mfd: cros_ec: Add support for dumping panic information Enric Balletbo i Serra
2017-03-17 13:57 ` [PATCH 05/13] platform/chrome: cros_ec_lpc: Add R/W helpers to LPC protocol variants Enric Balletbo i Serra
2017-03-23 11:51   ` Lee Jones
2017-03-17 13:57 ` [PATCH 06/13] platform/chrome: cros_ec_lpc: Add support for mec1322 EC Enric Balletbo i Serra
2017-03-23 11:50   ` Lee Jones
2017-03-17 13:57 ` [PATCH 07/13] platform/chrome: cros_ec_lpc: Add support for GOOG004 ACPI device Enric Balletbo i Serra
2017-03-17 13:57 ` [PATCH 08/13] platform/chrome: cros_ec_lpc: Add power management ops Enric Balletbo i Serra
2017-03-17 13:57 ` [PATCH 09/13] platform/chrome: cros_ec_lpc: Add MKBP events support over ACPI Enric Balletbo i Serra
2017-03-17 13:57 ` [PATCH 10/13] platform/chrome: cros_ec_lightbar - Add lightbar program feature to sysfs Enric Balletbo i Serra
2017-03-17 13:57 ` [PATCH 11/13] platform/chrome: cros_ec_lightbar - Control of suspend/resume lightbar sequence Enric Balletbo i Serra
2017-03-17 13:57 ` [PATCH 12/13] platform/chrome: cros_ec_lightbar - Add userspace lightbar control bit to EC Enric Balletbo i Serra
2017-03-17 13:57 ` [PATCH 13/13] platform/chrome: cros_ec_lightbar - Avoid I2C xfer to EC during suspend Enric Balletbo i Serra

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=20170317135754.1684-3-enric.balletbo@collabora.com \
    --to=enric.balletbo@collabora.com \
    --cc=bleung@chromium.org \
    --cc=drinkcat@chromium.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olof@lixom.net \
    /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

all inboxes | Powered by JetHome®