wifi: ath9k: remove platform_data support
Subsystems (4)
cover wifi: ath9k: remove platform_data support
This series removes platform_data support as it's deprecated, unused, and replaced by OF. Some OF bindings were added to match (improve?) OF support in ath9k compared to platform_data.
Rosen Penev (5):
wifi: ath9k: eeprom: remove platform data
wifi: ath9k: btcoex: remove platform_data
wifi: ath9k: add extra options to of_init
dt-bindings: net: wireless: ath9k: add new options
wifi: ath9k: remove ath9k_platform_data
.../bindings/net/wireless/qca,ath9k.yaml | 12 ++++ .../wireless/ath/ath9k/ath9k_pci_owl_loader.c | 1 - drivers/net/wireless/ath/ath9k/btcoex.c | 16 +---- drivers/net/wireless/ath/ath9k/eeprom.c | 12 ---- drivers/net/wireless/ath/ath9k/hw.c | 2 +- drivers/net/wireless/ath/ath9k/init.c | 59 +++---------------- include/linux/ath9k_platform.h | 51 ---------------- 7 files changed, 25 insertions(+), 128 deletions(-) delete mode 100644 include/linux/ath9k_platform.h
Signature · 1 line
2.46.0
PATCH 1/5 wifi: ath9k: eeprom: remove platform data
There are no more board files defining platform data for this driver and eeprom support through NVMEM has already been implemented. No need to keep this old functionality around.
--- drivers/net/wireless/ath/ath9k/eeprom.c | 12 ------------ 1 file changed, 12 deletions(-)
drivers/net/wireless/ath/ath9k/eeprom.c +0 -12
@@ -15,7 +15,6 @@*/ #include "hw.h" -#include <linux/ath9k_platform.h> void ath9k_hw_analog_shift_regwrite (struct ath_hw *ah,u32 reg,u32 val) {
@@ -119,14 +118,6 @@ static bool ath9k_hw_nvram_read_array(u16 *blob, size_t blob_size,return true; } -static bool ath9k_hw_nvram_read_pdata (struct ath9k_platform_data *pdata, -off_t offset,u16 *data) -{ -return ath9k_hw_nvram_read_array (pdata->eeprom_data, -ARRAY_SIZE (pdata->eeprom_data), - offset, data); -} -static bool ath9k_hw_nvram_read_firmware (const struct firmware *eeprom_blob,off_t offset,u16 *data) {
@@ -146,15 +137,12 @@ static bool ath9k_hw_nvram_read_nvmem(struct ath_hw *ah, off_t offset,bool ath9k_hw_nvram_read (struct ath_hw *ah,u32 off,u16 *data) {struct ath_common *common =ath9k_hw_common (ah); -struct ath9k_platform_data *pdata = ah->dev->platform_data;bool ret;if (ah->nvmem_blob) ret =ath9k_hw_nvram_read_nvmem (ah, off, data);else if (ah->eeprom_blob) ret =ath9k_hw_nvram_read_firmware (ah->eeprom_blob, off, data); -else if (pdata && !pdata->use_eeprom) - ret =ath9k_hw_nvram_read_pdata (pdata, off, data);else ret = common->bus_ops->eeprom_read (common, off, data);
Signature · 1 line
2.46.0
PATCH 2/5 wifi: ath9k: btcoex: remove platform_data
In reply to Rosen PenevThis is completely unused as platform files are no longer used anywhere.
--- drivers/net/wireless/ath/ath9k/btcoex.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-)
drivers/net/wireless/ath/ath9k/btcoex.c +3 -13
@@ -16,7 +16,6 @@#include <linux/export.h> #include <linux/types.h> -#include <linux/ath9k_platform.h> #include "hw.h" enum ath_bt_mode {
@@ -115,23 +114,14 @@ static void ath9k_hw_btcoex_pin_init(struct ath_hw *ah, u8 wlanactive_gpio, u8 btactive_gpio, u8 btpriority_gpio) {struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; -struct ath9k_platform_data *pdata = ah->dev->platform_data;if (btcoex_hw->scheme !=ATH_BTCOEX_CFG_2WIRE && btcoex_hw->scheme !=ATH_BTCOEX_CFG_3WIRE )return ; -/* bt priority GPIO will be ignored by 2 wire scheme */ -if (pdata && (pdata->bt_active_pin || pdata->bt_priority_pin || - pdata->wlan_active_pin)) { - btcoex_hw->btactive_gpio = pdata->bt_active_pin; - btcoex_hw->wlanactive_gpio = pdata->wlan_active_pin; - btcoex_hw->btpriority_gpio = pdata->bt_priority_pin; - }else { - btcoex_hw->btactive_gpio = btactive_gpio; - btcoex_hw->wlanactive_gpio = wlanactive_gpio; - btcoex_hw->btpriority_gpio = btpriority_gpio; - } + btcoex_hw->btactive_gpio = btactive_gpio; + btcoex_hw->wlanactive_gpio = wlanactive_gpio; + btcoex_hw->btpriority_gpio = btpriority_gpio; }void ath9k_hw_btcoex_init_scheme (struct ath_hw *ah)
Signature · 1 line
2.46.0
PATCH 3/5 wifi: ath9k: add extra options to of_init
In reply to Rosen PenevThis is in preparation for removing platform_data support from ath9k. Except for led-active-high, these are already present downstream in OpenWrt and never upstreamed.
For tx_gain_buffalo, just set it based on the device. The flag was made for a single device. Instead of adding an extra option, just look for the compatible string.
--- drivers/net/wireless/ath/ath9k/init.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/wireless/ath/ath9k/init.c +7 -0
@@ -670,6 +670,7 @@ static int ath9k_of_init(struct ath_softc *sc)struct ath_common *common =ath9k_hw_common (ah);enum ath_bus_type bus_type = common->bus_ops->ath_bus_type;char eeprom_name[100 ]; +u8 led_pin;int ret;if (!of_device_is_available (np))
@@ -691,6 +692,12 @@ static int ath9k_of_init(struct ath_softc *sc) ah->ah_flags |=AH_NO_EEP_SWAP ; } +if (!of_property_read_u8 (np,"qca,led-pin" , &led_pin)) + ah->led_pin = led_pin; + + ah->config.led_active_high =of_property_read_bool (np,"qca,led-active-high" ); + ah->config.tx_gain_buffalo =of_device_is_compatible (np,"buffalo,wzr-hp-g450h" ); +of_get_mac_address (np, common->macaddr);return 0 ;
Signature · 1 line
2.46.0
Re: [PATCH 3/5] wifi: ath9k: add extra options to of_init
Quoted 8 lines · Rosen Penev
This is in preparation for removing
platform_datasupport from ath9k. Except for led-active-high, these are already present downstream in OpenWrt and never upstreamed.For
tx_gain_buffalo, just set it based on the device. The flag was made for a single device. Instead of adding an extra option, just look for the compatible string.
Bindings are before users.
Quoted 18 lines
Signed-off-by Rosen Penev <[email protected]>--- drivers/net/wireless/ath/ath9k/init.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/net/wireless/ath/ath9k/init.c +1
-0@@ -670,6 +670,7 @@ static int ath9k_of_init(struct ath_softc *sc)struct ath_common *common =ath9k_hw_common (ah);enum ath_bus_type bus_type = common->bus_ops->ath_bus_type;char eeprom_name[100 ]; +u8 led_pin;int ret;if (!of_device_is_available (np))
drivers/net/wireless/ath/ath9k/init.c static int ath9k_of_init(struct ath_softc *sc) · line 699
Quoted 8 lines
drivers/net/wireless/ath/ath9k/init.c +5
-0@@ -691,6 +692,12 @@ static int ath9k_of_init(struct ath_softc *sc) ah->ah_flags |=AH_NO_EEP_SWAP ; } +if (!of_property_read_u8 (np,"qca,led-pin" , &led_pin)) + ah->led_pin = led_pin; + + ah->config.led_active_high =of_property_read_bool (np,"qca,led-active-high" ); + ah->config.tx_gain_buffalo =of_device_is_compatible (np,"buffalo,wzr-hp-g450h" );
There is no such compatible.
Please run scripts/checkpatch.pl and fix reported warnings. Then please run scripts/checkpatch.pl --strict and (probably) fix more warnings. Some warnings can be ignored, especially from --strict run, but the code here looks like it needs a fix. Feel free to get in touch if the warning is not clear.
Best regards,
Krzysztof
Re: [PATCH 3/5] wifi: ath9k: add extra options to of_init
Quoted 34 lines · Krzysztof Kozlowski
Quoted 8 lines · Rosen Penev
This is in preparation for removing
platform_datasupport from ath9k. Except for led-active-high, these are already present downstream in OpenWrt and never upstreamed.For
tx_gain_buffalo, just set it based on the device. The flag was made for a single device. Instead of adding an extra option, just look for the compatible string.Bindings are before users.
Quoted 21 lines
Signed-off-by Rosen Penev <[email protected]>--- drivers/net/wireless/ath/ath9k/init.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/net/wireless/ath/ath9k/init.c +1
-0@@ -670,6 +670,7 @@ static int ath9k_of_init(struct ath_softc *sc)struct ath_common *common =ath9k_hw_common (ah);enum ath_bus_type bus_type = common->bus_ops->ath_bus_type;char eeprom_name[100 ]; +u8 led_pin;int ret;if (!of_device_is_available (np))@@ -691,6 +692,12 @@ static int ath9k_of_init(struct ath_softc *sc) ah->ah_flags |=AH_NO_EEP_SWAP ; }
Quoted 7 lines
drivers/net/wireless/ath/ath9k/init.c static int ath9k_of_init(struct ath_softc *sc) · line 699
Quoted 5 lines
drivers/net/wireless/ath/ath9k/init.c +5
-0+if (!of_property_read_u8 (np,"qca,led-pin" , &led_pin)) + ah->led_pin = led_pin; + + ah->config.led_active_high =of_property_read_bool (np,"qca,led-active-high" ); + ah->config.tx_gain_buffalo =of_device_is_compatible (np,"buffalo,wzr-hp-g450h" );There is no such compatible.
Correct. There is none at this time. As the commit message states, tx_gain_buffalo was introduced for this device and this device only. If it is to be upstreamed, this would be the name for it. OTOH, the device is old and probably can't run modern kernels comfortably. It might make sense to eventually remove this completely.
My goal with this commit is to match ath9k_platform_device capability to OF before removing it.
Quoted 10 lines
Please run
scripts/checkpatch.pland fix reported warnings. Then please runscripts/checkpatch.pl --strictand (probably) fix more warnings. Some warnings can be ignored, especially from --strict run, but the code here looks like it needs a fix. Feel free to get in touch if the warning is not clear.Best regards,
Krzysztof
PATCH 4/5 dt-bindings: net: wireless: ath9k: add new options
In reply to Rosen PenevThese platform_data options are now available for OF.
--- .../devicetree/bindings/net/wireless/qca,ath9k.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+)
Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml +12 -0
@@ -44,6 +44,16 @@ properties: ieee80211-freq-limit: true + qca,led-active-high: + $ref: /schemas/types.yaml#/definitions/flag + description: + Indicates that the LED pin is active high instead of low + + qca,led-pin: + $ref: /schemas/types.yaml#/definitions/uint8 + description: + Sets the GPIO number for the LED pin instead of the default + qca,no-eeprom: $ref: /schemas/types.yaml#/definitions/flag description:
@@ -75,6 +85,8 @@ examples: reg = <0 0 0 0 0>; interrupts = <3>; qca,no-eeprom; + qca,led-active-high; + qca,led-pin = /bits/ 8 <11>; }; }; - |
Signature · 1 line
2.46.0
Re: [PATCH 4/5] dt-bindings: net: wireless: ath9k: add new options
Quoted 1 line · Rosen Penev
These
platform_dataoptions are now available for OF.
This explains nothing. Describe the hardware, not driver.
Quoted 2 lines
Signed-off-by Rosen Penev <[email protected]>
<form letter>
Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC. It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.
Tools like b4 or scripts/get_maintainer.pl provide you proper list of people, so fix your workflow. Tools might also fail if you work on some ancient tree (don't, instead use mainline) or work on fork of kernel (don't, instead use mainline). Just use b4 and everything should be fine, although remember about b4 prep --auto-to-cc if you added new patches to the patchset.
You missed at least devicetree list (maybe more), so this won't be tested by automated tooling. Performing review on untested code might be a waste of time.
Please kindly resend and include all necessary To/Cc entries. </form letter>
Quoted 9 lines
--- .../devicetree/bindings/net/wireless/qca,ath9k.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+)Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml +0
-0
Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml properties: · line 50
Quoted 7 lines
Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml +4
-0@@ -44,6 +44,16 @@ properties: ieee80211-freq-limit: true + qca,led-active-high: + $ref: /schemas/types.yaml#/definitions/flag + description: + Indicates that the LED pin is active high instead of low
Where is DTS user of it?
Best regards,
Krzysztof
Re: [PATCH 4/5] dt-bindings: net: wireless: ath9k: add new options
Quoted 22 lines · Krzysztof Kozlowski
Quoted 1 line · Rosen Penev
These
platform_dataoptions are now available for OF.This explains nothing. Describe the hardware, not driver.
Quoted 2 lines
Signed-off-by Rosen Penev <[email protected]><form letter>
Please usescripts/get_maintainers.plto get a list of necessary people and lists to CC. It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.Tools like b4 or
scripts/get_maintainer.plprovide you proper list of people, so fix your workflow. Tools might also fail if you work on some ancient tree (don't, instead use mainline) or work on fork of kernel (don't, instead use mainline). Just use b4 and everything should be fine, although remember aboutb4 prep --auto-to-ccif you added new patches to the patchset.
Quoted 5 lines
You missed at least devicetree list (maybe more), so this won't be tested by automated tooling. Performing review on untested code might be a waste of time.
Please kindly resend and include all necessary To/Cc entries.
Will do.
Quoted 12 lines
</form letter>
Quoted 10 lines
--- .../devicetree/bindings/net/wireless/qca,ath9k.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+)Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml +0
-0@@ -44,6 +44,16 @@ properties:
Quoted 8 lines
Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml properties: · line 50
Quoted 6 lines
Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml +4
-0ieee80211-freq-limit: true + qca,led-active-high: + $ref: /schemas/types.yaml#/definitions/flag + description: + Indicates that the LED pin is active high instead of lowWhere is DTS user of it?
None at this time. There are only downstream users.
This maps to the led_active_high in ath9k_platform_device , which gets removed in a subsequent commit.
drivers/net/wireless/mediatek/mt76/mac80211.c uses led-sources as the name for the same purpose. Maybe rename?
Quoted 4 lines
Best regards,
Krzysztof
Re: [PATCH 4/5] dt-bindings: net: wireless: ath9k: add new options
Quoted 43 lines · Rosen Penev
Quoted 22 lines · Krzysztof Kozlowski
Quoted 1 line · Rosen Penev
These
platform_dataoptions are now available for OF.This explains nothing. Describe the hardware, not driver.
Quoted 2 lines
Signed-off-by Rosen Penev <[email protected]><form letter>
Please usescripts/get_maintainers.plto get a list of necessary people and lists to CC. It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.Tools like b4 or
scripts/get_maintainer.plprovide you proper list of people, so fix your workflow. Tools might also fail if you work on some ancient tree (don't, instead use mainline) or work on fork of kernel (don't, instead use mainline). Just use b4 and everything should be fine, although remember aboutb4 prep --auto-to-ccif you added new patches to the patchset.Quoted 5 lines
You missed at least devicetree list (maybe more), so this won't be tested by automated tooling. Performing review on untested code might be a waste of time.
Please kindly resend and include all necessary To/Cc entries.
Will do.
Quoted 14 lines
</form letter>
Quoted 12 lines
--- .../devicetree/bindings/net/wireless/qca,ath9k.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+)Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml +0
-0@@ -44,6 +44,16 @@ properties: ieee80211-freq-limit: true
Quoted 7 lines
Quoted 6 lines
Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml properties: · line 50
Quoted 4 lines
Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml +4
-0+ qca,led-active-high: + $ref: /schemas/types.yaml#/definitions/flag + description: + Indicates that the LED pin is active high instead of lowWhere is DTS user of it?
None at this time. There are only downstream users.
We do not add stuff for downstream.
Quoted 6 lines
This maps to the
led_active_highinath9k_platform_device, which gets removed in a subsequent commit.
drivers/net/wireless/mediatek/mt76/mac80211.cuses led-sources as the name for the same purpose. Maybe rename?
Again, you add undocumented, unused compatibles along with unused properties. We don't care about downstream kernels. You need upstream users.
Best regards,
Krzysztof
Re: [PATCH 4/5] dt-bindings: net: wireless: ath9k: add new options
Quoted 56 lines · Krzysztof Kozlowski
Quoted 43 lines · Rosen Penev
Quoted 22 lines · Krzysztof Kozlowski
Quoted 1 line · Rosen Penev
These
platform_dataoptions are now available for OF.This explains nothing. Describe the hardware, not driver.
Quoted 2 lines
Signed-off-by Rosen Penev <[email protected]><form letter>
Please usescripts/get_maintainers.plto get a list of necessary people and lists to CC. It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.Tools like b4 or
scripts/get_maintainer.plprovide you proper list of people, so fix your workflow. Tools might also fail if you work on some ancient tree (don't, instead use mainline) or work on fork of kernel (don't, instead use mainline). Just use b4 and everything should be fine, although remember aboutb4 prep --auto-to-ccif you added new patches to the patchset.Quoted 5 lines
You missed at least devicetree list (maybe more), so this won't be tested by automated tooling. Performing review on untested code might be a waste of time.
Please kindly resend and include all necessary To/Cc entries.
Will do.
Quoted 14 lines
</form letter>
Quoted 12 lines
--- .../devicetree/bindings/net/wireless/qca,ath9k.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+)Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml +0
-0@@ -44,6 +44,16 @@ properties: ieee80211-freq-limit: trueQuoted 7 lines
Quoted 6 lines
Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml properties: · line 50
Quoted 4 lines
Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml +4
-0+ qca,led-active-high: + $ref: /schemas/types.yaml#/definitions/flag + description: + Indicates that the LED pin is active high instead of lowWhere is DTS user of it?
None at this time. There are only downstream users.
We do not add stuff for downstream.
Quoted 1 line
Quoted 8 lines
Quoted 5 lines
This maps to the
led_active_highinath9k_platform_device, which gets removed in a subsequent commit.
drivers/net/wireless/mediatek/mt76/mac80211.cuses led-sources as the name for the same purpose. Maybe rename?Again, you add undocumented, unused compatibles along with unused properties. We don't care about downstream kernels. You need upstream users.
OK. Will remove in v2.
Quoted 4 lines
Best regards,
Krzysztof
Re: [PATCH 4/5] dt-bindings: net: wireless: ath9k: add new options
In reply to Rosen PenevQuoted 12 lines · Rosen Penev
These
platform_dataoptions are now available for OF.Signed-off-by Rosen Penev <[email protected]>--- .../devicetree/bindings/net/wireless/qca,ath9k.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+)Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml +0
-0
Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml properties: · line 52
Quoted 9 lines
Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml +6
-0@@ -44,6 +44,16 @@ properties: ieee80211-freq-limit: true + qca,led-active-high: + $ref: /schemas/types.yaml#/definitions/flag + description: + Indicates that the LED pin is active high instead of low + + qca,led-pin:
So this all looks like re-inventing standard GPIOs, at least for devices using GPIOLIB. Your commit msg needs proper rationale.
Best regards,
Krzysztof
Re: [PATCH 4/5] dt-bindings: net: wireless: ath9k: add new options
Quoted 17 lines · Krzysztof Kozlowski
Quoted 15 lines · Rosen Penev
These
platform_dataoptions are now available for OF.Signed-off-by Rosen Penev <[email protected]>--- .../devicetree/bindings/net/wireless/qca,ath9k.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+)Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml +0
-0@@ -44,6 +44,16 @@ properties: ieee80211-freq-limit: true
Quoted 9 lines
Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml properties: · line 52
Quoted 6 lines
Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml +6
-0+ qca,led-active-high: + $ref: /schemas/types.yaml#/definitions/flag + description: + Indicates that the LED pin is active high instead of low + + qca,led-pin:So this all looks like re-inventing standard GPIOs, at least for devices using GPIOLIB. Your commit msg needs proper rationale.
git grep led_classdev_register drivers/net/wireless/ | wc -l 16
Both old and new drivers register their own GPIO devices to control LEDs.
Quoted 4 lines
Best regards,
Krzysztof
PATCH 5/5 wifi: ath9k: remove ath9k_platform_data
In reply to Rosen PenevCompletely unused here in favor of Device Tree based setup. The DT code in here should currently match what is available with platform files. Any such lapse can always be added.
--- .../wireless/ath/ath9k/ath9k_pci_owl_loader.c | 1 - drivers/net/wireless/ath/ath9k/hw.c | 2 +- drivers/net/wireless/ath/ath9k/init.c | 52 +------------------ include/linux/ath9k_platform.h | 51 ------------------ 4 files changed, 3 insertions(+), 103 deletions(-) delete mode 100644 include/linux/ath9k_platform.h
drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c +0 -1
@@ -18,7 +18,6 @@#include <linux/pci.h> #include <linux/delay.h> #include <linux/platform_device.h> -#include <linux/ath9k_platform.h> #include <linux/nvmem-consumer.h> #include <linux/workqueue.h>
drivers/net/wireless/ath/ath9k/hw.c +1 -1
@@ -490,7 +490,7 @@ static void ath9k_hw_init_macaddr(struct ath_hw *ah)u16 eeval;static const u32 EEP_MAC [] = {EEP_MAC_LSW ,EEP_MAC_MID ,EEP_MAC_MSW }; -/* MAC address may already be loaded via ath9k_platform_data */ +/* MAC address may already be loaded via NVMEM */ if (is_valid_ether_addr (common->macaddr))return ;
drivers/net/wireless/ath/ath9k/init.c +2 -50
76 lines not on this page · raw message
include/linux/ath9k_platform.h deleted +0 -51
51 lines not on this page · raw message
Signature · 1 line
2.46.0