lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1410176880-22524-1-git-send-email-mika.westerberg@linux.intel.com>
Date:	Mon,  8 Sep 2014 14:47:59 +0300
From:	Mika Westerberg <mika.westerberg@...ux.intel.com>
To:	Linus Walleij <linus.walleij@...aro.org>,
	Alexandre Courbot <gnurou@...il.com>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
	Ning Li <ning.li@...el.com>, Alan Cox <alan@...ux.intel.com>,
	Mika Westerberg <mika.westerberg@...ux.intel.com>,
	Mark Brown <broonie@...aro.org>, linux-kernel@...r.kernel.org,
	linux-gpio@...r.kernel.org
Subject: [PATCH 1/2] x86, gpio: Increase ARCH_NR_GPIOs to 512

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@...ux.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@...mvista.com>
+ *
+ * Copyright (c) 2014, Intel Corporation.
+ * Author: Mika Westerberg <mika.westerberg@...ux.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ