ec: virtual battery: cache more attributes |
|||
Issue descriptionKernel 4.4 host is now asking for SB reg 03h, 0Fh, etc. Let's cache these attributes as well.
,
Dec 14 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/ec/+/4912f214aabf4c9ba231329df0d3583c5ddea9d6 commit 4912f214aabf4c9ba231329df0d3583c5ddea9d6 Author: philipchen <philipchen@google.com> Date: Sun Nov 06 00:08:15 2016 i2c_passthru: fix virtual battery operation In some cases, the virtual battery code creates transactions that violate SB spec. One example: If the host command is structured as two messages - a write to 0x03 (reg addr), followed by two bytes of write data, the first byte of the second message (write data) will be sent to virtual_battery_read(), as if it were a reg read request. Let's do the following change for virtual battery: 1. Parse the command more carefully with state machines. 2. Support write caching for some critical registers. 3. Cache more attributes (0x03 and 0x0f). BUG=chrome-os-partner:59239, chromium:659819 BRANCH=none TEST='power_supply_info' works on kevin Change-Id: Icdeb12b21f0dc3c329f29b206b7b9395ca4c9998 Reviewed-on: https://chromium-review.googlesource.com/407987 Commit-Ready: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org> [add] https://crrev.com/4912f214aabf4c9ba231329df0d3583c5ddea9d6/common/virtual_battery.c [modify] https://crrev.com/4912f214aabf4c9ba231329df0d3583c5ddea9d6/common/charge_state_v2.c [modify] https://crrev.com/4912f214aabf4c9ba231329df0d3583c5ddea9d6/common/build.mk [add] https://crrev.com/4912f214aabf4c9ba231329df0d3583c5ddea9d6/include/virtual_battery.h [modify] https://crrev.com/4912f214aabf4c9ba231329df0d3583c5ddea9d6/common/i2c.c [modify] https://crrev.com/4912f214aabf4c9ba231329df0d3583c5ddea9d6/include/charge_state_v2.h
,
Dec 14 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/ec/+/3c854599f57c8b57116e035f1af7f30967e66517 commit 3c854599f57c8b57116e035f1af7f30967e66517 Author: philipchen <philipchen@google.com> Date: Sun Nov 06 00:08:15 2016 i2c_passthru: fix virtual battery operation In some cases, the virtual battery code creates transactions that violate SB spec. One example: If the host command is structured as two messages - a write to 0x03 (reg addr), followed by two bytes of write data, the first byte of the second message (write data) will be sent to virtual_battery_read(), as if it were a reg read request. Let's do the following change for virtual battery: 1. Parse the command more carefully with state machines. 2. Support write caching for some critical registers. 3. Cache more attributes (0x03 and 0x0f). BUG=chrome-os-partner:59239, chromium:659819 BRANCH=none TEST='power_supply_info' works on kevin Change-Id: Icdeb12b21f0dc3c329f29b206b7b9395ca4c9998 Reviewed-on: https://chromium-review.googlesource.com/407987 Commit-Ready: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org> (cherry picked from commit 4912f214aabf4c9ba231329df0d3583c5ddea9d6) Reviewed-on: https://chromium-review.googlesource.com/419804 Commit-Queue: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> [add] https://crrev.com/3c854599f57c8b57116e035f1af7f30967e66517/common/virtual_battery.c [modify] https://crrev.com/3c854599f57c8b57116e035f1af7f30967e66517/common/charge_state_v2.c [modify] https://crrev.com/3c854599f57c8b57116e035f1af7f30967e66517/common/build.mk [add] https://crrev.com/3c854599f57c8b57116e035f1af7f30967e66517/include/virtual_battery.h [modify] https://crrev.com/3c854599f57c8b57116e035f1af7f30967e66517/common/i2c.c [modify] https://crrev.com/3c854599f57c8b57116e035f1af7f30967e66517/include/charge_state_v2.h
,
Dec 15 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/ec/+/00f7fc9f5f9503617f6dc7eb26bfab051a905973 commit 00f7fc9f5f9503617f6dc7eb26bfab051a905973 Author: Philip Chen <philipchen@google.com> Date: Thu Dec 15 06:32:57 2016 virtual_battery: fix the build error It builds successfully on ToT, but not on firmware-gru-8785.B. Let's fix it. BUG=chrome-os-partner:59239, chromium:659819 BRANCH=none TEST=build gru and kevin Change-Id: Ib788c2e999959dc25db3babe7e3fa0ef7dbd6906 Reviewed-on: https://chromium-review.googlesource.com/420448 Reviewed-by: Philip Chen <philipchen@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> [modify] https://crrev.com/00f7fc9f5f9503617f6dc7eb26bfab051a905973/common/virtual_battery.c
,
Dec 16 2016
|
|||
►
Sign in to add a comment |
|||
Comment 1 by philipchen@chromium.org
, Dec 1 2016Status: Started (was: Untriaged)