include/gpio: skip everything but soc/gpio.h include in ASM & ACPI cases

When gpio.h gets directly or indirectly included in the DSDT ar an
assembly file, everything but the preprocessor defines for the GPIOs
shouldn't be included to keep IASL or the assembler happy.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I046ed87d3947ba5b1fcd0bdd4cffcda57bc13404
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70509
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/include/gpio.h b/src/include/gpio.h
index db8776a..daf6029 100644
--- a/src/include/gpio.h
+++ b/src/include/gpio.h
@@ -4,6 +4,9 @@
 #define __SRC_INCLUDE_GPIO_H__
 
 #include <soc/gpio.h> /* IWYU pragma: export */
+
+#ifndef __ASSEMBLER__ /* __ASSEMBLER__ also covers __ACPI__ case */
+
 #include <types.h>
 
 /* <soc/gpio.h> must typedef a gpio_t that fits in 32 bits. */
@@ -96,4 +99,6 @@
 	return _gpio_base3_value(gpio, num_gpio, 1);
 }
 
+#endif /* !__ASSEMBLER__ */
+
 #endif /* __SRC_INCLUDE_GPIO_H__ */