mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 20:10:23 +09:00
BACKPORT: FROMGIT: usb: typec: altmodes/displayport: Signal hpd when configuring pin assignment
When connecting to some DisplayPort partners, the initial status update after entering DisplayPort Alt Mode notifies that the DFP_D/UFP_D is not in the connected state. This leads to sending a configure message that keeps the device in USB mode. The port partner then sets DFP_D/UFP_D to the connected state and HPD to high in the same Attention message. Currently, the HPD signal is dropped in order to handle configuration. This patch saves changes to the HPD signal when the device chooses to configure during dp_altmode_status_update, and invokes sysfs_notify if necessary for HPD after configuring. Fixes:0e3bb7d689("usb: typec: Add driver for DisplayPort alternate mode") Cc: stable@vger.kernel.org Signed-off-by: RD Babiera <rdbabiera@google.com> Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/all/20230726020903.1409072-1-rdbabiera@google.com/ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 288137625 (cherry picked from commit5a5ccd61cfhttps://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-linus) [rd: resolved minor conflict in displayport.c] Change-Id: I26ef49949aa0681ea6b88d8c95f5ddd54fe84664 Signed-off-by: RD Babiera <rdbabiera@google.com>
This commit is contained in:
committed by
Treehugger Robot
parent
ee1147625d
commit
056a17677d
@@ -58,6 +58,7 @@ struct dp_altmode {
|
||||
|
||||
enum dp_state state;
|
||||
bool hpd;
|
||||
bool pending_hpd;
|
||||
|
||||
struct mutex lock; /* device lock */
|
||||
struct work_struct work;
|
||||
@@ -141,8 +142,13 @@ static int dp_altmode_status_update(struct dp_altmode *dp)
|
||||
dp->state = DP_STATE_EXIT;
|
||||
} else if (!(con & DP_CONF_CURRENTLY(dp->data.conf))) {
|
||||
ret = dp_altmode_configure(dp, con);
|
||||
if (!ret)
|
||||
if (!ret) {
|
||||
dp->state = DP_STATE_CONFIGURE;
|
||||
if (dp->hpd != hpd) {
|
||||
dp->hpd = hpd;
|
||||
dp->pending_hpd = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (dp->hpd != hpd) {
|
||||
dp->hpd = hpd;
|
||||
@@ -157,6 +163,15 @@ static int dp_altmode_configured(struct dp_altmode *dp)
|
||||
{
|
||||
sysfs_notify(&dp->alt->dev.kobj, "displayport", "configuration");
|
||||
sysfs_notify(&dp->alt->dev.kobj, "displayport", "pin_assignment");
|
||||
/*
|
||||
* If the DFP_D/UFP_D sends a change in HPD when first notifying the
|
||||
* DisplayPort driver that it is connected, then we wait until
|
||||
* configuration is complete to signal HPD.
|
||||
*/
|
||||
if (dp->pending_hpd) {
|
||||
sysfs_notify(&dp->alt->dev.kobj, "displayport", "hpd");
|
||||
dp->pending_hpd = false;
|
||||
}
|
||||
|
||||
return dp_altmode_notify(dp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user