drivers/ssb/embedded.c
Source file repositories/reference/linux-study-clean/drivers/ssb/embedded.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/ssb/embedded.c- Extension
.c- Size
- 6356 bytes
- Lines
- 259
- Domain
- Driver Families
- Bucket
- drivers/ssb
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
ssb_private.hlinux/export.hlinux/platform_device.hlinux/ssb/ssb.hlinux/ssb/ssb_embedded.hlinux/ssb/ssb_driver_pci.hlinux/ssb/ssb_driver_gige.hlinux/pci.h
Detected Declarations
function ssb_watchdog_timer_setfunction ssb_watchdog_registerfunction ssb_gpio_infunction ssb_gpio_outfunction ssb_gpio_outenfunction ssb_gpio_controlfunction ssb_gpio_intmaskfunction ssb_gpio_polarityfunction gige_pci_init_callbackfunction ssb_pcibios_plat_dev_initfunction gige_map_irq_callbackfunction ssb_pcibios_map_irqexport ssb_watchdog_timer_setexport ssb_gpio_inexport ssb_gpio_outexport ssb_gpio_outenexport ssb_gpio_controlexport ssb_gpio_intmaskexport ssb_gpio_polarity
Annotated Snippet
#include "ssb_private.h"
#include <linux/export.h>
#include <linux/platform_device.h>
#include <linux/ssb/ssb.h>
#include <linux/ssb/ssb_embedded.h>
#include <linux/ssb/ssb_driver_pci.h>
#include <linux/ssb/ssb_driver_gige.h>
#include <linux/pci.h>
int ssb_watchdog_timer_set(struct ssb_bus *bus, u32 ticks)
{
if (ssb_chipco_available(&bus->chipco)) {
ssb_chipco_watchdog_timer_set(&bus->chipco, ticks);
return 0;
}
if (ssb_extif_available(&bus->extif)) {
ssb_extif_watchdog_timer_set(&bus->extif, ticks);
return 0;
}
return -ENODEV;
}
EXPORT_SYMBOL(ssb_watchdog_timer_set);
int ssb_watchdog_register(struct ssb_bus *bus)
{
struct bcm47xx_wdt wdt = {};
struct platform_device *pdev;
if (ssb_chipco_available(&bus->chipco)) {
wdt.driver_data = &bus->chipco;
wdt.timer_set = ssb_chipco_watchdog_timer_set_wdt;
wdt.timer_set_ms = ssb_chipco_watchdog_timer_set_ms;
wdt.max_timer_ms = bus->chipco.max_timer_ms;
} else if (ssb_extif_available(&bus->extif)) {
wdt.driver_data = &bus->extif;
wdt.timer_set = ssb_extif_watchdog_timer_set_wdt;
wdt.timer_set_ms = ssb_extif_watchdog_timer_set_ms;
wdt.max_timer_ms = SSB_EXTIF_WATCHDOG_MAX_TIMER_MS;
} else {
return -ENODEV;
}
pdev = platform_device_register_data(NULL, "bcm47xx-wdt",
bus->busnumber, &wdt,
sizeof(wdt));
if (IS_ERR(pdev)) {
pr_debug("can not register watchdog device, err: %li\n",
PTR_ERR(pdev));
return PTR_ERR(pdev);
}
bus->watchdog = pdev;
return 0;
}
u32 ssb_gpio_in(struct ssb_bus *bus, u32 mask)
{
unsigned long flags;
u32 res = 0;
spin_lock_irqsave(&bus->gpio_lock, flags);
if (ssb_chipco_available(&bus->chipco))
res = ssb_chipco_gpio_in(&bus->chipco, mask);
else if (ssb_extif_available(&bus->extif))
res = ssb_extif_gpio_in(&bus->extif, mask);
else
WARN_ON(1);
spin_unlock_irqrestore(&bus->gpio_lock, flags);
return res;
}
EXPORT_SYMBOL(ssb_gpio_in);
u32 ssb_gpio_out(struct ssb_bus *bus, u32 mask, u32 value)
{
unsigned long flags;
u32 res = 0;
spin_lock_irqsave(&bus->gpio_lock, flags);
if (ssb_chipco_available(&bus->chipco))
res = ssb_chipco_gpio_out(&bus->chipco, mask, value);
else if (ssb_extif_available(&bus->extif))
res = ssb_extif_gpio_out(&bus->extif, mask, value);
else
WARN_ON(1);
spin_unlock_irqrestore(&bus->gpio_lock, flags);
return res;
Annotation
- Immediate include surface: `ssb_private.h`, `linux/export.h`, `linux/platform_device.h`, `linux/ssb/ssb.h`, `linux/ssb/ssb_embedded.h`, `linux/ssb/ssb_driver_pci.h`, `linux/ssb/ssb_driver_gige.h`, `linux/pci.h`.
- Detected declarations: `function ssb_watchdog_timer_set`, `function ssb_watchdog_register`, `function ssb_gpio_in`, `function ssb_gpio_out`, `function ssb_gpio_outen`, `function ssb_gpio_control`, `function ssb_gpio_intmask`, `function ssb_gpio_polarity`, `function gige_pci_init_callback`, `function ssb_pcibios_plat_dev_init`.
- Atlas domain: Driver Families / drivers/ssb.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.