CHROMIUM: mfd: chromeos_ec: update EC<->AP protocol
authorVincent Palatin <vpalatin@chromium.org>
Tue, 19 Feb 2013 23:09:13 +0000 (15:09 -0800)
committerChromeBot <chrome-bot@google.com>
Thu, 21 Feb 2013 20:49:05 +0000 (12:49 -0800)
Update the EC commands header with an up-to-date version including
the new pass-through commands.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17812 chrome-os-partner:17813
TEST=emerge-daisy_spring chromeos-kernel

Change-Id: Ic7f1d06bd2219f1314646ae6d803365b6e008ae6
Reviewed-on: https://gerrit.chromium.org/gerrit/43608
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
include/linux/mfd/chromeos_ec_commands.h

index 9dc5566..cd714cc 100644 (file)
@@ -1198,6 +1198,65 @@ struct ec_params_force_idle {
  */
 #define EC_CMD_BATTERY_CUT_OFF 0x99
 
+/*****************************************************************************/
+/* USB port mux control. */
+
+/*
+ * Switch USB mux or return to automatic switching.
+ */
+#define EC_CMD_USB_MUX 0x9a
+
+struct ec_params_usb_mux {
+       uint8_t mux;
+} __packed;
+
+/*****************************************************************************/
+/* LDOs / FETs control. */
+
+enum ec_ldo_state {
+       EC_LDO_STATE_OFF = 0,   /* the LDO / FET is shut down */
+       EC_LDO_STATE_ON = 1,    /* the LDO / FET is ON / providing power */
+};
+
+/*
+ * Switch on/off a LDO.
+ */
+#define EC_CMD_LDO_SET 0x9b
+
+struct ec_params_ldo_set {
+       uint8_t index;
+       uint8_t state;
+} __packed;
+
+/*
+ * Get LDO state.
+ */
+#define EC_CMD_LDO_GET 0x9c
+
+struct ec_params_ldo_get {
+       uint8_t index;
+} __packed;
+
+struct ec_response_ldo_get {
+       uint8_t state;
+} __packed;
+
+/*****************************************************************************/
+/* Power info. */
+
+/*
+ * Get power info.
+ */
+#define EC_CMD_POWER_INFO 0x9d
+
+struct ec_response_power_info {
+       uint32_t usb_dev_type;
+       uint16_t voltage_ac;
+       uint16_t voltage_system;
+       uint16_t current_system;
+       uint16_t usb_current_limit;
+} __packed;
+
 /*****************************************************************************/
 /* Temporary debug commands. TODO: remove this crosbug.com/p/13849 */
 
@@ -1217,6 +1276,41 @@ struct ec_params_current_limit {
        uint32_t limit;
 } __packed;
 
+/*****************************************************************************/
+/* Smart battery pass-through */
+
+/* Get / Set 16-bit smart battery registers */
+#define EC_CMD_SB_READ_WORD   0xb0
+#define EC_CMD_SB_WRITE_WORD  0xb1
+
+/* Get / Set string smart battery parameters
+ * formatted as SMBUS "block".
+ */
+#define EC_CMD_SB_READ_BLOCK  0xb2
+#define EC_CMD_SB_WRITE_BLOCK 0xb3
+
+struct ec_params_sb_rd {
+       uint8_t reg;
+} __packed;
+
+struct ec_response_sb_rd_word {
+       uint16_t value;
+} __packed;
+
+struct ec_params_sb_wr_word {
+       uint8_t reg;
+       uint16_t value;
+} __packed;
+
+struct ec_response_sb_rd_block {
+       uint8_t data[32];
+} __packed;
+
+struct ec_params_sb_wr_block {
+       uint8_t reg;
+       uint16_t data[32];
+} __packed;
+
 /*****************************************************************************/
 /* System commands */