[PATCH v7 2/9] drm/bridge: Implement generic USB Type-C DP HPD bridge
Chaoyi Chen
chaoyi.chen at rock-chips.com
Fri Oct 24 01:16:00 PDT 2025
On 10/24/2025 4:01 PM, Heikki Krogerus wrote:
> On Thu, Oct 23, 2025 at 11:30:02AM +0800, Chaoyi Chen wrote:
>> +static int drm_typec_bus_event(struct notifier_block *nb,
>> + unsigned long action, void *data)
>> +{
>> + struct typec_altmode *alt = (struct typec_altmode *)data;
>> +
>> + if (action != TYPEC_ALTMODE_REGISTERED)
>> + goto done;
>> +
>> + if (alt->svid != USB_TYPEC_DP_SID)
>> + goto done;
>> +
>> + /*
>> + * alt->dev.parent->parent : USB-C controller device
>> + * alt->dev.parent : USB-C connector device
>> + */
>> + drm_dp_hpd_bridge_register(alt->dev.parent->parent,
>> + to_of_node(alt->dev.parent->fwnode));
> Okay, this explains it. So you do need the port altmode.
>
> So you'll need to export the device types and check that the parent of
> the altmode is the port instead of partner.
>
> if (!is_typec_port(alt->dev.parent) || alt->svid != USB_TYPEC_DP_SID)
> return NOTIFY_DONE;
>
> I think we might as well export all the types while at it. Check the
> attachment.
Oh, I did miss the existence of partner. Thank you for your code!
>
> thanks,
>
--
Best,
Chaoyi
More information about the linux-phy
mailing list