forked from openwrt/openwrt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mac80211: rt2x00: improve EEPROM load patches
Improve EEPROME load patches. Reorganize and rework them. The current patch are bugged and with the case of MTD loading, leaks and never free the EEPROM read values. Also add support for loading EEPROM using NVMEM cells. As a cleanup, change the binding to swap EEPROM read from mtd to ralink,eeprom-swap and generilize it. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
- Loading branch information
Showing
10 changed files
with
265 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...mac80211/patches/rt2x00/602-02-wifi-rt2x00-Add-option-to-pass-EEPROM-file-name-from.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
From 15329d8b206d9c04ffad49aecd37f5d0bfb85768 Mon Sep 17 00:00:00 2001 | ||
From: Christian Marangi <ansuelsmth@gmail.com> | ||
Date: Sun, 15 Oct 2023 14:23:19 +0200 | ||
Subject: [PATCH 2/5] wifi: rt2x00: Add option to pass EEPROM file name from DT | ||
|
||
Add option to pass EEPROM file name from DT using ralink,eeprom binding. | ||
|
||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> | ||
--- | ||
drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c | 11 +++++++++++ | ||
1 file changed, 11 insertions(+) | ||
|
||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c | ||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c | ||
@@ -10,6 +10,7 @@ | ||
|
||
#include <linux/kernel.h> | ||
#include <linux/module.h> | ||
+#include <linux/of.h> | ||
|
||
#include "rt2x00.h" | ||
#include "rt2x00soc.h" | ||
@@ -18,10 +19,20 @@ static const char * | ||
rt2x00lib_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev) | ||
{ | ||
struct rt2x00_platform_data *pdata = rt2x00dev->dev->platform_data; | ||
+#ifdef CONFIG_OF | ||
+ struct device_node *np; | ||
+ const char *eep; | ||
+#endif | ||
|
||
if (pdata && pdata->eeprom_file_name) | ||
return pdata->eeprom_file_name; | ||
|
||
+#ifdef CONFIG_OF | ||
+ np = rt2x00dev->dev->of_node; | ||
+ if (np && !of_property_read_string(np, "ralink,eeprom", &eep)) | ||
+ return eep; | ||
+#endif | ||
+ | ||
return NULL; | ||
} | ||
|
Oops, something went wrong.