• Sebastian Reichel's avatar
    power: supply: sbs-battery: use i2c_smbus_read_block_data() · 05e04309
    Sebastian Reichel authored
    The SBS battery implements SMBus block reads. Currently the
    driver "emulates" this by doing an I2C byte read for the
    length followed by an I2C block read. The I2C subsystem
    actually provides a proper API for doing SMBus block reads,
    which can and should be used instead. The current implementation
    does not properly handle packet error checking (PEC).
    
    Not all upstream systems using sbs-battery have I2C bus drivers
    supporting I2C_M_RECV_LEN, so old implementation is kept as
    fallback to keep things working. But this prints a warning,
    which hopefully results in people implementing support for it.
    Tested-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
    Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
    05e04309
sbs-battery.c 30.1 KB