Lines Matching +full:no +full:- +full:sdio
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Mac80211 SDIO driver for ST-Ericsson CW1200 device
5 * Copyright (c) 2010, ST-Ericsson
6 * Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
16 #include <linux/mmc/sdio.h>
22 #include <linux/platform_data/net-cw1200.h>
25 MODULE_AUTHOR("Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>");
26 MODULE_DESCRIPTION("mac80211 ST-Ericsson CW1200 SDIO driver");
56 MODULE_DEVICE_TABLE(sdio, cw1200_sdio_ids);
64 return sdio_memcpy_fromio(self->func, dst, addr, count); in cw1200_sdio_memcpy_fromio()
71 return sdio_memcpy_toio(self->func, addr, (void *)src, count); in cw1200_sdio_memcpy_toio()
76 sdio_claim_host(self->func); in cw1200_sdio_lock()
81 sdio_release_host(self->func); in cw1200_sdio_unlock()
89 if (self->core) in cw1200_sdio_irq_handler()
90 cw1200_irq_handler(self->core); in cw1200_sdio_irq_handler()
102 if (self->core) { in cw1200_gpio_irq()
104 cw1200_irq_handler(self->core); in cw1200_gpio_irq()
117 cccr = sdio_f0_readb(self->func, SDIO_CCCR_IENx, &ret); in cw1200_request_irq()
125 cccr |= BIT(self->func->num); in cw1200_request_irq()
127 sdio_f0_writeb(self->func, cccr, SDIO_CCCR_IENx, &ret); in cw1200_request_irq()
131 ret = enable_irq_wake(self->pdata->irq); in cw1200_request_irq()
136 ret = request_threaded_irq(self->pdata->irq, cw1200_gpio_hardirq, in cw1200_request_irq()
154 sdio_claim_host(self->func); in cw1200_sdio_irq_subscribe()
155 if (self->pdata->irq) in cw1200_sdio_irq_subscribe()
158 ret = sdio_claim_irq(self->func, cw1200_sdio_irq_handler); in cw1200_sdio_irq_subscribe()
160 sdio_release_host(self->func); in cw1200_sdio_irq_subscribe()
170 if (self->pdata->irq) { in cw1200_sdio_irq_unsubscribe()
171 disable_irq_wake(self->pdata->irq); in cw1200_sdio_irq_unsubscribe()
172 free_irq(self->pdata->irq, self); in cw1200_sdio_irq_unsubscribe()
174 sdio_claim_host(self->func); in cw1200_sdio_irq_unsubscribe()
175 ret = sdio_release_irq(self->func); in cw1200_sdio_irq_unsubscribe()
176 sdio_release_host(self->func); in cw1200_sdio_irq_unsubscribe()
192 if (pdata->power_ctrl) in cw1200_sdio_off()
193 pdata->power_ctrl(pdata, false); in cw1200_sdio_off()
194 if (pdata->clk_ctrl) in cw1200_sdio_off()
195 pdata->clk_ctrl(pdata, false); in cw1200_sdio_off()
205 pr_err("could not get CW1200 SDIO reset GPIO\n"); in cw1200_sdio_on()
211 pr_err("could not get CW1200 SDIO powerup GPIO\n"); in cw1200_sdio_on()
220 if (pdata->power_ctrl) { in cw1200_sdio_on()
221 if (pdata->power_ctrl(pdata, true)) { in cw1200_sdio_on()
223 return -1; in cw1200_sdio_on()
228 if (pdata->clk_ctrl) { in cw1200_sdio_on()
229 if (pdata->clk_ctrl(pdata, true)) { in cw1200_sdio_on()
231 return -1; in cw1200_sdio_on()
251 if (self->pdata->no_nptb) in cw1200_sdio_align_size()
254 size = sdio_align_size(self->func, size); in cw1200_sdio_align_size()
263 if (self->pdata->irq) in cw1200_sdio_pm()
264 ret = irq_set_irq_wake(self->pdata->irq, suspend); in cw1200_sdio_pm()
277 /* Probe Function to be called by SDIO stack when device is discovered */
287 if (func->num != 0x01) in cw1200_sdio_probe()
288 return -ENODEV; in cw1200_sdio_probe()
292 pr_err("Can't allocate SDIO hwbus_priv.\n"); in cw1200_sdio_probe()
293 return -ENOMEM; in cw1200_sdio_probe()
296 func->card->quirks |= MMC_QUIRK_LENIENT_FN0; in cw1200_sdio_probe()
298 self->pdata = global_plat_data; /* FIXME */ in cw1200_sdio_probe()
299 self->func = func; in cw1200_sdio_probe()
308 self, &func->dev, &self->core, in cw1200_sdio_probe()
309 self->pdata->ref_clk, in cw1200_sdio_probe()
310 self->pdata->macaddr, in cw1200_sdio_probe()
311 self->pdata->sdd_file, in cw1200_sdio_probe()
312 self->pdata->have_5ghz); in cw1200_sdio_probe()
325 /* Disconnect Function to be called by SDIO stack when
334 if (self->core) { in cw1200_sdio_disconnect()
335 cw1200_core_release(self->core); in cw1200_sdio_disconnect()
336 self->core = NULL; in cw1200_sdio_disconnect()
353 if (!cw1200_can_suspend(self->core)) in cw1200_sdio_suspend()
354 return -EAGAIN; in cw1200_sdio_suspend()
356 /* Notify SDIO that CW1200 will remain powered during suspend */ in cw1200_sdio_suspend()
359 pr_err("Error setting SDIO pm flags: %i\n", ret); in cw1200_sdio_suspend()
387 /* Init Module function -> Called by insmod */
393 /* FIXME -- this won't support multiple devices */ in cw1200_sdio_init()
397 ret = -1; in cw1200_sdio_init()
417 /* FIXME -- this won't support multiple devices */ in cw1200_sdio_exit()