diff --git a/sys/dev/drm/amd/display/dc/gpio/diagnostics/hw_translate_diag.c b/sys/dev/drm/amd/display/dc/gpio/diagnostics/hw_translate_diag.c index 000000000000..000000000000 100644 --- a/sys/dev/drm/amd/display/dc/gpio/diagnostics/hw_translate_diag.c +++ b/sys/dev/drm/amd/display/dc/gpio/diagnostics/hw_translate_diag.c @@ -30,12 +30,27 @@ #include "hw_translate_diag.h" +/* + * Stub translators: the FPGA MAXIMUS environment has no GPIO register + * translation. Returning false (instead of leaving NULL function pointers) + * makes dal_gpio_service_create_*() fail cleanly with ASSERT_CRITICAL / + * GPIO_RESULT_INVALID_DATA rather than calling through a NULL pointer. + */ +static bool offset_to_id( + uint32_t offset, + uint32_t mask, + enum gpio_id *id, + uint32_t *en) +{ + return false; +} + +static bool id_to_offset( + enum gpio_id id, + uint32_t en, + struct gpio_pin_info *info) +{ + return false; +} + /* function table */ static const struct hw_translate_funcs funcs = { - .offset_to_id = NULL, - .id_to_offset = NULL, + .offset_to_id = offset_to_id, + .id_to_offset = id_to_offset, }; void dal_hw_translate_diag_fpga_init(struct hw_translate *tr)