Lines Matching +full:vendor +full:- +full:specific
2 * SDIO access interface for drivers - linux specific (pci only)
6 * Copyright (C) 1999-2017, Broadcom Corporation
27 * <<Broadcom-WL-IPTag/Open:>>
29 * $Id: bcmsdh_linux.c 689948 2017-03-14 05:21:03Z $
64 /* the BCMSDH module comprises the generic part (bcmsdh.c) and OS specific layer (e.g.
65 * bcmsdh_linux.c). Put all OS specific variables (e.g. irq number and flags) here rather
93 * Checks to see if vendor and device IDs match a supported SDIO Host Controller.
96 bcmsdh_chipmatch(uint16 vendor, uint16 device) in bcmsdh_chipmatch() argument
102 if (vendor == VENDOR_SI_IMAGE) { in bcmsdh_chipmatch()
105 if (device == SDIOH_FPGA_ID && vendor == VENDOR_CYPRESS) { in bcmsdh_chipmatch()
109 if (device == BCM27XX_SDIOH_ID && vendor == VENDOR_BROADCOM) { in bcmsdh_chipmatch()
113 if (device == SDIOH_FPGA_ID && vendor == VENDOR_BROADCOM) { in bcmsdh_chipmatch()
117 if (device == PCIXX21_SDIOH_ID && vendor == VENDOR_TI) { in bcmsdh_chipmatch()
120 if (device == PCIXX21_SDIOH0_ID && vendor == VENDOR_TI) { in bcmsdh_chipmatch()
124 if (device == R5C822_SDIOH_ID && vendor == VENDOR_RICOH) { in bcmsdh_chipmatch()
128 if (device == JMICRON_SDIOH_ID && vendor == VENDOR_JMICRON) { in bcmsdh_chipmatch()
135 if (device == SPIH_FPGA_ID && vendor == VENDOR_BROADCOM) { in bcmsdh_chipmatch()
164 bcmsdh->os_cxt = bcmsdh_osinfo; in bcmsdh_probe()
165 bcmsdh_osinfo->sdioh = sdioh; in bcmsdh_probe()
166 bcmsdh_osinfo->dev = dev; in bcmsdh_probe()
172 bcmsdh_osinfo->dev_wake_enabled = TRUE; in bcmsdh_probe()
178 spin_lock_init(&bcmsdh_osinfo->oob_irq_spinlock); in bcmsdh_probe()
179 /* Get customer specific OOB IRQ parametres: IRQ number as IRQ type */ in bcmsdh_probe()
180 bcmsdh_osinfo->oob_irq_num = wifi_platform_get_irq_number(adapter_info, in bcmsdh_probe()
181 &bcmsdh_osinfo->oob_irq_flags); in bcmsdh_probe()
182 if (bcmsdh_osinfo->oob_irq_num < 0) { in bcmsdh_probe()
188 /* Read the vendor/device ID from the CIS */ in bcmsdh_probe()
193 bcmsdh_osinfo->context = drvinfo.probe((vendevid >> 16), (vendevid & 0xFFFF), bus_num, in bcmsdh_probe()
196 bcmsdh_osinfo->context = drvinfo.probe((vendevid >> 16), (vendevid & 0xFFFF), bus_num, in bcmsdh_probe()
199 if (bcmsdh_osinfo->context == NULL) { in bcmsdh_probe()
217 bcmsdh_os_info_t *bcmsdh_osinfo = bcmsdh->os_cxt; in bcmsdh_remove()
221 if (bcmsdh_osinfo->dev) in bcmsdh_remove()
222 device_init_wakeup(bcmsdh_osinfo->dev, false); in bcmsdh_remove()
223 bcmsdh_osinfo->dev_wake_enabled = FALSE; in bcmsdh_remove()
228 drvinfo.remove(bcmsdh_osinfo->context); in bcmsdh_remove()
229 MFREE(bcmsdh->osh, bcmsdh->os_cxt, sizeof(bcmsdh_os_info_t)); in bcmsdh_remove()
230 bcmsdh_detach(bcmsdh->osh, bcmsdh); in bcmsdh_remove()
238 return bcmsdh->total_wake_count; in bcmsdh_get_total_wake()
243 bcmsdh_os_info_t *bcmsdh_osinfo = bcmsdh->os_cxt; in bcmsdh_set_get_wake()
247 spin_lock_irqsave(&bcmsdh_osinfo->oob_irq_spinlock, flags); in bcmsdh_set_get_wake()
249 ret = bcmsdh->pkt_wake; in bcmsdh_set_get_wake()
250 bcmsdh->total_wake_count += flag; in bcmsdh_set_get_wake()
251 bcmsdh->pkt_wake = flag; in bcmsdh_set_get_wake()
253 spin_unlock_irqrestore(&bcmsdh_osinfo->oob_irq_spinlock, flags); in bcmsdh_set_get_wake()
260 bcmsdh_os_info_t *bcmsdh_osinfo = bcmsdh->os_cxt; in bcmsdh_suspend()
262 if (drvinfo.suspend && drvinfo.suspend(bcmsdh_osinfo->context)) in bcmsdh_suspend()
263 return -EBUSY; in bcmsdh_suspend()
269 bcmsdh_os_info_t *bcmsdh_osinfo = bcmsdh->os_cxt; in bcmsdh_resume()
272 return drvinfo.resume(bcmsdh_osinfo->context); in bcmsdh_resume()
322 bcmsdh_os_info_t *bcmsdh_osinfo = bcmsdh->os_cxt; in bcmsdh_dev_pm_stay_awake()
323 pm_stay_awake(bcmsdh_osinfo->dev); in bcmsdh_dev_pm_stay_awake()
333 bcmsdh_os_info_t *bcmsdh_osinfo = bcmsdh->os_cxt; in bcmsdh_dev_relax()
334 pm_relax(bcmsdh_osinfo->dev); in bcmsdh_dev_relax()
342 bcmsdh_os_info_t *bcmsdh_osinfo = bcmsdh->os_cxt; in bcmsdh_dev_pm_enabled()
344 return bcmsdh_osinfo->dev_wake_enabled; in bcmsdh_dev_pm_enabled()
356 bcmsdh_osinfo = bcmsdh->os_cxt; in bcmsdh_oob_intr_set()
357 spin_lock_irqsave(&bcmsdh_osinfo->oob_irq_spinlock, flags); in bcmsdh_oob_intr_set()
358 if (bcmsdh_osinfo->oob_irq_enabled != enable) { in bcmsdh_oob_intr_set()
360 enable_irq(bcmsdh_osinfo->oob_irq_num); in bcmsdh_oob_intr_set()
362 disable_irq_nosync(bcmsdh_osinfo->oob_irq_num); in bcmsdh_oob_intr_set()
363 bcmsdh_osinfo->oob_irq_enabled = enable; in bcmsdh_oob_intr_set()
365 spin_unlock_irqrestore(&bcmsdh_osinfo->oob_irq_spinlock, flags); in bcmsdh_oob_intr_set()
371 bcmsdh_os_info_t *bcmsdh_osinfo = bcmsdh->os_cxt; in wlan_oob_irq()
376 bcmsdh_osinfo->oob_irq_handler(bcmsdh_osinfo->oob_irq_handler_context); in wlan_oob_irq()
385 bcmsdh_os_info_t *bcmsdh_osinfo = bcmsdh->os_cxt; in bcmsdh_oob_intr_register()
388 if (bcmsdh_osinfo->oob_irq_registered) { in bcmsdh_oob_intr_register()
390 return -EBUSY; in bcmsdh_oob_intr_register()
393 (int)bcmsdh_osinfo->oob_irq_num, (int)bcmsdh_osinfo->oob_irq_flags)); in bcmsdh_oob_intr_register()
394 bcmsdh_osinfo->oob_irq_handler = oob_irq_handler; in bcmsdh_oob_intr_register()
395 bcmsdh_osinfo->oob_irq_handler_context = oob_irq_handler_context; in bcmsdh_oob_intr_register()
396 bcmsdh_osinfo->oob_irq_enabled = TRUE; in bcmsdh_oob_intr_register()
397 bcmsdh_osinfo->oob_irq_registered = TRUE; in bcmsdh_oob_intr_register()
398 err = request_irq(bcmsdh_osinfo->oob_irq_num, wlan_oob_irq, in bcmsdh_oob_intr_register()
399 bcmsdh_osinfo->oob_irq_flags, "bcmsdh_sdmmc", bcmsdh); in bcmsdh_oob_intr_register()
402 bcmsdh_osinfo->oob_irq_enabled = FALSE; in bcmsdh_oob_intr_register()
403 bcmsdh_osinfo->oob_irq_registered = FALSE; in bcmsdh_oob_intr_register()
408 if (device_may_wakeup(bcmsdh_osinfo->dev)) { in bcmsdh_oob_intr_register()
410 err = enable_irq_wake(bcmsdh_osinfo->oob_irq_num); in bcmsdh_oob_intr_register()
412 bcmsdh_osinfo->oob_irq_wake_enabled = TRUE; in bcmsdh_oob_intr_register()
422 bcmsdh_os_info_t *bcmsdh_osinfo = bcmsdh->os_cxt; in bcmsdh_oob_intr_unregister()
425 if (!bcmsdh_osinfo->oob_irq_registered) { in bcmsdh_oob_intr_unregister()
429 if (bcmsdh_osinfo->oob_irq_wake_enabled) { in bcmsdh_oob_intr_unregister()
431 if (device_may_wakeup(bcmsdh_osinfo->dev)) { in bcmsdh_oob_intr_unregister()
433 err = disable_irq_wake(bcmsdh_osinfo->oob_irq_num); in bcmsdh_oob_intr_unregister()
435 bcmsdh_osinfo->oob_irq_wake_enabled = FALSE; in bcmsdh_oob_intr_unregister()
440 if (bcmsdh_osinfo->oob_irq_enabled) { in bcmsdh_oob_intr_unregister()
441 disable_irq(bcmsdh_osinfo->oob_irq_num); in bcmsdh_oob_intr_unregister()
442 bcmsdh_osinfo->oob_irq_enabled = FALSE; in bcmsdh_oob_intr_unregister()
444 free_irq(bcmsdh_osinfo->oob_irq_num, bcmsdh); in bcmsdh_oob_intr_unregister()
445 bcmsdh_osinfo->oob_irq_registered = FALSE; in bcmsdh_oob_intr_unregister()
449 /* Module parameters specific to each host-controller driver */
464 extern uint sd_divisor; /* Divisor (-1 means external clock) */
470 extern uint sd_hiok; /* Ok to use hi-speed mode */
487 /* SDIO Drive Strength for UHSI mode specific to SDIO3.0 */