]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: typec: maxim_contaminant: re-enable cc toggle if cc is open and port is clean
authorAmit Sunil Dhamne <amitsd@google.com>
Sun, 24 Aug 2025 16:49:53 +0000 (12:49 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:28:47 +0000 (16:28 +0200)
commitf56e75b85b54dd460d5e4923831aa0ef55394d0c
tree8d0fc139bd2bd7c6398695d808f244988951b337
parente600de541c37f97482fea2a7a26f186141e7ddea
usb: typec: maxim_contaminant: re-enable cc toggle if cc is open and port is clean

[ Upstream commit a381c6d6f646226924809d0ad01a9465786da463 ]

Presently in `max_contaminant_is_contaminant()` if there's no
contaminant detected previously, CC is open & stopped toggling and no
contaminant is currently present, TCPC.RC would be programmed to do DRP
toggling. However, it didn't actively look for a connection. This would
lead to Type-C not detect *any* new connections. Hence, in the above
situation, re-enable toggling & program TCPC to look for a new
connection.

Also, return early if TCPC was looking for connection as this indicates
TCPC has neither detected a potential connection nor a change in
contaminant state.

In addition, once dry detection is complete (port is dry), restart
toggling.

Fixes: 02b332a06397e ("usb: typec: maxim_contaminant: Implement check_contaminant callback")
Cc: stable <stable@kernel.org>
Signed-off-by: Amit Sunil Dhamne <amitsd@google.com>
Reviewed-by: Badhri Jagan Sridharan <badhri@google.com>
Link: https://lore.kernel.org/r/20250815-fix-upstream-contaminant-v2-2-6c8d6c3adafb@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/maxim_contaminant.c