usb: typec: ucsi: Add polling mechanism for partner tasks like alt mode checking
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>
Mon, 20 Sep 2021 14:24:15 +0000 (17:24 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Oct 2021 10:42:37 +0000 (12:42 +0200)
commitb9aa02ca39a49740926c2c450a1505a4a0f8954a
treed37cfed37bdfe762b8f0d691f98e8d30968fa37a
parent47eb8de3bbde346b880bb65ef0abe907d7fd6438
usb: typec: ucsi: Add polling mechanism for partner tasks like alt mode checking

The "poll worker" that is introduced here is first used for
checking partner alternate modes, but it can later be used
for any partner task that requires a separate job to be
scheduled to the connector specific workqueues.

The mechanism allows the partner device specific tasks to be
polling tasks and also delayed tasks if necessary.

By polling the partner alternate modes with this mechanism
the long command completion timeout value can be reduced
back to normal. The long command completion timeout was only
used to work around a problem on some platforms where the EC
firmware (PPM) didn't return BUSY even when it should with
the alt mode commands.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20210920142419.54493-4-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/ucsi.c
drivers/usb/typec/ucsi/ucsi.h