phy: rockchip-typec: Do the calibration more correctly
authorDouglas Anderson <dianders@chromium.org>
Fri, 22 Sep 2017 16:44:06 +0000 (09:44 -0700)
committerKishon Vijay Abraham I <kishon@ti.com>
Mon, 23 Oct 2017 05:49:25 +0000 (11:19 +0530)
commite023b1fb5286e23c224f2ae312831a4fce258c02
tree3fba297ce3665b81492c93b9b2c17e6f35a510ff
parentf85fd4c909565892a49337ef482090e446c4e5bd
phy: rockchip-typec: Do the calibration more correctly

Calculate the calibration code as per the docs.  The docs talk about
reading and averaging the pullup and pulldown calibration codes.  They
also talk about adding in some adjustment codes.  Let's do what the
docs say.

In practice this doesn't seem to matter a whole lot.  On a device I
tested the pullup and pulldown codes were nearly the same (0x23 and
0x24) and the adjustment codes were 0.

Reviewed-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/rockchip/phy-rockchip-typec.c