/* * Copyright 2022 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Authors: AMD *
*/
/* FILE POLICY AND INTENDED USAGE: * * This file implements functions that manage basic HPD components such as gpio. * It also provides wrapper functions to execute HPD related programming. This * file only manages basic HPD functionality. It doesn't manage detection or * feature or signal specific HPD behaviors.
*/ #include"link_hpd.h" #include"gpio_service_interface.h"
bool link_get_hpd_state(struct dc_link *link)
{
uint32_t state = 0;
if (hpd) { switch (dal_irq_get_source(hpd)) { case DC_IRQ_SOURCE_HPD1:
hpd_id = HPD_SOURCEID1; break; case DC_IRQ_SOURCE_HPD2:
hpd_id = HPD_SOURCEID2; break; case DC_IRQ_SOURCE_HPD3:
hpd_id = HPD_SOURCEID3; break; case DC_IRQ_SOURCE_HPD4:
hpd_id = HPD_SOURCEID4; break; case DC_IRQ_SOURCE_HPD5:
hpd_id = HPD_SOURCEID5; break; case DC_IRQ_SOURCE_HPD6:
hpd_id = HPD_SOURCEID6; break; default:
BREAK_TO_DEBUGGER(); break;
}
dal_gpio_destroy_irq(&hpd);
}
return hpd_id;
}
bool program_hpd_filter(conststruct dc_link *link)
{ bool result = false; struct gpio *hpd; int delay_on_connect_in_ms = 0; int delay_on_disconnect_in_ms = 0;
if (link->is_hpd_filter_disabled) returnfalse; /* Verify feature is supported */ switch (link->connector_signal) { case SIGNAL_TYPE_DVI_SINGLE_LINK: case SIGNAL_TYPE_DVI_DUAL_LINK: case SIGNAL_TYPE_HDMI_TYPE_A: /* Program hpd filter */
delay_on_connect_in_ms = 500;
delay_on_disconnect_in_ms = 100; break; case SIGNAL_TYPE_DISPLAY_PORT: case SIGNAL_TYPE_DISPLAY_PORT_MST: /* Program hpd filter to allow DP signal to settle */ /* 500: not able to detect MST <-> SST switch as HPD is low for * only 100ms on DELL U2413 * 0: some passive dongle still show aux mode instead of i2c * 20-50: not enough to hide bouncing HPD with passive dongle. * also see intermittent i2c read issues.
*/
delay_on_connect_in_ms = 80;
delay_on_disconnect_in_ms = 0; break; case SIGNAL_TYPE_LVDS: case SIGNAL_TYPE_EDP: default: /* Don't program hpd filter */ returnfalse;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.