openwrt/target/linux/generic/backport-5.15/818-v6.5-11-leds-trigger-netdev-expose-netdev-trigger-modes-in-l.patch
Christian Marangi 0a4b309f41
generic: backport initial LEDs hw control support
Backport initial LEDs hw control support. Currently this is limited to
only rx/tx and link events for the netdev trigger but the API got
accepted and the additional modes are working on and will be backported
later.

Refresh every patch and add the additional config flag for QCA8K new
LEDs support.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-06-06 11:01:31 +02:00

55 lines
1.5 KiB
Diff

From 947acacab5ea151291b861cdfbde16ff5cf1b08c Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
Date: Mon, 29 May 2023 18:32:41 +0200
Subject: [PATCH 11/13] leds: trigger: netdev: expose netdev trigger modes in
linux include
Expose netdev trigger modes to make them accessible by LED driver that
will support netdev trigger for hw control.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/leds/trigger/ledtrig-netdev.c | 9 ---------
include/linux/leds.h | 10 ++++++++++
2 files changed, 10 insertions(+), 9 deletions(-)
--- a/drivers/leds/trigger/ledtrig-netdev.c
+++ b/drivers/leds/trigger/ledtrig-netdev.c
@@ -56,15 +56,6 @@ struct led_netdev_data {
bool hw_control;
};
-enum led_trigger_netdev_modes {
- TRIGGER_NETDEV_LINK = 0,
- TRIGGER_NETDEV_TX,
- TRIGGER_NETDEV_RX,
-
- /* Keep last */
- __TRIGGER_NETDEV_MAX,
-};
-
static void set_baseline_state(struct led_netdev_data *trigger_data)
{
int current_brightness;
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -527,6 +527,16 @@ static inline void *led_get_trigger_data
#endif /* CONFIG_LEDS_TRIGGERS */
+/* Trigger specific enum */
+enum led_trigger_netdev_modes {
+ TRIGGER_NETDEV_LINK = 0,
+ TRIGGER_NETDEV_TX,
+ TRIGGER_NETDEV_RX,
+
+ /* Keep last */
+ __TRIGGER_NETDEV_MAX,
+};
+
/* Trigger specific functions */
#ifdef CONFIG_LEDS_TRIGGER_DISK
void ledtrig_disk_activity(bool write);