mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-08 16:41:55 +00:00
For better testability, let's move smart battery read/write functions to a stub so that we can easily mock them. BUG=chrome-os-partner:10270 TEST=build success Change-Id: I416580c6dc7911e376bc232e5f0560117d9353c2 Reviewed-on: https://gerrit.chromium.org/gerrit/26227 Reviewed-by: Rong Chang <rongchang@chromium.org> Commit-Ready: Vic Yang <victoryang@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org>
22 lines
681 B
C
22 lines
681 B
C
/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*
|
|
* Functions needed by smart battery driver.
|
|
*/
|
|
|
|
#include "smart_battery.h"
|
|
#include "i2c.h"
|
|
|
|
int sbc_read(int cmd, int *param)
|
|
{ return i2c_read16(I2C_PORT_CHARGER, CHARGER_ADDR, cmd, param); }
|
|
|
|
int sbc_write(int cmd, int param)
|
|
{ return i2c_write16(I2C_PORT_CHARGER, CHARGER_ADDR, cmd, param); }
|
|
|
|
int sb_read(int cmd, int *param)
|
|
{ return i2c_read16(I2C_PORT_BATTERY, BATTERY_ADDR, cmd, param); }
|
|
|
|
int sb_write(int cmd, int param)
|
|
{ return i2c_write16(I2C_PORT_BATTERY, BATTERY_ADDR, cmd, param); }
|