usb: typec: ucsi: Check the partner alt modes always if there is PD contract
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>
Mon, 20 Sep 2021 14:24:17 +0000 (17:24 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Oct 2021 10:42:38 +0000 (12:42 +0200)
commit6cbe4b2d5a3f290fba764e722b19cb55968a84d2
tree40c6b7b6d32a84ab7c6db5a227f6dff7eba0d8d9
parente08065069fc7b074712378a95a3522d557e9bbe1
usb: typec: ucsi: Check the partner alt modes always if there is PD contract

UCSI does not tell the driver explicitly when the firmware
(PPM in UCSI lingo) has actually detected the partner
alternate modes, there is no specific change event for that.
That's why they have to be checked with any notification
that informs that PD contract with that partner has been
achieved.

Previously the alternate modes were checked always when the
firmware (PPM) informed that something with the partner had
changed, but on some platforms the EC firmware does not
generate separate events for generic partner changes at all.
On those platforms the EC firmware notifies the driver only
about connections, or separately about the PD contract if it
was not achieved soon enough after the initial connection
event.

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