From: Alex Crawford Date: Sat, 25 Sep 2021 15:52:50 +0000 (-0700) Subject: drivers/linuxgpiod: add support for opendrain trst X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=6fef2eca381ddcda593aca27290706873a9bcde2;p=fw%2Fopenocd drivers/linuxgpiod: add support for opendrain trst This is a follow-up to 2f424b7eb, which added support for opendrain srst, finishing up support for opendrain reset signals. Signed-off-by: Alex Crawford Change-Id: Ib79b2e12f2a9469fd6c53bb839c0d2e8e46103a4 Reviewed-on: https://review.openocd.org/c/openocd/+/6598 Tested-by: jenkins Reviewed-by: Antonio Borneo --- diff --git a/src/jtag/drivers/linuxgpiod.c b/src/jtag/drivers/linuxgpiod.c index dd50b4406..75f6152be 100644 --- a/src/jtag/drivers/linuxgpiod.c +++ b/src/jtag/drivers/linuxgpiod.c @@ -360,7 +360,11 @@ static int linuxgpiod_init(void) goto out_error; if (is_gpio_valid(trst_gpio)) { - gpiod_trst = helper_get_output_line("trst", trst_gpio, 1); + if (jtag_get_reset_config() & RESET_TRST_OPEN_DRAIN) + gpiod_trst = helper_get_open_drain_output_line("trst", trst_gpio, 1); + else + gpiod_trst = helper_get_output_line("trst", trst_gpio, 1); + if (!gpiod_trst) goto out_error; }