[coreboot-gerrit] Change in coreboot[master]: acpi_device: Refine ACPI_IRQ_* macros

Furquan Shaikh (Code Review) gerrit at coreboot.org
Fri Oct 19 04:19:46 CEST 2018


Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/29187


Change subject: acpi_device: Refine ACPI_IRQ_* macros
......................................................................

acpi_device: Refine ACPI_IRQ_* macros

This change does the following:
1. Adds a helper macro ACPI_IRQ_CFG that can be used by all other
ACPI_IRQ* macros to initialize acpi_irq structure.

2. Provides ACPI_IRQ_WAKE* versions to allow board to define an irq as
wake capable.

BUG=b:117553222

Change-Id: Ic53c6019527bbd270806897247f547178cd1ad3c
Signed-off-by: Furquan Shaikh <furquan at google.com>
---
M src/arch/x86/include/arch/acpi_device.h
1 file changed, 35 insertions(+), 24 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/87/29187/1

diff --git a/src/arch/x86/include/arch/acpi_device.h b/src/arch/x86/include/arch/acpi_device.h
index 2711af5..25dfef0 100644
--- a/src/arch/x86/include/arch/acpi_device.h
+++ b/src/arch/x86/include/arch/acpi_device.h
@@ -101,33 +101,44 @@
 	enum acpi_irq_wake wake;
 };
 
-#define ACPI_IRQ_EDGE_LOW(x) { \
-	.pin = (x), \
-	.mode = ACPI_IRQ_EDGE_TRIGGERED, \
-	.polarity = ACPI_IRQ_ACTIVE_LOW, \
-	.shared = ACPI_IRQ_EXCLUSIVE, \
-	.wake = ACPI_IRQ_NO_WAKE }
+#define ACPI_IRQ_CFG(_pin, _mode, _pol, _shared, _wake) { \
+	.pin = (_pin),						\
+	.mode = _mode,						\
+	.polarity = _pol,					\
+	.shared = _shared,					\
+	.wake = _wake }
 
-#define ACPI_IRQ_EDGE_HIGH(x) { \
-	.pin = (x), \
-	.mode = ACPI_IRQ_EDGE_TRIGGERED, \
-	.polarity = ACPI_IRQ_ACTIVE_HIGH, \
-	.shared = ACPI_IRQ_EXCLUSIVE, \
-	.wake = ACPI_IRQ_NO_WAKE }
+#define ACPI_IRQ_EDGE_LOW(x)	\
+	ACPI_IRQ_CFG((x), ACPI_IRQ_EDGE_TRIGGERED, ACPI_IRQ_ACTIVE_LOW, \
+		     ACPI_IRQ_EXCLUSIVE, ACPI_IRQ_NO_WAKE)
 
-#define ACPI_IRQ_LEVEL_LOW(x) { \
-	.pin = (x), \
-	.mode = ACPI_IRQ_LEVEL_TRIGGERED, \
-	.polarity = ACPI_IRQ_ACTIVE_LOW, \
-	.shared = ACPI_IRQ_SHARED, \
-	.wake = ACPI_IRQ_NO_WAKE }
+#define ACPI_IRQ_EDGE_HIGH(x)	\
+	ACPI_IRQ_CFG((x), ACPI_IRQ_EDGE_TRIGGERED, ACPI_IRQ_ACTIVE_HIGH, \
+		     ACPI_IRQ_EXCLUSIVE, ACPI_IRQ_NO_WAKE)
 
-#define ACPI_IRQ_LEVEL_HIGH(x) { \
-	.pin = (x), \
-	.mode = ACPI_IRQ_LEVEL_TRIGGERED, \
-	.polarity = ACPI_IRQ_ACTIVE_HIGH, \
-	.shared = ACPI_IRQ_SHARED, \
-	.wake = ACPI_IRQ_NO_WAKE }
+#define ACPI_IRQ_LEVEL_LOW(x)	\
+	ACPI_IRQ_CFG((x), ACPI_IRQ_LEVEL_TRIGGERED, ACPI_IRQ_ACTIVE_LOW, \
+		     ACPI_IRQ_SHARED, ACPI_IRQ_NO_WAKE)
+
+#define ACPI_IRQ_LEVEL_HIGH(x)	\
+	ACPI_IRQ_CFG((x), ACPI_IRQ_LEVEL_TRIGGERED, ACPI_IRQ_ACTIVE_HIGH, \
+		     ACPI_IRQ_SHARED, ACPI_IRQ_NO_WAKE)
+
+#define ACPI_IRQ_WAKE_EDGE_LOW(x)	\
+	ACPI_IRQ_CFG((x), ACPI_IRQ_EDGE_TRIGGERED, ACPI_IRQ_ACTIVE_LOW, \
+		     ACPI_IRQ_EXCLUSIVE, ACPI_IRQ_WAKE)
+
+#define ACPI_IRQ_WAKE_EDGE_HIGH(x)	\
+	ACPI_IRQ_CFG((x), ACPI_IRQ_EDGE_TRIGGERED, ACPI_IRQ_ACTIVE_HIGH, \
+		     ACPI_IRQ_EXCLUSIVE, ACPI_IRQ_WAKE)
+
+#define ACPI_IRQ_WAKE_LEVEL_LOW(x)	\
+	ACPI_IRQ_CFG((x), ACPI_IRQ_LEVEL_TRIGGERED, ACPI_IRQ_ACTIVE_LOW, \
+		     ACPI_IRQ_SHARED, ACPI_IRQ_WAKE)
+
+#define ACPI_IRQ_WAKE_LEVEL_HIGH(x)					\
+	ACPI_IRQ_CFG((x), ACPI_IRQ_LEVEL_TRIGGERED, ACPI_IRQ_ACTIVE_HIGH, \
+		     ACPI_IRQ_SHARED, ACPI_IRQ_WAKE)
 
 /* Write extended Interrupt() descriptor to SSDT AML output */
 void acpi_device_write_interrupt(const struct acpi_irq *irq);

-- 
To view, visit https://review.coreboot.org/29187
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic53c6019527bbd270806897247f547178cd1ad3c
Gerrit-Change-Number: 29187
Gerrit-PatchSet: 1
Gerrit-Owner: Furquan Shaikh <furquan at google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181019/ccde67aa/attachment-0001.html>


More information about the coreboot-gerrit mailing list