SM5803: Share setting of FLOW_REG1 between tasks better
SM5803: Share setting of FLOW_REG1 between tasks better

Both the OTG and charger driver set_mode functions in the sm5803 driver
could clear the CHG_EN bit.  This change will only clear CHG_EN from a
specific call to inhibit charging, and otherwise operations will only
modify the bits they strictly need to modify.

Also added a mutex to indicate FLOW_REG1 is being changed since it can
be changed from both the charger and PD tasks.

BRANCH=None
BUG=b:153906171
TEST=on waddledee, able to source out of both ports and seeing somewhat
reduced boot looping without a battery

Signed-off-by: Diana Z <cb2016afc7183e5356c690dc63b4ba817470501a@chromium.org>
Change-Id: I52339548edb5eafc7605f435c8da17364d1fc48e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2157950
Reviewed-by: Aseda Aboagye <12c9b286316a940fd31c24070da5ab64cdd4d0e7@chromium.org>

coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec