OpenPandora: make wl1251 connected to mmc3 sdio port of OpenPandora work again
Subsystems (11)
v3 cover OpenPandora: make wl1251 connected to mmc3 sdio port of OpenPandora work again
* add a revisit note for special wl1251 handling code because it should
be solved more generic in mmc core - suggested by Ulf Hansson <[email protected]>
* remove init_card callback from platform_data/hsmmc-omap.h - suggested by Ulf Hansson <[email protected]>
* remove obstructive always-on for vwlan regulator - suggested by Ulf Hansson <[email protected]>
* rename DT node - suggested by Rob Herring <[email protected]>
* fix ARM: dts: subject prefix - suggested by Tony Lindgren <[email protected]>
* also remove omap2_hsmmc_info and obc-y line in Makefile - suggested by Tony Lindgren <[email protected]>
PATCH V2 2019-10-19 20:41:47:
* added acked-by for wl1251 patches - Kalle Valo <[email protected]>
* really removed old pdata-quirks code (not through #if 0)
* splited out a partial revert of
efdfeb079cc3b ("regulator: fixed: Convert to use GPIO descriptor only")
because that was introduced after v4.19 and stops the removal of the pdata-quirks patch from cleanly applying to v4.9, v4.14, v4.19
- reported by Sasha Levin <[email protected]>
* added a new patch to remove old omap hsmmc since pdata quirks were last user - suggested by Tony Lindgren <[email protected]>
PATCH V1 2019-10-18 22:25:39:
Here we have a set of scattered patches to make the OpenPandora WiFi work again.
v4.7 did break the pdata-quirks which made the mmc3 interface fail completely, because some code now assumes device tree based instantiation.
v4.11 did break the sdio qirks for wl1251 which made the driver no longer load, although the device was found as an sdio client.
To solve these issues:
* we convert mmc3 and wl1251 initialization from pdata-quirks to device tree
* we make the wl1251 driver read properties from device tree
* we fix the mmc core vendor ids and quirks
* we fix the wl1251 (and wl1271) driver to use only vendor ids from header file instead of (potentially conflicting) local definitions
H. Nikolaus Schaller (12):
Documentation: dt: wireless: update wl1251 for sdio
net: wireless: ti: wl1251 add device tree support
ARM: dts: pandora-common: define wl1251 as child node of mmc3
mmc: host: omap_hsmmc: add code for special init of wl1251 to get rid
of pandora_wl1251_init_card
omap: pdata-quirks: revert pandora specific gpiod additions
omap: pdata-quirks: remove openpandora quirks for mmc3 and wl1251
omap: remove omap2_hsmmc_info in old hsmmc.[ch] and update Makefile
mmc: host: omap-hsmmc: remove init_card pdata callback from pdata
mmc: sdio: fix wl1251 vendor id
mmc: core: fix wl1251 sdio quirks
net: wireless: ti: wl1251 use new SDIO_VENDOR_ID_TI_WL1251 definition
net: wireless: ti: remove local VENDOR_ID and DEVICE_ID definitions
.../bindings/net/wireless/ti,wl1251.txt | 26 +++ arch/arm/boot/dts/omap3-pandora-common.dtsi | 36 +++- arch/arm/mach-omap2/Makefile | 3 - arch/arm/mach-omap2/common.h | 1 - arch/arm/mach-omap2/hsmmc.c | 171 ------------------ arch/arm/mach-omap2/hsmmc.h | 32 ---- arch/arm/mach-omap2/pdata-quirks.c | 105 ----------- drivers/mmc/core/quirks.h | 7 + drivers/mmc/host/omap_hsmmc.c | 30 ++- drivers/net/wireless/ti/wl1251/sdio.c | 23 ++- drivers/net/wireless/ti/wlcore/sdio.c | 8 - include/linux/mmc/sdio_ids.h | 2 + include/linux/platform_data/hsmmc-omap.h | 3 - 13 files changed, 111 insertions(+), 336 deletions(-) delete mode 100644 arch/arm/mach-omap2/hsmmc.c delete mode 100644 arch/arm/mach-omap2/hsmmc.h
Signature · 1 line
2.23.0
PATCH v3 1/12 Documentation: dt: wireless: update wl1251 for sdio
The standard method for sdio devices connected to an sdio interface is to define them as a child node like we can see with wlcore.
--- .../bindings/net/wireless/ti,wl1251.txt | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+)
Documentation/devicetree/bindings/net/wireless/ti,wl1251.txt +26 -0
@@ -35,3 +35,29 @@ Examples: ti,power-gpio = <&gpio3 23 GPIO_ACTIVE_HIGH>; /* 87 */ }; }; + +&mmc3 { + vmmc-supply = <&wlan_en>; + + bus-width = <4>; + non-removable; + ti,non-removable; + cap-power-off-card; + + pinctrl-names = "default"; + pinctrl-0 = <&mmc3_pins>; + + #address-cells = <1>; + #size-cells = <0>; + + wlan: wifi@1 { + compatible = "ti,wl1251"; + + reg = <1>; + + interrupt-parent = <&gpio1>; + interrupts = <21 IRQ_TYPE_LEVEL_HIGH>; /* GPIO_21 */ + + ti,wl1251-has-eeprom; + }; +};
Signature · 1 line
2.23.0
Re: [PATCH v3 01/12] Documentation: dt: wireless: update wl1251 for sdio
Quoted 10 lines · H. Nikolaus Schaller
The standard method for sdio devices connected to an sdio interface is to define them as a child node like we can see with wlcore.
Signed-off-by H. Nikolaus Schaller <[email protected]>Acked-by Kalle Valo <[email protected]>--- .../bindings/net/wireless/ti,wl1251.txt | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+)
Re: [PATCH v3 01/12] Documentation: dt: wireless: update wl1251 for sdio
In reply to H. Nikolaus SchallerQuoted 35 lines · H. Nikolaus Schaller
The standard method for sdio devices connected to an sdio interface is to define them as a child node like we can see with wlcore.
Signed-off-by H. Nikolaus Schaller <[email protected]>Acked-by Kalle Valo <[email protected]>--- .../bindings/net/wireless/ti,wl1251.txt | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+)Documentation/devicetree/bindings/net/wireless/ti,wl1251.txt +16
-0@@ -35,3 +35,29 @@ Examples: ti,power-gpio = <&gpio3 23 GPIO_ACTIVE_HIGH>; /* 87 */ }; }; + +&mmc3 { + vmmc-supply = <&wlan_en>; + + bus-width = <4>; + non-removable; + ti,non-removable; + cap-power-off-card; + + pinctrl-names = "default"; + pinctrl-0 = <&mmc3_pins>; + + #address-cells = <1>; + #size-cells = <0>; + + wlan: wifi@1 {
Documentation/devicetree/bindings/net/wireless/ti,wl1251.txt Examples: · line 63
Quoted 10 lines
Documentation/devicetree/bindings/net/wireless/ti,wl1251.txt +10
-0+ compatible = "ti,wl1251"; + + reg = <1>; + + interrupt-parent = <&gpio1>; + interrupts = <21 IRQ_TYPE_LEVEL_HIGH>; /* GPIO_21 */ + + ti,wl1251-has-eeprom; + }; +};
One minor thing, the "ti,power-gpio" is not required anymore, as it's not needed for the SDIO case for pandora.
Please move it to an option section.
Kind regards
Uffe
PATCH v3 2/12 net: wireless: ti: wl1251 add device tree support
In reply to H. Nikolaus SchallerWe will have the wl1251 defined as a child node of the mmc interface and can read setup for gpios, interrupts and the ti,use-eeprom property from there instead of pdata to be provided by pdata-quirks.
--- drivers/net/wireless/ti/wl1251/sdio.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/net/wireless/ti/wl1251/sdio.c +13 -0
@@ -16,6 +16,9 @@#include <linux/irq.h> #include <linux/pm_runtime.h> #include <linux/gpio.h> +#include <linux/of.h> +#include <linux/of_gpio.h> +#include <linux/of_irq.h> #include "wl1251.h"
@@ -217,6 +220,7 @@ static int wl1251_sdio_probe(struct sdio_func *func,struct ieee80211_hw *hw;struct wl1251_sdio *wl_sdio;const struct wl1251_platform_data *wl1251_board_data; +struct device_node *np = func->dev.of_node; hw =wl1251_alloc_hw ();if (IS_ERR (hw))
@@ -248,6 +252,15 @@ static int wl1251_sdio_probe(struct sdio_func *func, wl->power_gpio = wl1251_board_data->power_gpio; wl->irq = wl1251_board_data->irq; wl->use_eeprom = wl1251_board_data->use_eeprom; + }else if (np) { + wl->use_eeprom =of_property_read_bool (np,"ti,wl1251-has-eeprom" ); + wl->power_gpio =of_get_named_gpio (np,"ti,power-gpio" ,0 ); + wl->irq =of_irq_get (np,0 ); + +if (wl->power_gpio == -EPROBE_DEFER || wl->irq == -EPROBE_DEFER ) { + ret = -EPROBE_DEFER ; + goto disable; + } }if (gpio_is_valid (wl->power_gpio)) {
Signature · 1 line
2.23.0
Re: [PATCH v3 02/12] net: wireless: ti: wl1251 add device tree support
Quoted 36 lines · H. Nikolaus Schaller
We will have the wl1251 defined as a child node of the mmc interface and can read setup for gpios, interrupts and the ti,use-eeprom property from there instead of pdata to be provided by pdata-quirks.
Fixes 81eef6ca9201 ("mmc: omap_hsmmc: Use dma_request_chan() for requesting DMA channel")Signed-off-by H. Nikolaus Schaller <[email protected]>Acked-by Kalle Valo <[email protected]>--- drivers/net/wireless/ti/wl1251/sdio.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)drivers/net/wireless/ti/wl1251/sdio.c +4
-0@@ -16,6 +16,9 @@#include <linux/irq.h> #include <linux/pm_runtime.h> #include <linux/gpio.h> +#include <linux/of.h> +#include <linux/of_gpio.h> +#include <linux/of_irq.h> #include "wl1251.h" @@ -217,6 +220,7 @@ static int wl1251_sdio_probe(struct sdio_func *func,struct ieee80211_hw *hw;struct wl1251_sdio *wl_sdio;const struct wl1251_platform_data *wl1251_board_data; +struct device_node *np = func->dev.of_node; hw =wl1251_alloc_hw ();if (IS_ERR (hw))
drivers/net/wireless/ti/wl1251/sdio.c static int wl1251_sdio_probe(struct sdio_func *func, · line 257
Quoted 6 lines
drivers/net/wireless/ti/wl1251/sdio.c +3
-0@@ -248,6 +252,15 @@ static int wl1251_sdio_probe(struct sdio_func *func, wl->power_gpio = wl1251_board_data->power_gpio; wl->irq = wl1251_board_data->irq; wl->use_eeprom = wl1251_board_data->use_eeprom; + }else if (np) { + wl->use_eeprom =of_property_read_bool (np,"ti,wl1251-has-eeprom" ); + wl->power_gpio =of_get_named_gpio (np,"ti,power-gpio" ,0 );
This isn't needed as it seems. Perhaps remove or keep it as optional?
drivers/net/wireless/ti/wl1251/sdio.c static int wl1251_sdio_probe(struct sdio_func *func,
Quoted 10 lines
drivers/net/wireless/ti/wl1251/sdio.c +6
-1+ wl->irq =of_irq_get (np,0 ); + +if (wl->power_gpio == -EPROBE_DEFER || wl->irq == -EPROBE_DEFER ) { + ret = -EPROBE_DEFER ; + goto disable; + } }if (gpio_is_valid (wl->power_gpio)) { --
Kind regards
Uffe
PATCH v3 3/12 ARM: dts: pandora-common: define wl1251 as child node of mmc3
In reply to H. Nikolaus SchallerSince v4.7 the dma initialization requires that there is a device tree property for "rx" and "tx" channels which is not provided by the pdata-quirks initialization.
By conversion of the mmc3 setup to device tree this will finally allows to remove the OpenPandora wlan specific omap3 data-quirks.
--- arch/arm/boot/dts/omap3-pandora-common.dtsi | 36 +++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-)
arch/arm/boot/dts/omap3-pandora-common.dtsi +34 -2
@@ -226,6 +226,17 @@ gpio = <&gpio6 4 GPIO_ACTIVE_HIGH>; /* GPIO_164 */ }; + /* wl1251 wifi+bt module */ + wlan_en: fixed-regulator-wg7210_en { + compatible = "regulator-fixed"; + regulator-name = "vwlan"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + startup-delay-us = <50000>; + enable-active-high; + gpio = <&gpio1 23 GPIO_ACTIVE_HIGH>; + }; + /* wg7210 (wifi+bt module) 32k clock buffer */ wg7210_32k: fixed-regulator-wg7210_32k { compatible = "regulator-fixed";
@@ -522,9 +533,30 @@ /*wp-gpios = <&gpio4 31 GPIO_ACTIVE_HIGH>;*/ /* GPIO_127 */ }; -/* mmc3 is probed using pdata-quirks to pass wl1251 card data */ &mmc3 { - status = "disabled"; + vmmc-supply = <&wlan_en>; + + bus-width = <4>; + non-removable; + ti,non-removable; + cap-power-off-card; + + pinctrl-names = "default"; + pinctrl-0 = <&mmc3_pins>; + + #address-cells = <1>; + #size-cells = <0>; + + wlan: wifi@1 { + compatible = "ti,wl1251"; + + reg = <1>; + + interrupt-parent = <&gpio1>; + interrupts = <21 IRQ_TYPE_LEVEL_HIGH>; /* GPIO_21 */ + + ti,wl1251-has-eeprom; + }; }; /* bluetooth*/
Signature · 1 line
2.23.0
Re: [PATCH v3 03/12] ARM: dts: pandora-common: define wl1251 as child node of mmc3
Quoted 9 lines · H. Nikolaus Schaller
Since v4.7 the dma initialization requires that there is a device tree property for "rx" and "tx" channels which is not provided by the pdata-quirks initialization.
By conversion of the mmc3 setup to device tree this will finally allows to remove the OpenPandora wlan specific omap3 data-quirks.
Fixes 81eef6ca9201 ("mmc: omap_hsmmc: Use dma_request_chan() for requesting DMA channel")
Probably best to queue this all via the mmc tree when no more comments:
PATCH v3 4/12 mmc: host: omap_hsmmc: add code for special init of wl1251 to get rid of pandora_wl1251_init_card
In reply to H. Nikolaus SchallerPandora_wl1251_init_card was used to do special pdata based setup of the sdio mmc interface. This does no longer work with v4.7 and later. A fix requires a device tree based mmc3 setup.
Therefore we move the special setup to omap_hsmmc.c instead of calling some pdata supplied init_card function.
The new code checks for a DT child node compatible to wl1251 so it will not affect other MMC3 use cases.
Generally, this code was and still is a hack and should be moved to mmc core to e.g. read such properties from optional DT child nodes.
--- drivers/mmc/host/omap_hsmmc.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
drivers/mmc/host/omap_hsmmc.c +28 -0
@@ -1512,6 +1512,34 @@ static void omap_hsmmc_init_card(struct mmc_host *mmc, struct mmc_card *card)if (mmc_pdata (host)->init_card)mmc_pdata (host)->init_card (card); +else if (card->type ==MMC_TYPE_SDIO || card->type ==MMC_TYPE_SD_COMBO ) { +struct device_node *np =mmc_dev (mmc)->of_node; + +/* +* REVISIT: should be moved to sdio core and made more +* general e.g. by expanding the DT bindings of child nodes +* to provide a mechanism to provide this information: +* Documentation/devicetree/bindings/mmc/mmc-card.txt +*/ + + np =of_get_compatible_child (np,"ti,wl1251" ); +if (np) { +/* +* We have TI wl1251 attached to MMC3. Pass this information to +* SDIO core because it can't be probed by normal methods. +*/ + +dev_info (host->dev,"found wl1251\n" ); + card->quirks |=MMC_QUIRK_NONSTD_SDIO ; + card->cccr.wide_bus =1 ; + card->cis.vendor =0x104c ; + card->cis.device =0x9066 ; + card->cis.blksize =512 ; + card->cis.max_dtr =24000000 ; + card->ocr =0x80 ; +of_node_put (np); + } + } }static void omap_hsmmc_enable_sdio_irq (struct mmc_host *mmc,int enable)
Signature · 1 line
2.23.0
PATCH v3 5/12 omap: pdata-quirks: revert pandora specific gpiod additions
In reply to H. Nikolaus Schallerintroduced by commit
efdfeb079cc3b ("regulator: fixed: Convert to use GPIO descriptor only")
We must remove this from mainline first, so that the following patch to remove the openpandora quirks for mmc3 and wl1251 cleanly applies to stable v4.9, v4.14, v4.19 where the above mentioned patch is not yet present.
Since the code affected is removed (no pandora gpios in pdata-quirks and more), there will be no matching revert-of-the-revert.
--- arch/arm/mach-omap2/pdata-quirks.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-)
arch/arm/mach-omap2/pdata-quirks.c +4 -15
@@ -7,7 +7,6 @@#include <linux/clk.h> #include <linux/davinci_emac.h> #include <linux/gpio.h> -#include <linux/gpio/machine.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/of_platform.h>
@@ -334,7 +333,9 @@ static struct regulator_init_data pandora_vmmc3 = {static struct fixed_voltage_config pandora_vwlan = { .supply_name ="vwlan" , .microvolts =1800000 ,/* 1.8V */ + .gpio =PANDORA_WIFI_NRESET_GPIO , .startup_delay =50000 ,/* 50ms */ + .enable_high =1 , .init_data = &pandora_vmmc3, };
@@ -346,19 +347,6 @@ static struct platform_device pandora_vwlan_device = { }, }; -static struct gpiod_lookup_table pandora_vwlan_gpiod_table = { - .dev_id ="reg-fixed-voltage.1" , - .table = { -/* -* As this is a low GPIO number it should be at the first -* GPIO bank. -*/ -GPIO_LOOKUP ("gpio-0-31" ,PANDORA_WIFI_NRESET_GPIO , -NULL ,GPIO_ACTIVE_HIGH ), - { }, - }, -}; -static void pandora_wl1251_init_card (struct mmc_card *card) {/*
@@ -380,6 +368,8 @@ static struct omap2_hsmmc_info pandora_mmc3[] = { { .mmc = 3, .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD, + .gpio_cd = -EINVAL, + .gpio_wp = -EINVAL, .init_card = pandora_wl1251_init_card, }, {}/* Terminator */
@@ -418,7 +408,6 @@ static void __init pandora_wl1251_init(void)static void __init omap3_pandora_legacy_init (void ) {platform_device_register (&pandora_backlight); -gpiod_add_lookup_table (&pandora_vwlan_gpiod_table);platform_device_register (&pandora_vwlan_device);omap_hsmmc_init (pandora_mmc3);omap_hsmmc_late_init (pandora_mmc3);
Signature · 1 line
2.23.0
Re: [PATCH v3 05/12] omap: pdata-quirks: revert pandora specific gpiod additions
Quoted 11 lines · H. Nikolaus Schaller
introduced by commit
efdfeb079cc3b("regulator: fixed: Convert to use GPIO descriptor only")We must remove this from mainline first, so that the following patch to remove the openpandora quirks for mmc3 and wl1251 cleanly applies to stable v4.9, v4.14, v4.19 where the above mentioned patch is not yet present.
Since the code affected is removed (no pandora gpios in pdata-quirks and more), there will be no matching revert-of-the-revert.
This too:
PATCH v3 6/12 omap: pdata-quirks: remove openpandora quirks for mmc3 and wl1251
In reply to H. Nikolaus SchallerWith a wl1251 child node of mmc3 in the device tree decoded in omap_hsmmc.c to handle special wl1251 initialization, we do no longer need to instantiate the mmc3 through pdata quirks.
We also can remove the wlan regulator and reset/interrupt definitions and do them through device tree.
--- arch/arm/mach-omap2/pdata-quirks.c | 93 ------------------------------ 1 file changed, 93 deletions(-)
arch/arm/mach-omap2/pdata-quirks.c +0 -93
@@ -310,108 +310,15 @@ static void __init omap3_logicpd_torpedo_init(void) }/* omap3pandora legacy devices */ -#define PANDORA_WIFI_IRQ_GPIO 21 -#define PANDORA_WIFI_NRESET_GPIO 23static struct platform_device pandora_backlight = { .name ="pandora-backlight" , .id =-1 , }; -static struct regulator_consumer_supply pandora_vmmc3_supply[] = { -REGULATOR_SUPPLY ("vmmc" ,"omap_hsmmc.2" ), -}; - -static struct regulator_init_data pandora_vmmc3 = { - .constraints = { - .valid_ops_mask =REGULATOR_CHANGE_STATUS , - }, - .num_consumer_supplies =ARRAY_SIZE (pandora_vmmc3_supply), - .consumer_supplies = pandora_vmmc3_supply, -}; - -static struct fixed_voltage_config pandora_vwlan = { - .supply_name ="vwlan" , - .microvolts =1800000 ,/* 1.8V */ - .gpio =PANDORA_WIFI_NRESET_GPIO , - .startup_delay =50000 ,/* 50ms */ - .enable_high =1 , - .init_data = &pandora_vmmc3, -}; - -static struct platform_device pandora_vwlan_device = { - .name ="reg-fixed-voltage" , - .id =1 , - .dev = { - .platform_data = &pandora_vwlan, - }, -}; - -static void pandora_wl1251_init_card (struct mmc_card *card) -{ -/* -* We have TI wl1251 attached to MMC3. Pass this information to -* SDIO core because it can't be probed by normal methods. -*/ -if (card->type ==MMC_TYPE_SDIO || card->type ==MMC_TYPE_SD_COMBO ) { - card->quirks |=MMC_QUIRK_NONSTD_SDIO ; - card->cccr.wide_bus =1 ; - card->cis.vendor =0x104c ; - card->cis.device =0x9066 ; - card->cis.blksize =512 ; - card->cis.max_dtr =24000000 ; - card->ocr =0x80 ; - } -} - -static struct omap2_hsmmc_info pandora_mmc3[] = { - { - .mmc =3 , - .caps =MMC_CAP_4_BIT_DATA |MMC_CAP_POWER_OFF_CARD , - .gpio_cd = -EINVAL , - .gpio_wp = -EINVAL , - .init_card = pandora_wl1251_init_card, - }, - {}/* Terminator */ -}; - -static void __init pandora_wl1251_init (void ) -{ -struct wl1251_platform_data pandora_wl1251_pdata; -int ret; - -memset (&pandora_wl1251_pdata,0 ,sizeof (pandora_wl1251_pdata)); - - pandora_wl1251_pdata.power_gpio =-1 ; - - ret =gpio_request_one (PANDORA_WIFI_IRQ_GPIO ,GPIOF_IN ,"wl1251 irq" ); -if (ret <0 ) - goto fail; - - pandora_wl1251_pdata.irq =gpio_to_irq (PANDORA_WIFI_IRQ_GPIO ); -if (pandora_wl1251_pdata.irq <0 ) - goto fail_irq; - - pandora_wl1251_pdata.use_eeprom = true; - ret =wl1251_set_platform_data (&pandora_wl1251_pdata); -if (ret <0 ) - goto fail_irq; - -return ; - -fail_irq: -gpio_free (PANDORA_WIFI_IRQ_GPIO ); -fail: -pr_err ("wl1251 board initialisation failed\n" ); -} -static void __init omap3_pandora_legacy_init (void ) {platform_device_register (&pandora_backlight); -platform_device_register (&pandora_vwlan_device); -omap_hsmmc_init (pandora_mmc3); -omap_hsmmc_late_init (pandora_mmc3); -pandora_wl1251_init (); }#endif /* CONFIG_ARCH_OMAP3 */
Signature · 1 line
2.23.0
Re: [PATCH v3 06/12] omap: pdata-quirks: remove openpandora quirks for mmc3 and wl1251
Quoted 8 lines · H. Nikolaus Schaller
With a wl1251 child node of mmc3 in the device tree decoded in
omap_hsmmc.cto handle special wl1251 initialization, we do no longer need to instantiate the mmc3 through pdata quirks.We also can remove the wlan regulator and reset/interrupt definitions and do them through device tree.
Fixes 81eef6ca9201 ("mmc: omap_hsmmc: Use dma_request_chan() for requesting DMA channel")
Good to see this go away:
PATCH v3 7/12 omap: remove omap2_hsmmc_info in old hsmmc.[ch] and update Makefile
In reply to H. Nikolaus SchallerThere is a new driver in drivers/mmc/host/omap_hsmmc.c configured by CONFIG_MMC_OMAP_HS and the last user was the pdata-quirks for pandora.
--- arch/arm/mach-omap2/Makefile | 3 - arch/arm/mach-omap2/common.h | 1 - arch/arm/mach-omap2/hsmmc.c | 171 ----------------------------- arch/arm/mach-omap2/hsmmc.h | 32 ------ arch/arm/mach-omap2/pdata-quirks.c | 1 - 5 files changed, 208 deletions(-) delete mode 100644 arch/arm/mach-omap2/hsmmc.c delete mode 100644 arch/arm/mach-omap2/hsmmc.h
arch/arm/mach-omap2/Makefile +0 -3
@@ -216,9 +216,6 @@ obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o # Platform specific device init code -omap-hsmmc-$(CONFIG_MMC_OMAP_HS) := hsmmc.o -obj-y += $(omap-hsmmc-m) $(omap-hsmmc-y) - obj-y += omap_phy_internal.o obj-$(CONFIG_MACH_OMAP2_TUSB6010) += usb-tusb6010.o
arch/arm/mach-omap2/common.h +0 -1
@@ -352,7 +352,6 @@ void omap_pcs_legacy_init(int irq, void (*rearm)(void));struct omap_sdrc_params ;extern void omap_sdrc_init (struct omap_sdrc_params *sdrc_cs0,struct omap_sdrc_params *sdrc_cs1); -struct omap2_hsmmc_info ;extern void omap_reserve (void );struct omap_hwmod ;
arch/arm/mach-omap2/hsmmc.c deleted +0 -171
171 lines not on this page · raw message
arch/arm/mach-omap2/hsmmc.h deleted +0 -32
@@ -1,32 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* -* MMC definitions for OMAP2 -*/ - -struct mmc_card ; - -struct omap2_hsmmc_info { -u8 mmc;/* controller 1/2/3 */ -u32 caps;/* 4/8 wires and any additional host -* capabilities OR'd (ref. linux/mmc/host.h) */ -struct platform_device *pdev;/* mmc controller instance */ -/* init some special card */ -void (*init_card)(struct mmc_card *card); -}; - -#if IS_ENABLED (CONFIG_MMC_OMAP_HS ) - -void omap_hsmmc_init (struct omap2_hsmmc_info *); -void omap_hsmmc_late_init (struct omap2_hsmmc_info *); - -#else - -static inline void omap_hsmmc_init (struct omap2_hsmmc_info *info) -{ -} - -static inline void omap_hsmmc_late_init (struct omap2_hsmmc_info *info) -{ -} - -#endif
arch/arm/mach-omap2/pdata-quirks.c +0 -1
@@ -32,7 +32,6 @@#include "omap_device.h" #include "omap-secure.h" #include "soc.h" -#include "hsmmc.h" static struct omap_hsmmc_platform_data __maybe_unused mmc_pdata[2 ];
Signature · 1 line
2.23.0
Re: [PATCH v3 07/12] omap: remove omap2_hsmmc_info in old hsmmc.[ch] and update Makefile
Quoted 3 lines · H. Nikolaus Schaller
There is a new driver in
drivers/mmc/host/omap_hsmmc.cconfigured byCONFIG_MMC_OMAP_HSand the last user was the pdata-quirks for pandora.
Thanks for doing this:
PATCH v3 8/12 mmc: host: omap-hsmmc: remove init_card pdata callback from pdata
In reply to H. Nikolaus SchallerNow as we have removed the last user (pandora_wl1251_init_card) of this callback, we can remove it from the hsmmc code.
--- drivers/mmc/host/omap_hsmmc.c | 4 +--- include/linux/platform_data/hsmmc-omap.h | 3 --- 2 files changed, 1 insertion(+), 6 deletions(-)
drivers/mmc/host/omap_hsmmc.c +1 -3
@@ -1510,9 +1510,7 @@ static void omap_hsmmc_init_card(struct mmc_host *mmc, struct mmc_card *card) {struct omap_hsmmc_host *host =mmc_priv (mmc); -if (mmc_pdata (host)->init_card) -mmc_pdata (host)->init_card (card); -else if (card->type ==MMC_TYPE_SDIO || card->type ==MMC_TYPE_SD_COMBO ) { +if (card->type ==MMC_TYPE_SDIO || card->type ==MMC_TYPE_SD_COMBO ) {struct device_node *np =mmc_dev (mmc)->of_node;/*
include/linux/platform_data/hsmmc-omap.h +0 -3
@@ -67,9 +67,6 @@ struct omap_hsmmc_platform_data {/* string specifying a particular variant of hardware */ char *version; -/* if we have special card, init it using this callback */ -void (*init_card)(struct mmc_card *card); -const char *name;u32 ocr_mask; };
Signature · 1 line
2.23.0
PATCH v3 9/12 mmc: sdio: fix wl1251 vendor id
In reply to H. Nikolaus Schallerv4.11-rc1 did introduce a patch series that rearranged the sdio quirks into a header file. Unfortunately this did forget to handle SDIO_VENDOR_ID_TI differently between wl1251 and wl1271 with the result that although the wl1251 was found on the sdio bus, the firmware did not load any more and there was no interface registration.
This patch defines separate constants to be used by sdio quirks and drivers.
--- include/linux/mmc/sdio_ids.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/mmc/sdio_ids.h +2 -0
@@ -71,6 +71,8 @@#define SDIO_VENDOR_ID_TI 0x0097#define SDIO_DEVICE_ID_TI_WL1271 0x4076 +#define SDIO_VENDOR_ID_TI_WL1251 0x104c +#define SDIO_DEVICE_ID_TI_WL1251 0x9066#define SDIO_VENDOR_ID_STE 0x0020#define SDIO_DEVICE_ID_STE_CW1200 0x2280
Signature · 1 line
2.23.0
PATCH v3 10/12 mmc: core: fix wl1251 sdio quirks
In reply to H. Nikolaus Schallerwl1251 and wl1271 have different vendor id and device id. So we need to handle both with sdio quirks.
--- drivers/mmc/core/quirks.h | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/mmc/core/quirks.h +7 -0
@@ -119,7 +119,14 @@ static const struct mmc_fixup mmc_ext_csd_fixups[] = {END_FIXUP }; +static const struct mmc_fixup sdio_fixup_methods[] = { +SDIO_FIXUP (SDIO_VENDOR_ID_TI_WL1251 ,SDIO_DEVICE_ID_TI_WL1251 , + add_quirk,MMC_QUIRK_NONSTD_FUNC_IF ), + +SDIO_FIXUP (SDIO_VENDOR_ID_TI_WL1251 ,SDIO_DEVICE_ID_TI_WL1251 , + add_quirk,MMC_QUIRK_DISABLE_CD ), +SDIO_FIXUP (SDIO_VENDOR_ID_TI ,SDIO_DEVICE_ID_TI_WL1271 , add_quirk,MMC_QUIRK_NONSTD_FUNC_IF ),
Signature · 1 line
2.23.0
PATCH v3 11/12 net: wireless: ti: wl1251 use new SDIO_VENDOR_ID_TI_WL1251 definition
In reply to H. Nikolaus SchallerSDIO_VENDOR_ID_TI_WL1251 is now defined in mmc/sdio_ids.h separately from SDIO_VENDOR_ID_TI for wl1271.
--- drivers/net/wireless/ti/wl1251/sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ti/wl1251/sdio.c +1 -1
@@ -52,7 +52,7 @@ static void wl1251_sdio_interrupt(struct sdio_func *func) }static const struct sdio_device_id wl1251_devices[] = { - {SDIO_DEVICE (SDIO_VENDOR_ID_TI ,SDIO_DEVICE_ID_TI_WL1251 ) }, + {SDIO_DEVICE (SDIO_VENDOR_ID_TI_WL1251 ,SDIO_DEVICE_ID_TI_WL1251 ) }, {} };MODULE_DEVICE_TABLE (sdio, wl1251_devices);
Signature · 1 line
2.23.0
PATCH v3 12/12 net: wireless: ti: remove local VENDOR_ID and DEVICE_ID definitions
In reply to H. Nikolaus SchallerThey are already included from mmc/sdio_ids.h and do not need a local definition.
--- drivers/net/wireless/ti/wl1251/sdio.c | 8 -------- drivers/net/wireless/ti/wlcore/sdio.c | 8 -------- 2 files changed, 16 deletions(-)
drivers/net/wireless/ti/wl1251/sdio.c +0 -8
@@ -22,14 +22,6 @@#include "wl1251.h" -#ifndef SDIO_VENDOR_ID_TI -#define SDIO_VENDOR_ID_TI 0x104c -#endif - -#ifndef SDIO_DEVICE_ID_TI_WL1251 -#define SDIO_DEVICE_ID_TI_WL1251 0x9066 -#endif -struct wl1251_sdio {struct sdio_func *func;u32 elp_val;
drivers/net/wireless/ti/wlcore/sdio.c +0 -8
@@ -26,14 +26,6 @@#include "wl12xx_80211.h" #include "io.h" -#ifndef SDIO_VENDOR_ID_TI -#define SDIO_VENDOR_ID_TI 0x0097 -#endif - -#ifndef SDIO_DEVICE_ID_TI_WL1271 -#define SDIO_DEVICE_ID_TI_WL1271 0x4076 -#endif -static bool dump = false;struct wl12xx_sdio_glue {
Signature · 1 line
2.23.0
Quoted 9 lines · H. Nikolaus Schaller
* add a revisit note for special wl1251 handling code because it should
be solved more generic in mmc core - suggested by Ulf Hansson <[email protected]>
* removeinit_cardcallback fromplatform_data/hsmmc-omap.h- suggested by Ulf Hansson <[email protected]>
* remove obstructive always-on for vwlan regulator - suggested by Ulf Hansson <[email protected]>
* rename DT node - suggested by Rob Herring <[email protected]>
* fix ARM: dts: subject prefix - suggested by Tony Lindgren <[email protected]>
* also removeomap2_hsmmc_infoand obc-y line inMakefile- suggested by Tony Lindgren <[email protected]>
No further comments from my side. Let's just agree on how to deal with the ti,power-gpio, then I can apply this.
Thanks a lot for fixing all this mess!
Kind regards
Uffe
Quoted 71 lines
PATCH V2 2019-10-19 20:41:47:
* added acked-by for wl1251 patches - Kalle Valo <[email protected]>
* really removed old pdata-quirks code (not through #if 0)
* splited out a partial revert of
efdfeb079cc3b("regulator: fixed: Convert to use GPIO descriptor only")
because that was introduced after v4.19 and stops the removal of
the pdata-quirks patch from cleanly applying to v4.9, v4.14, v4.19
- reported by Sasha Levin <[email protected]>
* added a new patch to remove old omap hsmmc since pdata quirks
were last user - suggested by Tony Lindgren <[email protected]>PATCH V1 2019-10-18 22:25:39:
Here we have a set of scattered patches to make the OpenPandora WiFi work again.v4.7 did break the pdata-quirks which made the mmc3 interface fail completely, because some code now assumes device tree based instantiation.
Fixes 81eef6ca9201 ("mmc: omap_hsmmc: Use dma_request_chan() for requesting DMA channel")v4.11 did break the sdio qirks for wl1251 which made the driver no longer load, although the device was found as an sdio client.
Fixes 884f38607897 ("mmc: core: move some sdio IDs out of quirks file")To solve these issues:
* we convert mmc3 and wl1251 initialization from pdata-quirks to device tree
* we make the wl1251 driver read properties from device tree
* we fix the mmc core vendor ids and quirks
* we fix the wl1251 (and wl1271) driver to use only vendor ids from header file instead of (potentially conflicting) local definitionsH. Nikolaus Schaller (12):
Documentation: dt: wireless: update wl1251 for sdio
net: wireless: ti: wl1251 add device tree support
ARM: dts: pandora-common: define wl1251 as child node of mmc3
mmc: host:omap_hsmmc: add code for special init of wl1251 to get ridof pandora_wl1251_init_cardomap: pdata-quirks: revert pandora specific gpiod additions
omap: pdata-quirks: remove openpandora quirks for mmc3 and wl1251
omap: removeomap2_hsmmc_infoin old hsmmc.[ch] and updateMakefile
mmc: host: omap-hsmmc: removeinit_cardpdata callback from pdata
mmc: sdio: fix wl1251 vendor id
mmc: core: fix wl1251 sdio quirks
net: wireless: ti: wl1251 use newSDIO_VENDOR_ID_TI_WL1251definition
net: wireless: ti: remove localVENDOR_IDandDEVICE_IDdefinitions.../bindings/net/wireless/ti,wl1251.txt | 26 +++ arch/arm/boot/dts/omap3-pandora-common.dtsi | 36 +++- arch/arm/mach-omap2/Makefile | 3 - arch/arm/mach-omap2/common.h | 1 - arch/arm/mach-omap2/hsmmc.c | 171 ------------------ arch/arm/mach-omap2/hsmmc.h | 32 ---- arch/arm/mach-omap2/pdata-quirks.c | 105 ----------- drivers/mmc/core/quirks.h | 7 + drivers/mmc/host/omap_hsmmc.c | 30 ++- drivers/net/wireless/ti/wl1251/sdio.c | 23 ++- drivers/net/wireless/ti/wlcore/sdio.c | 8 - include/linux/mmc/sdio_ids.h | 2 + include/linux/platform_data/hsmmc-omap.h | 3 - 13 files changed, 111 insertions(+), 336 deletions(-) delete mode 100644 arch/arm/mach-omap2/hsmmc.c delete mode 100644 arch/arm/mach-omap2/hsmmc.h--
2.23.0
Hi Ulf,
Quoted 13 lines
Am 14.11.2019 um 15:18 schrieb Ulf Hansson <[email protected]>:
Quoted 9 lines · H. Nikolaus Schaller
* add a revisit note for special wl1251 handling code because it should
be solved more generic in mmc core - suggested by Ulf Hansson <[email protected]>
* removeinit_cardcallback fromplatform_data/hsmmc-omap.h- suggested by Ulf Hansson <[email protected]>
* remove obstructive always-on for vwlan regulator - suggested by Ulf Hansson <[email protected]>
* rename DT node - suggested by Rob Herring <[email protected]>
* fix ARM: dts: subject prefix - suggested by Tony Lindgren <[email protected]>
* also removeomap2_hsmmc_infoand obc-y line inMakefile- suggested by Tony Lindgren <[email protected]>
Quoted 2 lines
No further comments from my side. Let's just agree on how to deal with the ti,power-gpio, then I can apply this.
I'd say it can be a separate patch since it does not fix the Pandora issues, but is a new and independent optimization.
And in case someone complains and uses it for some out-of tree purpose it can be discussed or even be reverted easier if it is a separate patch.
I can do it in the next days.
Quoted 1 line
Thanks a lot for fixing all this mess!
I hope the users also appreciate our work.
Best regards,
Nikolaus
Quoted 75 lines
Kind regards
UffeQuoted 71 lines
PATCH V2 2019-10-19 20:41:47:
* added acked-by for wl1251 patches - Kalle Valo <[email protected]>
* really removed old pdata-quirks code (not through #if 0)
* splited out a partial revert of
efdfeb079cc3b("regulator: fixed: Convert to use GPIO descriptor only")
because that was introduced after v4.19 and stops the removal of the pdata-quirks patch from cleanly applying to v4.9, v4.14, v4.19
- reported by Sasha Levin <[email protected]>
* added a new patch to remove old omap hsmmc since pdata quirks were last user - suggested by Tony Lindgren <[email protected]>PATCH V1 2019-10-18 22:25:39:
Here we have a set of scattered patches to make the OpenPandora WiFi work again.v4.7 did break the pdata-quirks which made the mmc3 interface fail completely, because some code now assumes device tree based instantiation.
Fixes 81eef6ca9201 ("mmc: omap_hsmmc: Use dma_request_chan() for requesting DMA channel")v4.11 did break the sdio qirks for wl1251 which made the driver no longer load, although the device was found as an sdio client.
Fixes 884f38607897 ("mmc: core: move some sdio IDs out of quirks file")To solve these issues:
* we convert mmc3 and wl1251 initialization from pdata-quirks to device tree
* we make the wl1251 driver read properties from device tree
* we fix the mmc core vendor ids and quirks
* we fix the wl1251 (and wl1271) driver to use only vendor ids from header file instead of (potentially conflicting) local definitionsH. Nikolaus Schaller (12):
Documentation: dt: wireless: update wl1251 for sdio
net: wireless: ti: wl1251 add device tree support
ARM: dts: pandora-common: define wl1251 as child node of mmc3
mmc: host:omap_hsmmc: add code for special init of wl1251 to get rid
ofpandora_wl1251_init_card
omap: pdata-quirks: revert pandora specific gpiod additions
omap: pdata-quirks: remove openpandora quirks for mmc3 and wl1251
omap: removeomap2_hsmmc_infoin old hsmmc.[ch] and updateMakefile
mmc: host: omap-hsmmc: removeinit_cardpdata callback from pdata
mmc: sdio: fix wl1251 vendor id
mmc: core: fix wl1251 sdio quirks
net: wireless: ti: wl1251 use newSDIO_VENDOR_ID_TI_WL1251definition
net: wireless: ti: remove localVENDOR_IDandDEVICE_IDdefinitions.../bindings/net/wireless/ti,wl1251.txt | 26 +++ arch/arm/boot/dts/omap3-pandora-common.dtsi | 36 +++- arch/arm/mach-omap2/Makefile | 3 - arch/arm/mach-omap2/common.h | 1 - arch/arm/mach-omap2/hsmmc.c | 171 ------------------ arch/arm/mach-omap2/hsmmc.h | 32 ---- arch/arm/mach-omap2/pdata-quirks.c | 105 ----------- drivers/mmc/core/quirks.h | 7 + drivers/mmc/host/omap_hsmmc.c | 30 ++- drivers/net/wireless/ti/wl1251/sdio.c | 23 ++- drivers/net/wireless/ti/wlcore/sdio.c | 8 - include/linux/mmc/sdio_ids.h | 2 + include/linux/platform_data/hsmmc-omap.h | 3 - 13 files changed, 111 insertions(+), 336 deletions(-)delete mode 100644
arch/arm/mach-omap2/hsmmc.c
delete mode 100644arch/arm/mach-omap2/hsmmc.h--
2.23.0
Quoted 19 lines · H. Nikolaus Schaller
Hi Ulf,
Quoted 13 lines
Am 14.11.2019 um 15:18 schrieb Ulf Hansson <[email protected]>:
Quoted 9 lines · H. Nikolaus Schaller
* add a revisit note for special wl1251 handling code because it should
be solved more generic in mmc core - suggested by Ulf Hansson <[email protected]>
* removeinit_cardcallback fromplatform_data/hsmmc-omap.h- suggested by Ulf Hansson <[email protected]>
* remove obstructive always-on for vwlan regulator - suggested by Ulf Hansson <[email protected]>
* rename DT node - suggested by Rob Herring <[email protected]>
* fix ARM: dts: subject prefix - suggested by Tony Lindgren <[email protected]>
* also removeomap2_hsmmc_infoand obc-y line inMakefile- suggested by Tony Lindgren <[email protected]>Quoted 2 lines
No further comments from my side. Let's just agree on how to deal with the ti,power-gpio, then I can apply this.
Quoted 7 lines
I'd say it can be a separate patch since it does not fix the Pandora issues, but is a new and independent optimization.
And in case someone complains and uses it for some out-of tree purpose it can be discussed or even be reverted easier if it is a separate patch.
I can do it in the next days.
Okay, that sounds reasonable.
In the meantime, I have queued up the series on my next branch (for v5.5).
I fixed up a couple of complaints from checkpatch, and also added stable tags for the first two patches in the series, as that what missing.
Kind regards
Uffe
Quoted 89 lines
Quoted 2 lines
Thanks a lot for fixing all this mess!
I hope the users also appreciate our work.
Best regards,
NikolausQuoted 75 lines
Kind regards
UffeQuoted 71 lines
PATCH V2 2019-10-19 20:41:47:
* added acked-by for wl1251 patches - Kalle Valo <[email protected]>
* really removed old pdata-quirks code (not through #if 0)
* splited out a partial revert of
efdfeb079cc3b("regulator: fixed: Convert to use GPIO descriptor only")
because that was introduced after v4.19 and stops the removal of
the pdata-quirks patch from cleanly applying to v4.9, v4.14, v4.19
- reported by Sasha Levin <[email protected]>
* added a new patch to remove old omap hsmmc since pdata quirks
were last user - suggested by Tony Lindgren <[email protected]>PATCH V1 2019-10-18 22:25:39:
Here we have a set of scattered patches to make the OpenPandora WiFi work again.v4.7 did break the pdata-quirks which made the mmc3 interface fail completely, because some code now assumes device tree based instantiation.
Fixes 81eef6ca9201 ("mmc: omap_hsmmc: Use dma_request_chan() for requesting DMA channel")v4.11 did break the sdio qirks for wl1251 which made the driver no longer load, although the device was found as an sdio client.
Fixes 884f38607897 ("mmc: core: move some sdio IDs out of quirks file")To solve these issues:
* we convert mmc3 and wl1251 initialization from pdata-quirks to device tree
* we make the wl1251 driver read properties from device tree
* we fix the mmc core vendor ids and quirks
* we fix the wl1251 (and wl1271) driver to use only vendor ids from header file instead of (potentially conflicting) local definitionsH. Nikolaus Schaller (12):
Documentation: dt: wireless: update wl1251 for sdio
net: wireless: ti: wl1251 add device tree support
ARM: dts: pandora-common: define wl1251 as child node of mmc3
mmc: host:omap_hsmmc: add code for special init of wl1251 to get rid
ofpandora_wl1251_init_card
omap: pdata-quirks: revert pandora specific gpiod additions
omap: pdata-quirks: remove openpandora quirks for mmc3 and wl1251
omap: removeomap2_hsmmc_infoin old hsmmc.[ch] and updateMakefile
mmc: host: omap-hsmmc: removeinit_cardpdata callback from pdata
mmc: sdio: fix wl1251 vendor id
mmc: core: fix wl1251 sdio quirks
net: wireless: ti: wl1251 use newSDIO_VENDOR_ID_TI_WL1251definition
net: wireless: ti: remove localVENDOR_IDandDEVICE_IDdefinitions.../bindings/net/wireless/ti,wl1251.txt | 26 +++ arch/arm/boot/dts/omap3-pandora-common.dtsi | 36 +++- arch/arm/mach-omap2/Makefile | 3 - arch/arm/mach-omap2/common.h | 1 - arch/arm/mach-omap2/hsmmc.c | 171 ------------------ arch/arm/mach-omap2/hsmmc.h | 32 ---- arch/arm/mach-omap2/pdata-quirks.c | 105 ----------- drivers/mmc/core/quirks.h | 7 + drivers/mmc/host/omap_hsmmc.c | 30 ++- drivers/net/wireless/ti/wl1251/sdio.c | 23 ++- drivers/net/wireless/ti/wlcore/sdio.c | 8 - include/linux/mmc/sdio_ids.h | 2 + include/linux/platform_data/hsmmc-omap.h | 3 - 13 files changed, 111 insertions(+), 336 deletions(-)delete mode 100644
arch/arm/mach-omap2/hsmmc.c
delete mode 100644arch/arm/mach-omap2/hsmmc.h--
2.23.0_______________________________________________
linux-arm-kernel mailing list linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel