Skip to content

Commit 86433d9

Browse files
ajaykathatnoglitch
authored andcommitted
staging: wilc1000: correct use of "mmc-pwrseq" DT property & pwr-seq
Added check to ensure DT node is available before use. Modified the correct power on/off sequence to reset the device in probe function. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
1 parent e146cc0 commit 86433d9

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

drivers/staging/wilc1000/sdio.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,22 +192,20 @@ static int wilc_sdio_probe(struct sdio_func *func,
192192
*/
193193
np = of_parse_phandle(func->card->host->parent->of_node, "mmc-pwrseq",
194194
0);
195-
if (!np) {
195+
if (np && of_device_is_available(np)) {
196+
init_power = 1;
197+
of_node_put(np);
198+
} else {
196199
ret = wilc_of_parse_power_pins(wilc);
197200
if (ret)
198201
goto disable_rtc_clk;
199-
} else {
200-
init_power = 1;
201-
of_node_put(np);
202202
}
203203

204204

205205
if (!init_power) {
206-
/* This could be removed and let hif_init do its job. Also
207-
* doing insert/remove module for many times should lead
208-
* to calling this only the 1st time. */
209-
wilc_wlan_power(wilc, true);
206+
wilc_wlan_power(wilc, false);
210207
init_power = 1;
208+
wilc_wlan_power(wilc, true);
211209
}
212210

213211
wilc_bt_init(wilc);

drivers/staging/wilc1000/spi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,9 @@ static int wilc_bus_probe(struct spi_device *spi)
144144
goto disable_rtc_clk;
145145

146146
if (!init_power) {
147-
wilc_wlan_power(wilc, true);
147+
wilc_wlan_power(wilc, false);
148148
init_power = 1;
149+
wilc_wlan_power(wilc, true);
149150
}
150151

151152
wilc_bt_init(wilc);

0 commit comments

Comments
 (0)