]> git.baikalelectronics.ru Git - kernel.git/commit
power: supply: sbs-battery: simplify read_read_string_data
authorSebastian Reichel <sebastian.reichel@collabora.com>
Wed, 13 May 2020 18:56:03 +0000 (20:56 +0200)
committerSebastian Reichel <sre@kernel.org>
Thu, 28 May 2020 22:39:12 +0000 (00:39 +0200)
commit47279e0c1dbc20f9981c992eeb483c72ba147aa2
tree54910fad04ddaf449a400d25fd5a2f03da92d03e
parent90549fe34902022775807ad9996bc18402242d66
power: supply: sbs-battery: simplify read_read_string_data

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).

This change requires, that I2C bus drivers support I2C_M_RECV_LEN
or directly provide the SMBus API to access device manufacturer
and model name.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/sbs-battery.c