summaryrefslogtreecommitdiff
path: root/driver/charger/bq24735.h
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2020-01-14 14:18:08 -0700
committerCommit Bot <commit-bot@chromium.org>2020-01-28 20:22:22 +0000
commit4eb3a5fe699247a5767ae38c66c75872f4afc575 (patch)
tree81787f2f54ff3470ce326047213abfae234b50a1 /driver/charger/bq24735.h
parentd9a869beb6e1778cec38dcce64f289aba353a8d5 (diff)
downloadchrome-ec-4eb3a5fe699247a5767ae38c66c75872f4afc575.tar.gz
Charger: Create charger driver structure
With upcoming boards which use multiple charger chips, the EC codebase needs to be changed to assume chargers may have different I2C ports. This commit creates the driver structure and wrapper functions, which for now are hard-coded to chip 0 for equivalent behavior with previous code. A general charger config is created for all boards in charger.c for now, which uses the build information to fill in the structure. All boards will default to defining CONFIG_CHARGER_SINGLE_CHIP, which in turn defines a CHARGER_SOLO which can be used by drivers which have code that needs to determine charger numbers. For boards which have multiple chips, they may undefine this config and should generate build errors if their driver is still using the hardcoded charger reference of CHARGER_SOLO. Older drivers may continue using CHARGER_SOLO in non-static functions until they're needed in a multiple charger board. For boards which may be supporting different I2C configurations for the charger over board versions, they may define CONFIG_CHARGER_RUNTIME_CONFIG to fill in these fields after boot. BRANCH=none BUG=b:147672225 TEST=builds, chargers on hatch and octopus work Change-Id: I390ede494226252e512595c48099fa1288ffe93e Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2008451 Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'driver/charger/bq24735.h')
0 files changed, 0 insertions, 0 deletions