extcon: intel-cht-wc: Enable external charger
authorYauhen Kharuzhy <jekhor@gmail.com>
Sun, 3 Mar 2019 20:16:13 +0000 (23:16 +0300)
committerChanwoo Choi <cw00.choi@samsung.com>
Fri, 5 Apr 2019 01:21:41 +0000 (10:21 +0900)
commita72a1be0de71b3bdab3d8b2e708267f32ea33ee2
treea3db62d00170ffa816290bd9704322ccfea79086
parent3137301b6d970219706d887eb6bdcabbf54f1f3b
extcon: intel-cht-wc: Enable external charger

In some configuration external charger "#charge enable" signal is
connected to PMIC. Enable it at device probing to allow charging.

Save CHGRCTRL0 and CHGDISCTR registers at driver probing and restore
them at driver unbind to re-enable hardware charging control if it was
enabled before.

Tested at Lenovo Yoga Book (YB1-X91L).

Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/extcon/extcon-intel-cht-wc.c