Skip to contentSkip to conversation

xtensa: generalize logic for variant/irq.h inclusion

PATCH In review Daniel Glöckner 2 participants 2 messages May 5, 2009 1 message not in the archive Tensilica Xtensa port (xtensa)

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 xtensa: generalize logic for variant/irq.h inclusion

CONFIG_VARIANT_IRQ_SWITCH has been replaced by CONFIG_VARIANT_IRQ_EXT and a #define VARIANT_HAS_IRQ_ENABLE in variant/irq.h.

This change was made to allow further extensions to the irq handling by the variant in variant/irq.h independent of the CONFIG_VARIANT_IRQ_SWITCH functionality and without forcing all variants to provide this header.

---
 arch/xtensa/Kconfig                              |    4 ++--
 arch/xtensa/configs/s6105_defconfig              |    2 +-
 arch/xtensa/include/asm/irq.h                    |    6 ++++--
 arch/xtensa/variants/s6000/include/variant/irq.h |    1 +
 4 files changed, 8 insertions(+), 5 deletions(-)
arch/xtensa/Kconfig +2 -2
index ac02f3c..76dee02 100644
@@ -57,7 +57,7 @@ source "kernel/Kconfig.freezer"
 config MMU
 	def_bool n
 
-config VARIANT_IRQ_SWITCH
+config VARIANT_IRQ_EXT
 	def_bool n
 
 menu "Processor type and features"
@@ -78,7 +78,7 @@ config XTENSA_VARIANT_DC232B
 
 config XTENSA_VARIANT_S6000
 	bool "s6000 - Stretch software configurable processor"
-	select VARIANT_IRQ_SWITCH
+	select VARIANT_IRQ_EXT
 	select ARCH_REQUIRE_GPIOLIB
 	select XTENSA_CALIBRATE_CCOUNT
 endchoice
arch/xtensa/configs/s6105_defconfig +1 -1
index 768bee0..51d4bae 100644
@@ -103,7 +103,7 @@ CONFIG_DEFAULT_CFQ=y
 CONFIG_DEFAULT_IOSCHED="cfq"
 # CONFIG_FREEZER is not set
 # CONFIG_MMU is not set
-CONFIG_VARIANT_IRQ_SWITCH=y
+CONFIG_VARIANT_IRQ_EXT=y
 
 #
 # Processor type and features
arch/xtensa/include/asm/irq.h +4 -2
index dfac82d..4a39bb5 100644
@@ -14,9 +14,11 @@
 #include <platform/hardware.h>
 #include <variant/core.h>
 
-#ifdef CONFIG_VARIANT_IRQ_SWITCH
+#ifdef CONFIG_VARIANT_IRQ_EXT
 #include <variant/irq.h>
-#else
+#endif
+
+#ifndef VARIANT_HAS_IRQ_ENABLE
 static inline void variant_irq_enable(unsigned int irq) { }
 static inline void variant_irq_disable(unsigned int irq) { }
 #endif
arch/xtensa/variants/s6000/include/variant/irq.h +1 -0
index fa031cb..bcd496d 100644
@@ -3,6 +3,7 @@
 
 #define NO_IRQ		(-1)
 
+#define VARIANT_HAS_IRQ_ENABLE
 extern void variant_irq_enable(unsigned int irq);
 extern void variant_irq_disable(unsigned int irq);
 
Signature · 1 line
1.6.1.3
#2 lore raw
Quoted 20 lines · Daniel Glöckner

CONFIG_VARIANT_IRQ_SWITCH has been replaced by CONFIG_VARIANT_IRQ_EXT and a #define VARIANT_HAS_IRQ_ENABLE in variant/irq.h.

This change was made to allow further extensions to the irq handling by the variant in variant/irq.h independent of the CONFIG_VARIANT_IRQ_SWITCH functionality and without forcing all variants to provide this header.

---
 arch/xtensa/Kconfig                              |    4 ++--
 arch/xtensa/configs/s6105_defconfig              |    2 +-
 arch/xtensa/include/asm/irq.h                    |    6 ++++--
 arch/xtensa/variants/s6000/include/variant/irq.h |    1 +
 4 files changed, 8 insertions(+), 5 deletions(-)
arch/xtensa/Kconfig +0 -0
index ac02f3c..76dee02 100644

arch/xtensa/Kconfig source "kernel/Kconfig.freezer" · line 61

Quoted 6 lines
arch/xtensa/Kconfig +1 -1
@@ -57,7 +57,7 @@ source "kernel/Kconfig.freezer"
 config MMU
 	def_bool n
 
-config VARIANT_IRQ_SWITCH
+config VARIANT_IRQ_EXT
 	def_bool n

Common practice is to name such symbols "HAVE_*".
So in your case:

config HAVE_VARIANT_IRQ_EXT

Sam