diff --git a/meta-oe/recipes-devtools/openocd/openocd_git.bb b/meta-oe/recipes-devtools/openocd/openocd_git.bb
index 559fe29ff..8c411ec5c 100644
--- a/meta-oe/recipes-devtools/openocd/openocd_git.bb
+++ b/meta-oe/recipes-devtools/openocd/openocd_git.bb
@@ -51,6 +51,9 @@ FILES:${PN} = " \
   ${bindir}/openocd \
   "
 
+# To build with linuxgpiod it requires libgpiod 1.x.
+# Add PREFERRED_VERSION_libgpiod = "1.%" to local.conf
+PACKAGECONFIG[linuxgpiod] = "--enable-linuxgpiod,--disable-linuxgpiod, libgpiod"
 PACKAGECONFIG[sysfsgpio] = "--enable-sysfsgpio,--disable-sysfsgpio"
 PACKAGECONFIG[remote-bitbang] = "--enable-remote-bitbang,--disable-remote-bitbang"
 PACKAGECONFIG ??= "sysfsgpio remote-bitbang"
