mirror of
https://github.com/openwrt/openwrt.git
synced 2026-06-17 12:40:16 +04:00
9cf794cff1
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.91
Remove upstreamed patches:
- airoha/patches-6.12/017-v6.13-net-airoha-Implement-BQL-support.patch[1]
- airoha/patches-6.12/138-v7.1-net-airoha-Add-missing-RX_CPU_IDX-configuration-in-a.patch[2]
- airoha/patches-6.12/149-v7.1-net-airoha-Move-ndesc-initialization-at-end-of-airoh.patch[3]
- generic/backport-6.12/940-v7.1-net-dsa-realtek-rtl8365mb-fix-mode-mask-calculation.patch[5]
Manually rebased patches:
- airoha/patches-6.12/048-01-v6.15-net-airoha-Move-airoha_eth-driver-in-a-dedicated-fol.patch[1]
- ath79/patches-6.12/800-leds-add-reset-controller-based-driver.patch[4]
- bcm27xx/patches-6.12/950-0122-bcmgenet-Better-coalescing-parameter-defaults.patch[6]
We also backported four patches to fix perf tool regression:
- generic/backport-6.12/216-01-revert-perf-cgroup-update-metric-leader-in-evlist__e.patch
- generic/backport-6.12/216-02-revert-perf-tool_pmu-fix-aggregation-on-duration_tim.patch
- generic/backport-6.12/216-03-revert-perf-python-add-parse_events-function.patch
- generic/backport-6.12/216-04-revert-perf-tool_pmu-factor-tool-events-into-their-o.patch
All other patches are automatically refreshed.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.91&id=ca24fcac1daaa5e8a667981d81986a3eb4b9fb04
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.91&id=f00037a99bc2332ef59dc85298b98b20af165904
[3] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.91&id=d36be272adda7f313e39dd118086955d993bf6a7
[4] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.91&id=07d3611389ba7d78b80ea360a42ce32ab2521fbc
[5] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.91&id=3354d6c62fd4baa7b32cbd80cc5a8aa3f2bd0656
[6] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.91&id=b84351dcc359667bc952131c1424b692ec83dce2
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/23444
(cherry picked from commit 8f638f9366)
Link: https://github.com/openwrt/openwrt/pull/23538
[Adapted to patches in 25.12]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
187 lines
5.0 KiB
Diff
187 lines
5.0 KiB
Diff
From ecbd9c87f073f097d9fe56390353e64e963e866a Mon Sep 17 00:00:00 2001
|
|
From: John Crispin <john@phrozen.org>
|
|
Date: Tue, 6 Mar 2018 10:03:03 +0100
|
|
Subject: [PATCH 03/27] leds: add reset-controller based driver
|
|
|
|
Signed-off-by: John Crispin <john@phrozen.org>
|
|
---
|
|
drivers/leds/Kconfig | 11 ++++
|
|
drivers/leds/Makefile | 1 +
|
|
drivers/leds/leds-reset.c | 137 ++++++++++++++++++++++++++++++++++++++++++++++
|
|
3 files changed, 149 insertions(+)
|
|
create mode 100644 drivers/leds/leds-reset.c
|
|
|
|
--- a/drivers/leds/Kconfig
|
|
+++ b/drivers/leds/Kconfig
|
|
@@ -977,6 +977,17 @@ source "drivers/leds/flash/Kconfig"
|
|
comment "RGB LED drivers"
|
|
source "drivers/leds/rgb/Kconfig"
|
|
|
|
+config LEDS_RESET
|
|
+ tristate "LED support for reset-controller API"
|
|
+ depends on LEDS_CLASS
|
|
+ depends on RESET_CONTROLLER
|
|
+ help
|
|
+ This option enables support for LEDs connected to pins driven by reset
|
|
+ controllers. Yes, DNI actual built HW like that.
|
|
+
|
|
+ To compile this driver as a module, choose M here: the module
|
|
+ will be called leds-reset.
|
|
+
|
|
comment "LED Triggers"
|
|
source "drivers/leds/trigger/Kconfig"
|
|
|
|
--- /dev/null
|
|
+++ b/drivers/leds/leds-reset.c
|
|
@@ -0,0 +1,140 @@
|
|
+/*
|
|
+ * Copyright (C) 2018 John Crispin <john@phrozen.org>
|
|
+ *
|
|
+ * 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.
|
|
+ *
|
|
+ */
|
|
+#include <linux/err.h>
|
|
+#include <linux/reset.h>
|
|
+#include <linux/kernel.h>
|
|
+#include <linux/leds.h>
|
|
+#include <linux/module.h>
|
|
+#include <linux/of.h>
|
|
+#include <linux/platform_device.h>
|
|
+#include <linux/reset.h>
|
|
+
|
|
+struct reset_led_data {
|
|
+ struct led_classdev cdev;
|
|
+ struct reset_control *rst;
|
|
+};
|
|
+
|
|
+static inline struct reset_led_data *
|
|
+ cdev_to_reset_led_data(struct led_classdev *led_cdev)
|
|
+{
|
|
+ return container_of(led_cdev, struct reset_led_data, cdev);
|
|
+}
|
|
+
|
|
+static void reset_led_set(struct led_classdev *led_cdev,
|
|
+ enum led_brightness value)
|
|
+{
|
|
+ struct reset_led_data *led_dat = cdev_to_reset_led_data(led_cdev);
|
|
+
|
|
+ if (value == LED_OFF)
|
|
+ reset_control_assert(led_dat->rst);
|
|
+ else
|
|
+ reset_control_deassert(led_dat->rst);
|
|
+}
|
|
+
|
|
+struct reset_leds_priv {
|
|
+ int num_leds;
|
|
+ struct reset_led_data leds[];
|
|
+};
|
|
+
|
|
+static inline int sizeof_reset_leds_priv(int num_leds)
|
|
+{
|
|
+ return sizeof(struct reset_leds_priv) +
|
|
+ (sizeof(struct reset_led_data) * num_leds);
|
|
+}
|
|
+
|
|
+static struct reset_leds_priv *reset_leds_create(struct platform_device *pdev)
|
|
+{
|
|
+ struct device *dev = &pdev->dev;
|
|
+ struct fwnode_handle *child;
|
|
+ struct reset_leds_priv *priv;
|
|
+ int count, ret;
|
|
+
|
|
+ count = device_get_child_node_count(dev);
|
|
+ if (!count)
|
|
+ return ERR_PTR(-ENODEV);
|
|
+
|
|
+ priv = devm_kzalloc(dev, sizeof_reset_leds_priv(count), GFP_KERNEL);
|
|
+ if (!priv)
|
|
+ return ERR_PTR(-ENOMEM);
|
|
+
|
|
+ device_for_each_child_node(dev, child) {
|
|
+ struct reset_led_data *led = &priv->leds[priv->num_leds];
|
|
+ struct device_node *np = to_of_node(child);
|
|
+
|
|
+ ret = fwnode_property_read_string(child, "label", &led->cdev.name);
|
|
+ if (!led->cdev.name) {
|
|
+ fwnode_handle_put(child);
|
|
+ return ERR_PTR(-EINVAL);
|
|
+ }
|
|
+ led->rst = __of_reset_control_get(np, NULL, 0, RESET_CONTROL_EXCLUSIVE);
|
|
+ if (IS_ERR(led->rst))
|
|
+ return ERR_PTR(-EINVAL);
|
|
+
|
|
+ fwnode_property_read_string(child, "linux,default-trigger",
|
|
+ &led->cdev.default_trigger);
|
|
+
|
|
+ led->cdev.brightness_set = reset_led_set;
|
|
+ ret = devm_led_classdev_register(&pdev->dev, &led->cdev);
|
|
+ if (ret < 0)
|
|
+ return ERR_PTR(ret);
|
|
+ led->cdev.dev->of_node = np;
|
|
+ priv->num_leds++;
|
|
+ }
|
|
+
|
|
+ return priv;
|
|
+}
|
|
+
|
|
+static const struct of_device_id of_reset_leds_match[] = {
|
|
+ { .compatible = "reset-leds", },
|
|
+ {},
|
|
+};
|
|
+
|
|
+MODULE_DEVICE_TABLE(of, of_reset_leds_match);
|
|
+
|
|
+static int reset_led_probe(struct platform_device *pdev)
|
|
+{
|
|
+ struct reset_leds_priv *priv;
|
|
+
|
|
+ priv = reset_leds_create(pdev);
|
|
+ if (IS_ERR(priv))
|
|
+ return PTR_ERR(priv);
|
|
+
|
|
+ platform_set_drvdata(pdev, priv);
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+static void reset_led_shutdown(struct platform_device *pdev)
|
|
+{
|
|
+ struct reset_leds_priv *priv = platform_get_drvdata(pdev);
|
|
+ int i;
|
|
+
|
|
+ for (i = 0; i < priv->num_leds; i++) {
|
|
+ struct reset_led_data *led = &priv->leds[i];
|
|
+
|
|
+ if (!(led->cdev.flags & LED_RETAIN_AT_SHUTDOWN))
|
|
+ reset_led_set(&led->cdev, LED_OFF);
|
|
+ }
|
|
+}
|
|
+
|
|
+static struct platform_driver reset_led_driver = {
|
|
+ .probe = reset_led_probe,
|
|
+ .shutdown = reset_led_shutdown,
|
|
+ .driver = {
|
|
+ .name = "leds-reset",
|
|
+ .of_match_table = of_reset_leds_match,
|
|
+ },
|
|
+};
|
|
+
|
|
+module_platform_driver(reset_led_driver);
|
|
+
|
|
+MODULE_AUTHOR("John Crispin <john@phrozen.org>");
|
|
+MODULE_DESCRIPTION("reset controller LED driver");
|
|
+MODULE_LICENSE("GPL");
|
|
+MODULE_ALIAS("platform:leds-reset");
|
|
--- a/drivers/leds/Makefile
|
|
+++ b/drivers/leds/Makefile
|
|
@@ -93,6 +93,7 @@ obj-$(CONFIG_LEDS_TURRIS_OMNIA) += leds
|
|
obj-$(CONFIG_LEDS_WM831X_STATUS) += leds-wm831x-status.o
|
|
obj-$(CONFIG_LEDS_WM8350) += leds-wm8350.o
|
|
obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o
|
|
+obj-$(CONFIG_LEDS_RESET) += leds-reset.o
|
|
|
|
# Kinetic ExpressWire Protocol
|
|
obj-$(CONFIG_LEDS_EXPRESSWIRE) += leds-expresswire.o
|