usb: typec: ucsi: Wait for the USB role switches
authorLinyu Yuan <quic_linyyuan@quicinc.com>
Mon, 25 Apr 2022 10:18:06 +0000 (18:18 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Apr 2022 11:44:57 +0000 (13:44 +0200)
commit3c162511530c234f95091bdc7225f641e5f35090
tree0adc6a5118c4780ab259b3ad13c921c327a54b27
parent87d0e2f41b8cc2018499be4e8003fa8c09b6f2fb
usb: typec: ucsi: Wait for the USB role switches

When role switch module probe late than ucsi module,
fwnode_usb_role_switch_get() will return -EPROBE_DEFER,
it is better to restart ucsi init work to find
it again every 100ms, total wait time is 10 second.

It also means change ucsi init work to delayed_work.

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
Link: https://lore.kernel.org/r/1650881886-25530-3-git-send-email-quic_linyyuan@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/ucsi.c
drivers/usb/typec/ucsi/ucsi.h