display: [REVERTME] add access count for AVDD gpio pin for DV20
BZ: 32593
[WORKAROUND]: The I2C bus of LVDS panel is shared with other devices, such as
dsi-lvds bridge and pn544, if we turn off panel power through GPIO, then it
will pull voltage of i2c down to 1v, and if there's other device's transition
on this bus at this time, then it will be unstable, and unrecoverable. experiments
show that, if we don't turn off LVDS panel power rail in early suspend, then I2C
error will be disappear.
This workaround uses access count to control VADD gpio pin. when one device
uses i2c device, increase the count, after that decrease it. and if LVDS panel
is powered on, increase it, once powered off, decrease it. if the count reaches 0,
pull down the gpio pin, otherwise pull it high. Thus it can make sure when
there's transition on the i2c bus, VADD keeps on.
Change-Id: Ide625a1ee3de544ba9ee0a71d005b22d20af4307
Signed-off-by: Geng Xiujun <xiujun.geng@intel.com>
Reviewed-on: http://android.intel.com:8080/47423
Reviewed-by: Xu, Randy <randy.xu@intel.com>
Reviewed-by: Ai, Ke <ke.ai@intel.com>
Reviewed-by: Zhang, Lei <lei.zhang@intel.com>
Reviewed-by: Yang, Bin <bin.yang@intel.com>
Reviewed-by: Hogander, Jouni <jouni.hogander@intel.com>
Tested-by: Tong, BoX <box.tong@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>