init: detect charger mode