summaryrefslogtreecommitdiff
path: root/target/linux/cns21xx/patches-3.10/102-cns21xx-gpiolib-support.patch
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-09-13 16:39:33 +0000
committerGabor Juhos <juhosg@openwrt.org>2013-09-13 16:39:33 +0000
commit24215346125214b18e1c85e56075884d813c39d9 (patch)
treeb7f86ed54fc97d7e8eadec45a9297063e020a050 /target/linux/cns21xx/patches-3.10/102-cns21xx-gpiolib-support.patch
parent6c14f5f3a60e017f101d792d94941f061b9c43f2 (diff)
downloadmtk-20170518-24215346125214b18e1c85e56075884d813c39d9.zip
mtk-20170518-24215346125214b18e1c85e56075884d813c39d9.tar.gz
mtk-20170518-24215346125214b18e1c85e56075884d813c39d9.tar.bz2
cns21xx: add support for 3.10
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 37971
Diffstat (limited to 'target/linux/cns21xx/patches-3.10/102-cns21xx-gpiolib-support.patch')
-rw-r--r--target/linux/cns21xx/patches-3.10/102-cns21xx-gpiolib-support.patch85
1 files changed, 85 insertions, 0 deletions
diff --git a/target/linux/cns21xx/patches-3.10/102-cns21xx-gpiolib-support.patch b/target/linux/cns21xx/patches-3.10/102-cns21xx-gpiolib-support.patch
new file mode 100644
index 0000000..21828fe
--- /dev/null
+++ b/target/linux/cns21xx/patches-3.10/102-cns21xx-gpiolib-support.patch
@@ -0,0 +1,85 @@
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -371,6 +371,8 @@ config ARCH_CNS21XX
+ select CPU_FA526
+ select PLAT_FA
+ select PLAT_FA_TIME
++ select PLAT_FA_GPIO
++ select ARCH_REQUIRE_GPIOLIB
+ select ARM_L1_CACHE_SHIFT_4
+ help
+ Support for Cavium Networks CNS21xx family.
+--- /dev/null
++++ b/arch/arm/mach-cns21xx/gpio.c
+@@ -0,0 +1,45 @@
++/*
++ * Copyright (c) 2010-2012 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * This file 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.
++ */
++
++#include <plat/gpio.h>
++
++#include <mach/cns21xx.h>
++#include <mach/irqs.h>
++
++static struct fa_gpio_chip cns21xx_gpio_chips[] = {
++ {
++ .gpio_chip = {
++ .label = "GPIOA",
++ .base = 0,
++ .ngpio = 32,
++ },
++
++ .map_base = CNS21XX_GPIOA_BASE,
++ .irq_base = CNS21XX_GPIO_IRQ_BASE,
++ }, {
++ .gpio_chip = {
++ .label = "GPIOB",
++ .base = 32,
++ .ngpio = 32,
++ },
++
++ .map_base = CNS21XX_GPIOB_BASE,
++ .irq_base = CNS21XX_GPIO_IRQ_BASE + 32,
++ }
++};
++
++static struct fa_gpio_data cns21xx_gpio_data = {
++ .chips = cns21xx_gpio_chips,
++ .nchips = ARRAY_SIZE(cns21xx_gpio_chips),
++ .irq = CNS21XX_IRQ_GPIO,
++};
++
++void __init cns21xx_gpio_init(void)
++{
++ fa_gpio_init(&cns21xx_gpio_data);
++}
+--- /dev/null
++++ b/arch/arm/mach-cns21xx/include/mach/gpio.h
+@@ -0,0 +1,2 @@
++/* empty */
++
+--- a/arch/arm/mach-cns21xx/Makefile
++++ b/arch/arm/mach-cns21xx/Makefile
+@@ -4,7 +4,7 @@
+
+ # Object file lists.
+
+-obj-y := core.o irq.o mm.o time.o idle.o devices.o
++obj-y := core.o irq.o gpio.o mm.o time.o idle.o devices.o
+
+ # machine specific files
+
+--- a/arch/arm/mach-cns21xx/common.h
++++ b/arch/arm/mach-cns21xx/common.h
+@@ -14,6 +14,7 @@ void cns21xx_restart(char mode, const ch
+ void cns21xx_map_io(void);
+ void cns21xx_init_irq(void);
+ void cns21xx_timer_init(void);
++void cns21xx_gpio_init(void);
+
+ extern struct sys_timer cns21xx_timer;
+