Skip to contentSkip to conversation

x86/platform: Increase maximum GPIO number for X86_64

PATCH RESEND Applied Andy Shevchenko 3 participants 3 messages Aug 26, 2021 – Sep 2, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND v2 1/1 x86/platform: Increase maximum GPIO number for X86_64

By default the 512 GPIOs is the maximum on any x86 platform. With, for example, Intel Tiger Lake-H the SoC based controller occupies up to 480 pins. This leaves only 32 available for GPIO expanders or other drivers, like PMIC. Hence, bump the maximum GPIO number to 1024 for X86_64 and leave 512 for X86_32.

---
v2 resend: actually added Rafael and linux-acpi@ to Cc list
v2: dropped confusing comment and help, simplified defaults (Rafael)
added Rb tag (Linus)

 arch/x86/Kconfig | 5 +++++
 1 file changed, 5 insertions(+)
arch/x86/Kconfig +5 -0
index 858ce2736bd6..25960fe242bd 100644
@@ -338,6 +338,11 @@ config NEED_PER_CPU_PAGE_FIRST_CHUNK
 config ARCH_HIBERNATION_POSSIBLE
 	def_bool y
 
+config ARCH_NR_GPIO
+	int
+	default 1024 if X86_64
+	default 512
+
 config ARCH_SUSPEND_POSSIBLE
 	def_bool y
 
Signature · 1 line
2.32.0
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 9 lines · Andy Shevchenko

By default the 512 GPIOs is the maximum on any x86 platform. With, for example, Intel Tiger Lake-H the SoC based controller occupies up to 480 pins. This leaves only 32 available for GPIO expanders or other drivers, like PMIC. Hence, bump the maximum GPIO number to 1024 for X86_64 and leave 512 for X86_32.

Quoted 26 lines

---
v2 resend: actually added Rafael and linux-acpi@ to Cc list
v2: dropped confusing comment and help, simplified defaults (Rafael)
added Rb tag (Linus)

 arch/x86/Kconfig | 5 +++++
 1 file changed, 5 insertions(+)
arch/x86/Kconfig +5 -1
index 858ce2736bd6..25960fe242bd 100644
@@ -338,6 +338,11 @@ config NEED_PER_CPU_PAGE_FIRST_CHUNK
 config ARCH_HIBERNATION_POSSIBLE
        def_bool y
 
+config ARCH_NR_GPIO
+       int
+       default 1024 if X86_64
+       default 512
+
 config ARCH_SUSPEND_POSSIBLE
        def_bool y
 
--

2.32.0

#2 lore raw
In reply to Andy Shevchenko
The following commit has been merged into the x86/urgent branch of tip:

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     d7109fe3a0991a0f7b4ac099b78c908e3b619787
Gitweb:        https://git.kernel.org/tip/d7109fe3a0991a0f7b4ac099b78c908e3b619787
Author:        Andy Shevchenko <[email protected]>
AuthorDate:    Thu, 26 Aug 2021 18:03:17 +03:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Thu, 02 Sep 2021 21:57:57 +02:00

x86/platform: Increase maximum GPIO number for X86_64

By default the 512 GPIOs is the maximum on any x86 platform. With, for example, Intel Tiger Lake-H the SoC based controller occupies up to 480 pins. This leaves only 32 available for GPIO expanders or other drivers, like PMIC. Hence, bump the maximum GPIO number to 1024 for X86_64 and leave 512 for X86_32.

---
 arch/x86/Kconfig | 5 +++++
 1 file changed, 5 insertions(+)
arch/x86/Kconfig +5 -0
index 421fa9e..1016388 100644
@@ -340,6 +340,11 @@ config NEED_PER_CPU_PAGE_FIRST_CHUNK
 config ARCH_HIBERNATION_POSSIBLE
 	def_bool y
 
+config ARCH_NR_GPIO
+	int
+	default 1024 if X86_64
+	default 512
+
 config ARCH_SUSPEND_POSSIBLE
 	def_bool y