linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] x86, gpio: Increase ARCH_NR_GPIOs to 512
@ 2014-09-08 11:47 Mika Westerberg
  2014-09-08 11:48 ` [PATCH 2/2] gpio: Add support for Intel Cherryview/Braswell GPIO controller Mika Westerberg
  2014-09-09  7:24 ` [PATCH 1/2] x86, gpio: Increase ARCH_NR_GPIOs to 512 Linus Walleij
  0 siblings, 2 replies; 9+ messages in thread
From: Mika Westerberg @ 2014-09-08 11:47 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Ning Li,
	Alan Cox, Mika Westerberg, Mark Brown, linux-kernel, linux-gpio

Some newer Intel SoCs like Braswell already have more than 256 GPIOs
available so the default limit is exceeded. In order to support these add
back the custom GPIO header with limit of 512 GPIOs for x86.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 arch/x86/Kconfig            |  1 +
 arch/x86/include/asm/gpio.h | 54 +++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 51 insertions(+), 4 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 778178f4c7d1..0bf6fe76e7ba 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -136,6 +136,7 @@ config X86
 	select HAVE_ACPI_APEI if ACPI
 	select HAVE_ACPI_APEI_NMI if ACPI
 	select ACPI_LEGACY_TABLES_LOOKUP if ACPI
+	select ARCH_HAVE_CUSTOM_GPIO_H
 
 config INSTRUCTION_DECODER
 	def_bool y
diff --git a/arch/x86/include/asm/gpio.h b/arch/x86/include/asm/gpio.h
index b3799d88ffcf..152b71788f2d 100644
--- a/arch/x86/include/asm/gpio.h
+++ b/arch/x86/include/asm/gpio.h
@@ -1,4 +1,50 @@
-#ifndef __LINUX_GPIO_H
-#warning Include linux/gpio.h instead of asm/gpio.h
-#include <linux/gpio.h>
-#endif
+/*
+ * GPIO customization for x86.
+ *
+ * Based on the original code:
+ *
+ * Copyright (c) 2007-2008  MontaVista Software, Inc.
+ * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+ *
+ * Copyright (c) 2014, Intel Corporation.
+ * Author: Mika Westerberg <mika.westerberg@linux.intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ASM_X86_GPIO_H
+#define __ASM_X86_GPIO_H
+
+#define ARCH_NR_GPIOS 512
+#include <asm-generic/gpio.h>
+
+#ifdef CONFIG_GPIOLIB
+static inline int gpio_get_value(unsigned int gpio)
+{
+	return __gpio_get_value(gpio);
+}
+
+static inline void gpio_set_value(unsigned int gpio, int value)
+{
+	__gpio_set_value(gpio, value);
+}
+
+static inline int gpio_cansleep(unsigned int gpio)
+{
+	return __gpio_cansleep(gpio);
+}
+
+static inline int gpio_to_irq(unsigned int gpio)
+{
+	return __gpio_to_irq(gpio);
+}
+
+static inline int irq_to_gpio(unsigned int irq)
+{
+	return -EINVAL;
+}
+#endif /* CONFIG_GPIOLIB */
+
+#endif /* __ASM_X86_GPIO_H */
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-09-20  5:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-08 11:47 [PATCH 1/2] x86, gpio: Increase ARCH_NR_GPIOs to 512 Mika Westerberg
2014-09-08 11:48 ` [PATCH 2/2] gpio: Add support for Intel Cherryview/Braswell GPIO controller Mika Westerberg
2014-09-09  7:24 ` [PATCH 1/2] x86, gpio: Increase ARCH_NR_GPIOs to 512 Linus Walleij
2014-09-09  7:41   ` H. Peter Anvin
2014-09-09  9:46   ` Mika Westerberg
2014-09-19  7:20   ` Alexandre Courbot
2014-09-19 10:46     ` Mika Westerberg
2014-09-19 17:48     ` Linus Walleij
2014-09-20  5:56       ` Alexandre Courbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).