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: Murton Liu <murton.liu@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Murton Liu 2019-07-02 11:32:19 -04:00 committed by Alex Deucher
parent 925f566cb7
commit 54eef8a411
2 changed files with 4 additions and 8 deletions

View File

@ -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:

View File

@ -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);