aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ath25/patches-5.10/210-reset_button.patch
diff options
context:
space:
mode:
authorSergey Ryazanov <ryazanov.s.a@gmail.com>2021-12-19 17:31:53 +0300
committerDaniel Golle <daniel@makrotopia.org>2021-12-27 16:00:21 +0000
commit5deb3996e249e15bb5711695c917641a1490670a (patch)
tree43582de46d470d5e9e064b4b4a8b3aa49d873955 /target/linux/ath25/patches-5.10/210-reset_button.patch
parent5bf8ae7c4bd2e1fc216a6af81ab931e1b0861271 (diff)
downloadupstream-5deb3996e249e15bb5711695c917641a1490670a.tar.gz
upstream-5deb3996e249e15bb5711695c917641a1490670a.tar.bz2
upstream-5deb3996e249e15bb5711695c917641a1490670a.zip
ath25: add kernel 5.10 support
Copy and refresh patches and config from 5.4 to 5.10. Most patches require no more then automatic refresh. The only exception is the Ethernet driver patch, which requires some more work: * drop eth_change_mtu() usage since it was removed from the kernel, it anyway useless for drivers that utilizes alloc_etherdev(); * add the txqueue number argument to the .ndo_tx_timeout callback function; * replace ioremap_nocache() which was finally removed from the kernel by the ioremap() with the same behaviour. Switch target to the new kernel version. Signed-off-by: Daniel Golle <daniel@makrotopia.org> [use KERNEL_TESTING_PATCHVER for now] Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Diffstat (limited to 'target/linux/ath25/patches-5.10/210-reset_button.patch')
-rw-r--r--target/linux/ath25/patches-5.10/210-reset_button.patch71
1 files changed, 71 insertions, 0 deletions
diff --git a/target/linux/ath25/patches-5.10/210-reset_button.patch b/target/linux/ath25/patches-5.10/210-reset_button.patch
new file mode 100644
index 0000000000..b3f7a14cda
--- /dev/null
+++ b/target/linux/ath25/patches-5.10/210-reset_button.patch
@@ -0,0 +1,71 @@
+--- a/arch/mips/ath25/Makefile
++++ b/arch/mips/ath25/Makefile
+@@ -8,7 +8,7 @@
+ # Copyright (C) 2006-2009 Felix Fietkau <nbd@openwrt.org>
+ #
+
+-obj-y += board.o prom.o devices.o
++obj-y += board.o prom.o devices.o reset.o
+
+ obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
+
+--- /dev/null
++++ b/arch/mips/ath25/reset.c
+@@ -0,0 +1,57 @@
++#include <linux/init.h>
++#include <linux/slab.h>
++#include <linux/platform_device.h>
++#include <linux/gpio_keys.h>
++#include <linux/input.h>
++#include <ath25_platform.h>
++#include "devices.h"
++
++static int __init
++ar231x_init_reset(void)
++{
++ struct platform_device *pdev;
++ struct gpio_keys_platform_data pdata;
++ struct gpio_keys_button *p;
++ int err;
++
++ if (ath25_board.config->reset_config_gpio == 0xffff)
++ return -ENODEV;
++
++ p = kzalloc(sizeof(*p), GFP_KERNEL);
++ if (!p)
++ goto err;
++
++ p->desc = "reset";
++ p->type = EV_KEY;
++ p->code = KEY_RESTART;
++ p->debounce_interval = 60;
++ p->gpio = ath25_board.config->reset_config_gpio;
++
++ memset(&pdata, 0, sizeof(pdata));
++ pdata.poll_interval = 20;
++ pdata.buttons = p;
++ pdata.nbuttons = 1;
++
++ pdev = platform_device_alloc("gpio-keys-polled", 0);
++ if (!pdev)
++ goto err_free;
++
++ err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
++ if (err)
++ goto err_put_pdev;
++
++ err = platform_device_add(pdev);
++ if (err)
++ goto err_put_pdev;
++
++ return 0;
++
++err_put_pdev:
++ platform_device_put(pdev);
++err_free:
++ kfree(p);
++err:
++ return -ENOMEM;
++}
++
++device_initcall(ar231x_init_reset);