Commit 54eef8a4 authored by Murton Liu's avatar Murton Liu Committed by Alex Deucher

drm/amd/display: Change offset_to_id to reflect what id_to_offset returns

id_to_offset does not point to the same reg offset that offset_to_id checks for,
causing unintended asserts
Signed-off-by: default avatarMurton Liu <murton.liu@amd.com>
Reviewed-by: default avatarAric Cyr <Aric.Cyr@amd.com>
Acked-by: default avatarLeo Li <sunpeng.li@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 925f566c
......@@ -71,7 +71,7 @@ static bool offset_to_id(
{
switch (offset) {
/* GENERIC */
case REG(DC_GENERICA):
case REG(DC_GPIO_GENERIC_A):
*id = GPIO_ID_GENERIC;
switch (mask) {
case DC_GPIO_GENERIC_A__DC_GPIO_GENERICA_A_MASK:
......
......@@ -150,14 +150,10 @@ struct gpio *dal_gpio_service_create_generic_mux(
uint32_t en;
struct gpio *generic;
if (mask == 1)
en = GPIO_GENERIC_A;
else if (mask == 0x00000100L)
en = GPIO_GENERIC_B;
else
if (!service->translate.funcs->offset_to_id(offset, mask, &id, &en)) {
ASSERT_CRITICAL(false);
return NULL;
id = GPIO_ID_GENERIC;
}
generic = dal_gpio_create(
service, id, en, GPIO_PIN_OUTPUT_STATE_DEFAULT);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment