summaryrefslogtreecommitdiff
path: root/common/i2c_bitbang.c
Commit message (Collapse)AuthorAgeFilesLines
* i2c_bitbang: save stack space by removing printfTing Shen2021-02-051-10/+9
| | | | | | | | | | | | | | | | | | | | According to stack analyzer, cprintf takes 232 byte stack size. Replace cprintf by cputs on critical paths to save space. After this change, the CHARGER task on juniper takes 200 bytes less (1048 -> 848). BUG=b:179451031 TEST=cherry-pick this CL to kukui branch, run `make analyzestack` BRANCH=kukui Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Ie23820fd4836877d912d6af583e13d43d990f9ee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2677842 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* COIL: Rename non-inclusive wordingDossym Nurmukhanov2021-01-111-16/+17
| | | | | | | | | | | | | | Use controller/peripheral nomenclature. BUG=none BRANCH=none TEST=Build a device that uses i2c_bitbang (e.g. jacuzzi) Signed-off-by: dossym@chromium.org Change-Id: I597e1bf2f86ca93fe8b2230d603345033f43ed96 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2619071 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* i2c: add support for i2c bit-bangingTing Shen2019-12-161-0/+363
Krane/Jacuzzi need a 100KHz SMBus port for battery, in addition to the existing two i2c ports. This CL adds a bit-bang driver that supports i2c/smbus bit-banging through a set of pre-defined gpio pins. BUG=b:138161741,b:138415463 TEST=On a reworked jacuzzi (battery i2c connected to other gpios), 1) `battery` shows reasonable output (this verifies i2c_readN, i2c_read_string) 2) `i2cscan` works for port 3 (bitbang port) 3) `cutoff` (verifies i2c_writeN) 4) `i2ctest` stress test BRANCH=master Change-Id: I78020e5c51707c3d9f0fd54f2c299e2f29cabe2f Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1765110 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>