Mathew King has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/42017 )
Change subject: ec/google/wilco: Always use current value of battery status bit ......................................................................
ec/google/wilco: Always use current value of battery status bit
According to the Wilco EC spec the BTSC bit of PWSR is always cleared when PWSR is read so that battery status change events are only triggered one time. Testing of the Wilco EC has verified this behavior. This changes the way in which the battery status change bit is used from checking the bit state against the prevous value to always issuing a battery event when the BTSC bit is set. The other bits in PWSR indicate state directly and do not behave like the BTSC bit.
BUG=b:157113138 TEST=Deploy on Drallion and verify that battery events are generated BRANCH=drallion, sarien
Signed-off-by: Mathew King mathewk@chromium.org Change-Id: I8fbf2ee1158ddd790b04a20b1eb27a6cce4f5c81 --- M src/ec/google/wilco/acpi/event.asl 1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/42017/1
diff --git a/src/ec/google/wilco/acpi/event.asl b/src/ec/google/wilco/acpi/event.asl index a98344d..bf4bb19 100644 --- a/src/ec/google/wilco/acpi/event.asl +++ b/src/ec/google/wilco/acpi/event.asl @@ -25,7 +25,11 @@ } }
- If (EBIT (BTSC, Local1)) { + /* + * Battery status is cleared when read so always use the value from + * PWSR directly regardless of the previous value stored in ECPR. + */ + If (EBIT (BTSC, Local0)) { Printf ("BAT0 Status Change") Notify (BAT0, 0x80) }
Mathew King has uploaded a new patch set (#2). ( https://review.coreboot.org/c/coreboot/+/42017 )
Change subject: ec/google/wilco: Always use current value of battery status bit ......................................................................
ec/google/wilco: Always use current value of battery status bit
According to the Wilco EC spec the BTSC bit of PWSR is always cleared when PWSR is read so that battery status change events are only triggered one time. Testing of the Wilco EC has verified this behavior. This changes the way in which the battery status change bit is used from checking the bit state against the previous value to always issuing a battery event when the BTSC bit is set. The other bits in PWSR indicate state directly and do not behave like the BTSC bit.
BUG=b:157113138 TEST=Deploy on Drallion and verify that battery events are generated BRANCH=drallion, sarien
Signed-off-by: Mathew King mathewk@chromium.org Change-Id: I8fbf2ee1158ddd790b04a20b1eb27a6cce4f5c81 --- M src/ec/google/wilco/acpi/event.asl 1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/42017/2
Duncan Laurie has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42017 )
Change subject: ec/google/wilco: Always use current value of battery status bit ......................................................................
Patch Set 2: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/42017 )
Change subject: ec/google/wilco: Always use current value of battery status bit ......................................................................
ec/google/wilco: Always use current value of battery status bit
According to the Wilco EC spec the BTSC bit of PWSR is always cleared when PWSR is read so that battery status change events are only triggered one time. Testing of the Wilco EC has verified this behavior. This changes the way in which the battery status change bit is used from checking the bit state against the previous value to always issuing a battery event when the BTSC bit is set. The other bits in PWSR indicate state directly and do not behave like the BTSC bit.
BUG=b:157113138 TEST=Deploy on Drallion and verify that battery events are generated BRANCH=drallion, sarien
Signed-off-by: Mathew King mathewk@chromium.org Change-Id: I8fbf2ee1158ddd790b04a20b1eb27a6cce4f5c81 Reviewed-on: https://review.coreboot.org/c/coreboot/+/42017 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Duncan Laurie dlaurie@chromium.org --- M src/ec/google/wilco/acpi/event.asl 1 file changed, 5 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Duncan Laurie: Looks good to me, approved
diff --git a/src/ec/google/wilco/acpi/event.asl b/src/ec/google/wilco/acpi/event.asl index a98344d..bf4bb19 100644 --- a/src/ec/google/wilco/acpi/event.asl +++ b/src/ec/google/wilco/acpi/event.asl @@ -25,7 +25,11 @@ } }
- If (EBIT (BTSC, Local1)) { + /* + * Battery status is cleared when read so always use the value from + * PWSR directly regardless of the previous value stored in ECPR. + */ + If (EBIT (BTSC, Local0)) { Printf ("BAT0 Status Change") Notify (BAT0, 0x80) }