chromeec: Add battery status event and re-enable _BIX
Add a new host event to send a notify(0x80) to the battery when the EC indicates that battery status has changed. The kernel has fixed the bug with _BIX method so it can be enabled now. BUG=chrome-os-partner:32196 BRANCH=samus TEST=build and boot on samus Change-Id: I1b8068df7abf1c8ebdc3a89602896b863accb7f3 Signed-off-by: Stefan Reinauer <reinauer@chromium.org> Original-Commit-Id: a779fc7f32729adb60d8bc220325444ebc20e0d2 Original-Change-Id: I0ebb17e5441e875875d98168ce3c31486d57330e Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/220320 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/9212 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
parent
e383feb7c8
commit
d840118ef5
|
@ -126,9 +126,7 @@ Device (BAT0)
|
||||||
Return (PBIF)
|
Return (PBIF)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extended Battery info method is disabled for now due to
|
Method (_BIX, 0, Serialized)
|
||||||
// a bug in the Linux kernel: http://crosbug.com/28747
|
|
||||||
Method (XBIX, 0, Serialized)
|
|
||||||
{
|
{
|
||||||
// Last Full Charge Capacity
|
// Last Full Charge Capacity
|
||||||
Store (BTDF, Index (PBIX, 3))
|
Store (BTDF, Index (PBIX, 3))
|
||||||
|
|
|
@ -312,6 +312,13 @@ Device (EC0)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Battery Status
|
||||||
|
Method (_Q17, 0, NotSerialized)
|
||||||
|
{
|
||||||
|
Store ("EC: BATTERY STATUS", Debug)
|
||||||
|
Notify (BAT0, 0x80)
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Dynamic Platform Thermal Framework support
|
* Dynamic Platform Thermal Framework support
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -275,6 +275,9 @@ enum host_event_code {
|
||||||
/* PD MCU triggering host event */
|
/* PD MCU triggering host event */
|
||||||
EC_HOST_EVENT_PD_MCU = 22,
|
EC_HOST_EVENT_PD_MCU = 22,
|
||||||
|
|
||||||
|
/* Battery Status flags have changed */
|
||||||
|
EC_HOST_EVENT_BATTERY_STATUS = 23,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The high bit of the event mask is not used as a host event code. If
|
* The high bit of the event mask is not used as a host event code. If
|
||||||
* it reads back as set, then the entire event mask should be
|
* it reads back as set, then the entire event mask should be
|
||||||
|
@ -1032,6 +1035,13 @@ struct lightbar_params_v1 {
|
||||||
struct rgb_s color[8]; /* 0-3 are Google colors */
|
struct rgb_s color[8]; /* 0-3 are Google colors */
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
|
/* Lightbyte program. */
|
||||||
|
#define LB_PROG_LEN 192
|
||||||
|
struct lb_program {
|
||||||
|
uint8_t size;
|
||||||
|
uint8_t data[LB_PROG_LEN];
|
||||||
|
};
|
||||||
|
|
||||||
struct ec_params_lightbar {
|
struct ec_params_lightbar {
|
||||||
uint8_t cmd; /* Command (see enum lightbar_command) */
|
uint8_t cmd; /* Command (see enum lightbar_command) */
|
||||||
union {
|
union {
|
||||||
|
@ -1058,6 +1068,7 @@ struct ec_params_lightbar {
|
||||||
|
|
||||||
struct lightbar_params_v0 set_params_v0;
|
struct lightbar_params_v0 set_params_v0;
|
||||||
struct lightbar_params_v1 set_params_v1;
|
struct lightbar_params_v1 set_params_v1;
|
||||||
|
struct lb_program set_program;
|
||||||
};
|
};
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
|
@ -1090,7 +1101,8 @@ struct ec_response_lightbar {
|
||||||
struct {
|
struct {
|
||||||
/* no return params */
|
/* no return params */
|
||||||
} off, on, init, set_brightness, seq, reg, set_rgb,
|
} off, on, init, set_brightness, seq, reg, set_rgb,
|
||||||
demo, set_params_v0, set_params_v1;
|
demo, set_params_v0, set_params_v1,
|
||||||
|
set_program;
|
||||||
};
|
};
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
|
@ -1114,6 +1126,7 @@ enum lightbar_command {
|
||||||
LIGHTBAR_CMD_GET_DEMO = 15,
|
LIGHTBAR_CMD_GET_DEMO = 15,
|
||||||
LIGHTBAR_CMD_GET_PARAMS_V1 = 16,
|
LIGHTBAR_CMD_GET_PARAMS_V1 = 16,
|
||||||
LIGHTBAR_CMD_SET_PARAMS_V1 = 17,
|
LIGHTBAR_CMD_SET_PARAMS_V1 = 17,
|
||||||
|
LIGHTBAR_CMD_SET_PROGRAM = 18,
|
||||||
LIGHTBAR_NUM_CMDS
|
LIGHTBAR_NUM_CMDS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue