packages/linux: Update Linux kernel for WeTek Play to 3.10-16a1118

This commit is contained in:
Alex Deryskyba 2015-03-14 21:19:27 +01:00 committed by Stephan Raue
parent c96f3b6f3c
commit b200637fd8
6 changed files with 1 additions and 627 deletions

View File

@ -19,7 +19,7 @@
PKG_NAME="linux"
case "$LINUX" in
amlogic)
PKG_VERSION="amlogic-3.10-24553c6"
PKG_VERSION="amlogic-3.10-16a1118"
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
;;
imx6)

View File

@ -1,230 +0,0 @@
From 67e61bb31fa7365ccff454bb7d88a5eac5a05657 Mon Sep 17 00:00:00 2001
From: Memphiz <memphis@machzwo.de>
Date: Sun, 8 Mar 2015 22:26:05 +0100
Subject: [PATCH 1/4] [WeTek_Play] - add led driver for the 3 blue leds of the
wetekplay (powerled, ethled, wifiled)
---
drivers/leds/Kconfig | 7 ++
drivers/leds/Makefile | 1 +
drivers/leds/leds-wetekplay.c | 179 +++++++++++++++++++++++++++++++
4 files changed, 203 insertions(+)
create mode 100644 drivers/leds/leds-wetekplay.c
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index ef99229..878428e 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -73,6 +73,13 @@ config LEDS_LM3642
converter plus 1.5A constant current driver for a high-current
white LED.
+config LEDS_WETEKPLAY
+ tristate "LED support for the WeTek.Play status LED"
+ depends on LEDS_CLASS
+ help
+ This option enables support for controlling the status LED
+ of the WeTek.Play box. ON means BLUE, OFF means RED.
+
config LEDS_LOCOMO
tristate "LED Support for Locomo device"
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index ac28977..843379e 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -53,6 +53,7 @@ obj-$(CONFIG_LEDS_RENESAS_TPU) += leds-renesas-tpu.o
obj-$(CONFIG_LEDS_MAX8997) += leds-max8997.o
obj-$(CONFIG_LEDS_LM355x) += leds-lm355x.o
obj-$(CONFIG_LEDS_BLINKM) += leds-blinkm.o
+obj-$(CONFIG_LEDS_WETEKPLAY) += leds-wetekplay.o
# LED SPI Drivers
obj-$(CONFIG_LEDS_DAC124S085) += leds-dac124s085.o
diff --git a/drivers/leds/leds-wetekplay.c b/drivers/leds/leds-wetekplay.c
new file mode 100644
index 0000000..4e00f3d
--- /dev/null
+++ b/drivers/leds/leds-wetekplay.c
@@ -0,0 +1,179 @@
+/*
+ * LEDs driver for the "User LED" on WeTek.Play
+ *
+ * Copyright (C) 2015 Memphiz <memphiz@kodi.tv>
+ *
+ * Based on leds.rb532
+ */
+
+#include <linux/leds.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/amlogic/aml_gpio_consumer.h>
+
+#include <mach/am_regs.h>
+#include <plat/regops.h>
+
+#define GPIO_OWNER_WIFILED "WIFILED"
+#define GPIO_OWNER_ETHLED "ETHLED"
+
+static void wetekplay_powerled_set(struct led_classdev *cdev,
+ enum led_brightness brightness)
+{
+
+ if (brightness) {
+ //printk(KERN_INFO "%s() LED BLUE\n", __FUNCTION__);
+ aml_set_reg32_bits(SECBUS2_REG_ADDR(0), 1, 0, 1); // set TEST_n output mode
+ aml_set_reg32_bits(AOBUS_REG_ADDR(0x24), 1, 31, 1); // set TEST_n pin H
+ }
+ else {
+ //printk(KERN_INFO "%s() LED RED\n", __FUNCTION__);
+ aml_set_reg32_bits(SECBUS2_REG_ADDR(0), 1, 0, 1); // set TEST_n output mode
+ aml_set_reg32_bits(AOBUS_REG_ADDR(0x24), 0, 31, 1); // set TEST_n pin L
+ }
+}
+
+static enum led_brightness wetekplay_powerled_get(struct led_classdev *cdev)
+{
+ if (aml_get_reg32_bits(AOBUS_REG_ADDR(0x24), 31, 1))
+ return 255;
+ else
+ return 0;
+}
+
+static void wetekplay_wifiled_set(struct led_classdev *cdev,
+ enum led_brightness brightness)
+{
+
+ if (brightness) {
+ //printk(KERN_INFO "%s() LED BLUE\n", __FUNCTION__);
+ amlogic_gpio_direction_output(GPIOC_8, 1, GPIO_OWNER_WIFILED);
+ }
+ else {
+ //printk(KERN_INFO "%s() LED OFF\n", __FUNCTION__);
+ amlogic_gpio_direction_output(GPIOC_8, 0, GPIO_OWNER_WIFILED);
+ }
+}
+
+static enum led_brightness wetekplay_wifiled_get(struct led_classdev *cdev)
+{
+ if (amlogic_get_value(GPIOC_8, GPIO_OWNER_WIFILED))
+ return 255;
+ else
+ return 0;
+}
+
+static void wetekplay_ethled_set(struct led_classdev *cdev,
+ enum led_brightness brightness)
+{
+
+ if (brightness) {
+ //printk(KERN_INFO "%s() LED BLUE\n", __FUNCTION__);
+ amlogic_gpio_direction_output(GPIOC_14, 1, GPIO_OWNER_ETHLED);
+ }
+ else {
+ //printk(KERN_INFO "%s() LED OFF\n", __FUNCTION__);
+ amlogic_gpio_direction_output(GPIOC_14, 0, GPIO_OWNER_ETHLED);
+ }
+}
+
+static enum led_brightness wetekplay_ethled_get(struct led_classdev *cdev)
+{
+ if (amlogic_get_value(GPIOC_14, GPIO_OWNER_ETHLED))
+ return 255;
+ else
+ return 0;
+}
+
+
+
+static struct led_classdev wetekplay_powerled = {
+ .name = "wetek:blue:powerled",
+ .brightness_set = wetekplay_powerled_set,
+ .brightness_get = wetekplay_powerled_get,
+ .default_trigger = "default-on",
+};
+
+static struct led_classdev wetekplay_wifiled = {
+ .name = "wetek:blue:wifiled",
+ .brightness_set = wetekplay_wifiled_set,
+ .brightness_get = wetekplay_wifiled_get,
+ .default_trigger = "wifilink",
+};
+
+static struct led_classdev wetekplay_ethled = {
+ .name = "wetek:blue:ethled",
+ .brightness_set = wetekplay_ethled_set,
+ .brightness_get = wetekplay_ethled_get,
+ .default_trigger = "ethlink",
+};
+
+static int wetekplay_led_probe(struct platform_device *pdev)
+{
+ amlogic_gpio_request(GPIOC_8, GPIO_OWNER_WIFILED);
+ amlogic_gpio_request(GPIOC_14, GPIO_OWNER_ETHLED);
+ led_classdev_register(&pdev->dev, &wetekplay_powerled);
+ led_classdev_register(&pdev->dev, &wetekplay_wifiled);
+ return led_classdev_register(&pdev->dev, &wetekplay_ethled);
+}
+
+static int wetekplay_led_remove(struct platform_device *pdev)
+{
+ amlogic_gpio_free(GPIOC_8, GPIO_OWNER_WIFILED);
+ amlogic_gpio_free(GPIOC_14, GPIO_OWNER_ETHLED);
+ led_classdev_unregister(&wetekplay_powerled);
+ led_classdev_unregister(&wetekplay_wifiled);
+ led_classdev_unregister(&wetekplay_ethled);
+ return 0;
+}
+
+#ifdef CONFIG_USE_OF
+static const struct of_device_id amlogic_wetekplayled_dt_match[]={
+ { .compatible = "amlogic,wetekplay-led",
+ },
+ {},
+};
+#else
+#define amlogic_wetekplayled_dt_match, NULL
+#endif
+
+
+static struct platform_driver wetekplay_led_driver = {
+ .probe = wetekplay_led_probe,
+ .remove = wetekplay_led_remove,
+ .driver = {
+ .name = "wetekplay-led",
+ .of_match_table = amlogic_wetekplayled_dt_match,
+ },
+};
+
+static int __init
+wetekplay_led_init_module(void)
+{
+ int err;
+
+ printk("wetekplay_led_init_module\n");
+ if ((err = platform_driver_register(&wetekplay_led_driver))) {
+ return err;
+ }
+
+ return err;
+
+}
+
+static void __exit
+wetekplay_led_remove_module(void)
+{
+ platform_driver_unregister(&wetekplay_led_driver);
+ printk("wetekplay-led module removed.\n");
+}
+
+
+//module_platform_driver(wetekplay_led_driver);
+module_init(wetekplay_led_init_module);
+module_exit(wetekplay_led_remove_module);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Power LED support for WeTek.Play");
+MODULE_AUTHOR("Memphiz <memphiz@kodi.tv>");
+MODULE_ALIAS("platform:wetekplay-led");
--
1.9.3 (Apple Git-50)

View File

@ -1,165 +0,0 @@
From 4ac75e4f0aa7b1be61fe4a495248a11f49d3f204 Mon Sep 17 00:00:00 2001
From: Memphiz <memphis@machzwo.de>
Date: Mon, 19 Jan 2015 20:27:36 +0100
Subject: [PATCH] [LED] - add remote control ledtrigger
---
drivers/input/input.c | 13 ++++-
drivers/leds/trigger/Kconfig | 7 +++
drivers/leds/trigger/Makefile | 1 +
drivers/leds/trigger/ledtrig-remote-control.c | 76 +++++++++++++++++++++++++++
4 files changed, 96 insertions(+), 1 deletion(-)
create mode 100644 drivers/leds/trigger/ledtrig-remote-control.c
diff --git a/drivers/input/input.c b/drivers/input/input.c
index a161021..08829e3 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -28,6 +28,11 @@
#include <linux/mutex.h>
#include <linux/rcupdate.h>
#include "input-compat.h"
+// Led Trigger Support.
+#ifdef CONFIG_LEDS_TRIGGER_REMOTE_CONTROL
+#include <linux/leds.h>
+extern void ledtrig_rc_activity(struct led_classdev *led_cdev);
+#endif
MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
MODULE_DESCRIPTION("Input core");
@@ -179,9 +184,12 @@ static void input_repeat_key(unsigned long data)
{
struct input_dev *dev = (void *) data;
unsigned long flags;
-
+#ifdef CONFIG_LEDS_TRIGGER_REMOTE_CONTROL
+ ledtrig_rc_activity(NULL);
+#endif
spin_lock_irqsave(&dev->event_lock, flags);
+
if (test_bit(dev->repeat_key, dev->key) &&
is_event_supported(dev->repeat_key, dev->keybit, KEY_MAX)) {
struct input_value vals[] = {
@@ -427,6 +435,9 @@ void input_event(struct input_dev *dev,
if (is_event_supported(type, dev->evbit, EV_MAX)) {
+#ifdef CONFIG_LEDS_TRIGGER_REMOTE_CONTROL
+ledtrig_rc_activity(NULL);
+#endif
spin_lock_irqsave(&dev->event_lock, flags);
input_handle_event(dev, type, code, value);
spin_unlock_irqrestore(&dev->event_lock, flags);
diff --git a/drivers/leds/trigger/Kconfig b/drivers/leds/trigger/Kconfig
index 49794b4..e911914 100644
--- a/drivers/leds/trigger/Kconfig
+++ b/drivers/leds/trigger/Kconfig
@@ -41,6 +41,13 @@ config LEDS_TRIGGER_IDE_DISK
This allows LEDs to be controlled by IDE disk activity.
If unsure, say Y.
+config LEDS_TRIGGER_REMOTE_CONTROL
+ bool "LED Remote Control Trigger"
+ depends on AM_REMOTE
+ help
+ This allows LEDs to be controlled by Remote Control activity.
+ If unsure, say Y.
+
config LEDS_TRIGGER_HEARTBEAT
tristate "LED Heartbeat Trigger"
depends on LEDS_TRIGGERS
diff --git a/drivers/leds/trigger/Makefile b/drivers/leds/trigger/Makefile
index 1abf48d..868976b 100644
--- a/drivers/leds/trigger/Makefile
+++ b/drivers/leds/trigger/Makefile
@@ -8,3 +8,4 @@ obj-$(CONFIG_LEDS_TRIGGER_CPU) += ledtrig-cpu.o
obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON) += ledtrig-default-on.o
obj-$(CONFIG_LEDS_TRIGGER_TRANSIENT) += ledtrig-transient.o
obj-$(CONFIG_LEDS_TRIGGER_CAMERA) += ledtrig-camera.o
+obj-$(CONFIG_LEDS_TRIGGER_REMOTE_CONTROL) += ledtrig-remote-control.o
diff --git a/drivers/leds/trigger/ledtrig-remote-control.c b/drivers/leds/trigger/ledtrig-remote-control.c
new file mode 100644
index 0000000..96dc71a
--- /dev/null
+++ b/drivers/leds/trigger/ledtrig-remote-control.c
@@ -0,0 +1,76 @@
+/*
+ * LED Remote Control Activity Trigger
+ *
+ * Copyright 2015 Memphiz (memphiz@kodi.tv)
+ * Copyright 2013 Rene van Dorst
+ * Copyright 2006 Openedhand Ltd.
+ *
+ * Author: Richard Purdie <rpurdie@openedhand.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.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/jiffies.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/timer.h>
+#include <linux/leds.h>
+
+/* Delay on in mSec */
+ #define delay_on 20
+
+static void ledtrig_rc_timerfunc(unsigned long data);
+
+
+static DEFINE_TIMER(ledtrig_rc_timer, ledtrig_rc_timerfunc, 0, 0);
+static int rc_activity;
+static int rc_lastactivity;
+
+void ledtrig_rc_activity(struct led_classdev *led_cdev)
+{
+ rc_activity++;
+ if (!timer_pending(&ledtrig_rc_timer))
+ mod_timer(&ledtrig_rc_timer, jiffies + msecs_to_jiffies(delay_on));
+}
+EXPORT_SYMBOL(ledtrig_rc_activity);
+
+static struct led_trigger ledtrig_rc = {
+ .name = "rc",
+ .activate = ledtrig_rc_activity,
+};
+
+
+static void ledtrig_rc_timerfunc(unsigned long data)
+{
+ if (rc_lastactivity != rc_activity) {
+ rc_lastactivity = rc_activity;
+ /* INT_MAX will set each LED to its maximum brightness */
+ led_trigger_event(&ledtrig_rc, LED_OFF);
+ mod_timer(&ledtrig_rc_timer, jiffies + msecs_to_jiffies(delay_on));
+ } else {
+ led_trigger_event(&ledtrig_rc, INT_MAX);
+ }
+}
+
+static int __init ledtrig_rc_init(void)
+{
+ led_trigger_register(&ledtrig_rc);
+ return 0;
+}
+
+static void __exit ledtrig_rc_exit(void)
+{
+ led_trigger_unregister(&ledtrig_rc);
+}
+
+module_init(ledtrig_rc_init);
+module_exit(ledtrig_rc_exit);
+
+MODULE_AUTHOR("Memphiz <memphiz@kodi.tv>");
+MODULE_DESCRIPTION("LED Remote Control Activity Trigger");
+MODULE_LICENSE("GPL");
+
--
1.9.3 (Apple Git-50)

View File

@ -1,127 +0,0 @@
From 9d998299c324d107cfb663f5e1e1bdf435f1cc66 Mon Sep 17 00:00:00 2001
From: Memphiz <memphis@machzwo.de>
Date: Sun, 8 Mar 2015 22:11:34 +0100
Subject: [PATCH 3/6] [WeTek_Play] - add network link status ledtrigger -
allows to assign leds to weteks network link status (either eth or wifi)
---
drivers/leds/trigger/Kconfig | 7 +++
drivers/leds/trigger/Makefile | 1 +
drivers/leds/trigger/ledtrig-network.c | 79 ++++++++++++++++++++++++++++++++++
3 files changed, 87 insertions(+)
create mode 100644 drivers/leds/trigger/ledtrig-network.c
diff --git a/drivers/leds/trigger/Kconfig b/drivers/leds/trigger/Kconfig
index e911914..4d889bb 100644
--- a/drivers/leds/trigger/Kconfig
+++ b/drivers/leds/trigger/Kconfig
@@ -48,6 +48,13 @@ config LEDS_TRIGGER_REMOTE_CONTROL
This allows LEDs to be controlled by Remote Control activity.
If unsure, say Y.
+config LEDS_TRIGGER_NETWORK
+ bool "LED network link trigger"
+ depends on LEDS_TRIGGERS
+ help
+ This allows LEDs to be controlled by network link status.
+ If unsure, say Y.
+
config LEDS_TRIGGER_HEARTBEAT
tristate "LED Heartbeat Trigger"
depends on LEDS_TRIGGERS
diff --git a/drivers/leds/trigger/Makefile b/drivers/leds/trigger/Makefile
index 868976b..4bbe38f 100644
--- a/drivers/leds/trigger/Makefile
+++ b/drivers/leds/trigger/Makefile
@@ -9,3 +9,4 @@ obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON) += ledtrig-default-on.o
obj-$(CONFIG_LEDS_TRIGGER_TRANSIENT) += ledtrig-transient.o
obj-$(CONFIG_LEDS_TRIGGER_CAMERA) += ledtrig-camera.o
obj-$(CONFIG_LEDS_TRIGGER_REMOTE_CONTROL) += ledtrig-remote-control.o
+obj-$(CONFIG_LEDS_TRIGGER_NETWORK) += ledtrig-network.o
diff --git a/drivers/leds/trigger/ledtrig-network.c b/drivers/leds/trigger/ledtrig-network.c
new file mode 100644
index 0000000..790aa10
--- /dev/null
+++ b/drivers/leds/trigger/ledtrig-network.c
@@ -0,0 +1,79 @@
+/*
+ * LED Network Trigger
+ *
+ * Copyright 2015 Memphiz (memphiz@kodi.tv)
+ *
+ * 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/module.h>
+#include <linux/jiffies.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/timer.h>
+#include <linux/leds.h>
+
+void ledtrig_eth_linkup(struct led_classdev *led_cdev);
+void ledtrig_eth_linkdown(struct led_classdev *led_cdev);
+void ledtrig_wifi_linkup(struct led_classdev *led_cdev);
+void ledtrig_wifi_linkdown(struct led_classdev *led_cdev);
+
+static struct led_trigger ledtrig_eth = {
+ .name = "ethlink",
+ .activate = ledtrig_eth_linkup,
+ .deactivate = ledtrig_eth_linkdown,
+};
+
+static struct led_trigger ledtrig_wifi = {
+ .name = "wifilink",
+ .activate = ledtrig_wifi_linkup,
+ .deactivate = ledtrig_wifi_linkdown,
+};
+
+void ledtrig_eth_linkup(struct led_classdev *led_cdev)
+{
+ led_trigger_event(&ledtrig_eth, INT_MAX);
+}
+EXPORT_SYMBOL(ledtrig_eth_linkup);
+
+void ledtrig_eth_linkdown(struct led_classdev *led_cdev)
+{
+ led_trigger_event(&ledtrig_eth, LED_OFF);
+}
+EXPORT_SYMBOL(ledtrig_eth_linkdown);
+
+void ledtrig_wifi_linkup(struct led_classdev *led_cdev)
+{
+ led_trigger_event(&ledtrig_wifi, INT_MAX);
+}
+EXPORT_SYMBOL(ledtrig_wifi_linkup);
+
+void ledtrig_wifi_linkdown(struct led_classdev *led_cdev)
+{
+ led_trigger_event(&ledtrig_wifi, LED_OFF);
+}
+EXPORT_SYMBOL(ledtrig_wifi_linkdown);
+
+static int __init ledtrig_network_init(void)
+{
+ led_trigger_register(&ledtrig_eth);
+ led_trigger_register(&ledtrig_wifi);
+ return 0;
+}
+
+static void __exit ledtrig_network_exit(void)
+{
+ led_trigger_unregister(&ledtrig_eth);
+ led_trigger_unregister(&ledtrig_wifi);
+}
+
+module_init(ledtrig_network_init);
+module_exit(ledtrig_network_exit);
+
+MODULE_AUTHOR("Memphiz <memphiz@kodi.tv>");
+MODULE_DESCRIPTION("LED Network link trigger");
+MODULE_LICENSE("GPL");
+
--
1.9.3 (Apple Git-50)

View File

@ -1,22 +0,0 @@
--- a/arch/arm/boot/dts/amlogic/wetek_play.dtd 2015-01-25 17:18:35.065137487 +0100
+++ b/arch/arm/boot/dts/amlogic/wetek_play.dtd 2015-01-25 17:18:09.601138239 +0100
@@ -1427,4 +1427,19 @@
reserve-memory = <0x00a00000>; // 1920 * 1088 * 4 = 8,355,840
reserve-iomap = "true";
};
+
+leds{
+ compatible = "amlogic,wetekplay-led";
+ powerled{
+ label = "wetek:blue:powerled";
+ };
+
+ wifiled{
+ label = "wetek:blue:wifiled";
+ };
+
+ ethled{
+ label = "wetek:blue:ethled";
+ };
+};
}; /* end of / */

View File

@ -1,82 +0,0 @@
From 8f08833d315afc65378d7f2e2b5704b46d68a099 Mon Sep 17 00:00:00 2001
From: Memphiz <memphis@machzwo.de>
Date: Sun, 8 Mar 2015 22:21:05 +0100
Subject: [PATCH 4/6] [WeTek_Play] - use new led trigger for signaling link
status of eth and wifi links
---
drivers/amlogic/ethernet/am_net8218.c | 14 ++++++++++++++
drivers/amlogic/wifi/broadcm_40181/wl_cfg80211.c | 12 ++++++++++++
2 files changed, 26 insertions(+)
diff --git a/drivers/amlogic/ethernet/am_net8218.c b/drivers/amlogic/ethernet/am_net8218.c
index aec2980..f5ced5a 100755
--- a/drivers/amlogic/ethernet/am_net8218.c
+++ b/drivers/amlogic/ethernet/am_net8218.c
@@ -55,6 +55,12 @@
#define DRV_NAME DRIVER_NAME
#define DRV_VERSION "v2.0.0"
+#ifdef CONFIG_LEDS_TRIGGER_NETWORK
+#include <linux/leds.h>
+extern void ledtrig_eth_linkup(struct led_classdev *led_cdev);
+extern void ledtrig_eth_linkdown(struct led_classdev *led_cdev);
+#endif
+
#undef CONFIG_HAS_EARLYSUSPEND
#ifdef CONFIG_HAS_EARLYSUSPEND
#include <linux/earlysuspend.h>
@@ -975,6 +981,14 @@ static void aml_adjust_link(struct net_device *dev)
return;
spin_lock_irqsave(&priv->lock, flags);
+
+#ifdef CONFIG_LEDS_TRIGGER_NETWORK
+ if (phydev->link)
+ ledtrig_eth_linkup(NULL);
+ else
+ ledtrig_eth_linkdown(NULL);
+#endif
+
if(phydev->phy_id == INTERNALPHY_ID){
val = (8<<27)|(7 << 24)|(1<<16)|(1<<15)|(1 << 13)|(1 << 12)|(4 << 4)|(0 << 1);
PERIPHS_SET_BITS(P_PREG_ETHERNET_ADDR0, val);
diff --git a/drivers/amlogic/wifi/broadcm_40181/wl_cfg80211.c b/drivers/amlogic/wifi/broadcm_40181/wl_cfg80211.c
index 5596f1d..e9f91d7 100755
--- a/drivers/amlogic/wifi/broadcm_40181/wl_cfg80211.c
+++ b/drivers/amlogic/wifi/broadcm_40181/wl_cfg80211.c
@@ -92,6 +92,12 @@
#define IW_WSEC_ENABLED(wsec) ((wsec) & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED))
#endif /* BCMWAPI_WPI */
+#ifdef CONFIG_LEDS_TRIGGER_NETWORK
+#include <linux/leds.h>
+extern void ledtrig_wifi_linkup(struct led_classdev *led_cdev);
+extern void ledtrig_wifi_linkdown(struct led_classdev *led_cdev);
+#endif
+
static struct device *cfg80211_parent_dev = NULL;
struct wl_priv *wlcfg_drv_priv = NULL;
u32 wl_dbg_level = WL_DBG_ERR;
@@ -11181,6 +11187,9 @@ static u32 wl_get_ielen(struct wl_priv *wl)
static void wl_link_up(struct wl_priv *wl)
{
wl->link_up = true;
+#ifdef CONFIG_LEDS_TRIGGER_NETWORK
+ ledtrig_wifi_linkup(NULL);
+#endif
}
static void wl_link_down(struct wl_priv *wl)
@@ -11191,6 +11200,9 @@ static void wl_link_down(struct wl_priv *wl)
wl->link_up = false;
conn_info->req_ie_len = 0;
conn_info->resp_ie_len = 0;
+#ifdef CONFIG_LEDS_TRIGGER_NETWORK
+ ledtrig_wifi_linkdown(NULL);
+#endif
}
static unsigned long wl_lock_eq(struct wl_priv *wl)
--
1.9.3 (Apple Git-50)