usb: ucsi_acpi: Quirk to ack a connector change ack cmd
authorChristian A. Ehrhardt <lk@c--e.de>
Sun, 21 Jan 2024 20:41:23 +0000 (21:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jan 2024 01:41:58 +0000 (17:41 -0800)
commitf3be347ea42dbb0358cd8b2d8dc543a23b70a976
treed701943dd3d05ed65d9cdd17bd218613631da0e6
parent2840143e393a4ddc1caab4372969ea337371168c
usb: ucsi_acpi: Quirk to ack a connector change ack cmd

The PPM on some Dell laptops seems to expect that the ACK_CC_CI
command to clear the connector change notification is in turn
followed by another ACK_CC_CI to acknowledge the ACK_CC_CI command
itself. This is in violation of the UCSI spec that states:

    "The only notification that is not acknowledged by the OPM is
     the command completion notification for the ACK_CC_CI or the
     PPM_RESET command."

Add a quirk to send this ack anyway.
Apply the quirk to all Dell systems.

On the first command that acks a connector change send a dummy
command to determine if it runs into a timeout. Only activate
the quirk if it does. This ensure that we do not break Dell
systems that do not need the quirk.

Signed-off-by: "Christian A. Ehrhardt" <lk@c--e.de>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240121204123.275441-4-lk@c--e.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/ucsi_acpi.c