Hi Bryan_Zhong,
You could use https://github.com/NVIDIA/edk2/blob/main-edk2-stable202208/EmbeddedPkg/Include/Protocol/EmbeddedGpio.h protocol to read the status of a GPIO.
and the usage just like the example (https://github.com/NVIDIA/edk2-nvidia/blob/main/Silicon/NVIDIA/Drivers/TegraGpio/TegraGpioDxe.c).
You could also refer to https://github.com/NVIDIA/edk2-nvidia/blob/r35.3.1-updates/Silicon/NVIDIA/Application/GpioUtil/GpioUtil.c#L151 to see how we get the interface to embedded gpio protocol.
Same file then has the interface reference to function pointers for GPIO operations