servod: allow pin based config generation for sweetberry android adapter

This CL refactors how the generation is done, and converts it into two
steps of lookup. First, given the connector (j connector, or android)
the sense channel is identified. This is one out of 1-48. Using that
sense channel, the i2c information for that channel is read out. This
replaces some of the previous math for readability by having larger,
static lookup tables. Only for the j-banks some math is still used, as
they have the same pin logic each, just at an offset i.e. j3's pins all
at a fixed offset of the same j2's pin's sense channel.

TEST=manual testing verifying that the old outputs are the same
sudo emerge hdctools -j32
cp /usr/lib64/python2.7/site-packages/servo/data/atlas_rev3.xml
git revert HEAD
sudo emerge hdctools -j32
diff /usr/lib64/python2.7/site-packages/servo/data/atlas_rev3.xml

Change-Id: I20bea4ed931105cecbba835377d436b60e3d3f5a
Signed-off-by: Ruben Rodriguez Buchillon <>
Commit-Ready: ChromeOS CL Exonerator Bot <>
3 files changed