From 6a533903e7b8833310e8ee346f3d102259020c4c Mon Sep 17 00:00:00 2001
From: Gabor Juhos <juhosg@openwrt.org>
Date: Mon, 4 Apr 2011 09:03:33 +0000
Subject: mac80211: move 620-rt2x00_soc_led_support.patch to the correct place

* fixes [26463]

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26467 3c298f89-4303-0410-b956-a3cf2f4a3e73
---
 mac80211/patches/620-rt2x00_soc_led_support.patch  | 75 ----------------------
 .../patches/620-rt2x00_soc_led_support.patch       | 75 ++++++++++++++++++++++
 2 files changed, 75 insertions(+), 75 deletions(-)
 delete mode 100644 mac80211/patches/620-rt2x00_soc_led_support.patch
 create mode 100644 package/mac80211/patches/620-rt2x00_soc_led_support.patch

diff --git a/mac80211/patches/620-rt2x00_soc_led_support.patch b/mac80211/patches/620-rt2x00_soc_led_support.patch
deleted file mode 100644
index 2b87b346d3..0000000000
--- a/mac80211/patches/620-rt2x00_soc_led_support.patch
+++ /dev/null
@@ -1,75 +0,0 @@
---- a/drivers/net/wireless/rt2x00/rt2800lib.c
-+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
-@@ -935,6 +935,7 @@
- static void rt2800_brightness_set(struct led_classdev *led_cdev,
- 				  enum led_brightness brightness)
- {
-+	u32 reg;
- 	struct rt2x00_led *led =
- 	    container_of(led_cdev, struct rt2x00_led, led_dev);
- 	unsigned int enabled = brightness != LED_OFF;
-@@ -947,24 +948,46 @@
- 		rt2x00_get_field16(led->rt2x00dev->led_mcu_reg,
- 				   EEPROM_FREQ_LED_MODE);
-
--	if (led->type == LED_TYPE_RADIO) {
--		rt2800_mcu_request(led->rt2x00dev, MCU_LED, 0xff, ledmode,
--				      enabled ? 0x20 : 0);
--	} else if (led->type == LED_TYPE_ASSOC) {
--		rt2800_mcu_request(led->rt2x00dev, MCU_LED, 0xff, ledmode,
--				      enabled ? (bg_mode ? 0x60 : 0xa0) : 0x20);
--	} else if (led->type == LED_TYPE_QUALITY) {
--		/*
--		 * The brightness is divided into 6 levels (0 - 5),
--		 * The specs tell us the following levels:
--		 *	0, 1 ,3, 7, 15, 31
--		 * to determine the level in a simple way we can simply
--		 * work with bitshifting:
--		 *	(1 << level) - 1
--		 */
--		rt2800_mcu_request(led->rt2x00dev, MCU_LED_STRENGTH, 0xff,
--				      (1 << brightness / (LED_FULL / 6)) - 1,
--				      polarity);
-+	/* Check for SoC (SOC devices don't support MCU requests) */
-+	if (rt2x00_is_soc(led->rt2x00dev)) {
-+		rt2800_register_read(led->rt2x00dev, LED_CFG, &reg);
-+
-+		/* Set LED Polarity */
-+		rt2x00_set_field32(&reg, LED_CFG_LED_POLAR, polarity);
-+
-+		/* Set LED Mode */
-+		if (led->type == LED_TYPE_RADIO) {
-+			rt2x00_set_field32(&reg, LED_CFG_G_LED_MODE,
-+					   enabled ? 3 : 0);
-+		} else if (led->type == LED_TYPE_ASSOC) {
-+			rt2x00_set_field32(&reg, LED_CFG_Y_LED_MODE,
-+					   enabled ? 3 : 0);
-+		} else if (led->type == LED_TYPE_QUALITY) {
-+			rt2x00_set_field32(&reg, LED_CFG_R_LED_MODE,
-+					   enabled ? 3 : 0);
-+		}
-+		rt2800_register_write(led->rt2x00dev, LED_CFG, reg);
-+	}
-+	else {
-+		if (led->type == LED_TYPE_RADIO) {
-+			rt2800_mcu_request(led->rt2x00dev, MCU_LED, 0xff, ledmode,
-+					enabled ? 0x20 : 0);
-+		} else if (led->type == LED_TYPE_ASSOC) {
-+			rt2800_mcu_request(led->rt2x00dev, MCU_LED, 0xff, ledmode,
-+					enabled ? (bg_mode ? 0x60 : 0xa0) : 0x20);
-+		} else if (led->type == LED_TYPE_QUALITY) {
-+			/*
-+			* The brightness is divided into 6 levels (0 - 5),
-+			* The specs tell us the following levels:
-+			*	0, 1 ,3, 7, 15, 31
-+			* to determine the level in a simple way we can simply
-+			* work with bitshifting:
-+			*	(1 << level) - 1
-+			*/
-+			rt2800_mcu_request(led->rt2x00dev, MCU_LED_STRENGTH, 0xff,
-+					(1 << brightness / (LED_FULL / 6)) - 1,
-+					polarity);
-+		}
- 	}
- }
-
diff --git a/package/mac80211/patches/620-rt2x00_soc_led_support.patch b/package/mac80211/patches/620-rt2x00_soc_led_support.patch
new file mode 100644
index 0000000000..2b87b346d3
--- /dev/null
+++ b/package/mac80211/patches/620-rt2x00_soc_led_support.patch
@@ -0,0 +1,75 @@
+--- a/drivers/net/wireless/rt2x00/rt2800lib.c
++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
+@@ -935,6 +935,7 @@
+ static void rt2800_brightness_set(struct led_classdev *led_cdev,
+ 				  enum led_brightness brightness)
+ {
++	u32 reg;
+ 	struct rt2x00_led *led =
+ 	    container_of(led_cdev, struct rt2x00_led, led_dev);
+ 	unsigned int enabled = brightness != LED_OFF;
+@@ -947,24 +948,46 @@
+ 		rt2x00_get_field16(led->rt2x00dev->led_mcu_reg,
+ 				   EEPROM_FREQ_LED_MODE);
+
+-	if (led->type == LED_TYPE_RADIO) {
+-		rt2800_mcu_request(led->rt2x00dev, MCU_LED, 0xff, ledmode,
+-				      enabled ? 0x20 : 0);
+-	} else if (led->type == LED_TYPE_ASSOC) {
+-		rt2800_mcu_request(led->rt2x00dev, MCU_LED, 0xff, ledmode,
+-				      enabled ? (bg_mode ? 0x60 : 0xa0) : 0x20);
+-	} else if (led->type == LED_TYPE_QUALITY) {
+-		/*
+-		 * The brightness is divided into 6 levels (0 - 5),
+-		 * The specs tell us the following levels:
+-		 *	0, 1 ,3, 7, 15, 31
+-		 * to determine the level in a simple way we can simply
+-		 * work with bitshifting:
+-		 *	(1 << level) - 1
+-		 */
+-		rt2800_mcu_request(led->rt2x00dev, MCU_LED_STRENGTH, 0xff,
+-				      (1 << brightness / (LED_FULL / 6)) - 1,
+-				      polarity);
++	/* Check for SoC (SOC devices don't support MCU requests) */
++	if (rt2x00_is_soc(led->rt2x00dev)) {
++		rt2800_register_read(led->rt2x00dev, LED_CFG, &reg);
++
++		/* Set LED Polarity */
++		rt2x00_set_field32(&reg, LED_CFG_LED_POLAR, polarity);
++
++		/* Set LED Mode */
++		if (led->type == LED_TYPE_RADIO) {
++			rt2x00_set_field32(&reg, LED_CFG_G_LED_MODE,
++					   enabled ? 3 : 0);
++		} else if (led->type == LED_TYPE_ASSOC) {
++			rt2x00_set_field32(&reg, LED_CFG_Y_LED_MODE,
++					   enabled ? 3 : 0);
++		} else if (led->type == LED_TYPE_QUALITY) {
++			rt2x00_set_field32(&reg, LED_CFG_R_LED_MODE,
++					   enabled ? 3 : 0);
++		}
++		rt2800_register_write(led->rt2x00dev, LED_CFG, reg);
++	}
++	else {
++		if (led->type == LED_TYPE_RADIO) {
++			rt2800_mcu_request(led->rt2x00dev, MCU_LED, 0xff, ledmode,
++					enabled ? 0x20 : 0);
++		} else if (led->type == LED_TYPE_ASSOC) {
++			rt2800_mcu_request(led->rt2x00dev, MCU_LED, 0xff, ledmode,
++					enabled ? (bg_mode ? 0x60 : 0xa0) : 0x20);
++		} else if (led->type == LED_TYPE_QUALITY) {
++			/*
++			* The brightness is divided into 6 levels (0 - 5),
++			* The specs tell us the following levels:
++			*	0, 1 ,3, 7, 15, 31
++			* to determine the level in a simple way we can simply
++			* work with bitshifting:
++			*	(1 << level) - 1
++			*/
++			rt2800_mcu_request(led->rt2x00dev, MCU_LED_STRENGTH, 0xff,
++					(1 << brightness / (LED_FULL / 6)) - 1,
++					polarity);
++		}
+ 	}
+ }
+
-- 
cgit v1.2.3