drivers/pcmcia/pxa2xx_base.c
Source file repositories/reference/linux-study-clean/drivers/pcmcia/pxa2xx_base.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pcmcia/pxa2xx_base.c- Extension
.c- Size
- 10040 bytes
- Lines
- 363
- Domain
- Driver Families
- Bucket
- drivers/pcmcia
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/slab.hlinux/init.hlinux/cpufreq.hlinux/ioport.hlinux/kernel.hlinux/spinlock.hlinux/platform_device.hlinux/soc/pxa/cpu.hlinux/soc/pxa/smemc.hasm/io.hasm/irq.hasm/mach-types.hpcmcia/ss.hpcmcia/cistpl.hsoc_common.hpxa2xx_base.h
Detected Declarations
function Copyrightfunction pxa2xx_mcxx_asstfunction pxa2xx_mcxx_setupfunction pxa2xx_pcmcia_cmd_timefunction pxa2xx_pcmcia_mcmemfunction pxa2xx_pcmcia_mciofunction pxa2xx_pcmcia_mcattfunction pxa2xx_pcmcia_set_timingfunction pxa2xx_pcmcia_frequency_changefunction pxa2xx_configure_socketsfunction pxa2xx_drv_pcmcia_add_onefunction pxa2xx_drv_pcmcia_opsfunction pxa2xx_drv_pcmcia_probefunction pxa2xx_drv_pcmcia_removefunction pxa2xx_drv_pcmcia_resumefunction pxa2xx_pcmcia_initfunction pxa2xx_pcmcia_exitmodule init pxa2xx_pcmcia_initexport pxa2xx_configure_socketsexport pxa2xx_drv_pcmcia_add_oneexport pxa2xx_drv_pcmcia_ops
Annotated Snippet
if (freqs->new > freqs->old) {
debug(skt, 2, "new frequency %u.%uMHz > %u.%uMHz, "
"pre-updating\n",
freqs->new / 1000, (freqs->new / 100) % 10,
freqs->old / 1000, (freqs->old / 100) % 10);
pxa2xx_pcmcia_set_timing(skt);
}
break;
case CPUFREQ_POSTCHANGE:
if (freqs->new < freqs->old) {
debug(skt, 2, "new frequency %u.%uMHz < %u.%uMHz, "
"post-updating\n",
freqs->new / 1000, (freqs->new / 100) % 10,
freqs->old / 1000, (freqs->old / 100) % 10);
pxa2xx_pcmcia_set_timing(skt);
}
break;
}
return 0;
}
#endif
void pxa2xx_configure_sockets(struct device *dev, struct pcmcia_low_level *ops)
{
pxa_smemc_set_pcmcia_socket(1);
}
EXPORT_SYMBOL(pxa2xx_configure_sockets);
static const char *skt_names[] = {
"PCMCIA socket 0",
"PCMCIA socket 1",
};
#define SKT_DEV_INFO_SIZE(n) \
(sizeof(struct skt_dev_info) + (n)*sizeof(struct soc_pcmcia_socket))
int pxa2xx_drv_pcmcia_add_one(struct soc_pcmcia_socket *skt)
{
skt->res_skt.start = _PCMCIA(skt->nr);
skt->res_skt.end = _PCMCIA(skt->nr) + PCMCIASp - 1;
skt->res_skt.name = skt_names[skt->nr];
skt->res_skt.flags = IORESOURCE_MEM;
skt->res_io.start = _PCMCIAIO(skt->nr);
skt->res_io.end = _PCMCIAIO(skt->nr) + PCMCIAIOSp - 1;
skt->res_io.name = "io";
skt->res_io.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
skt->res_mem.start = _PCMCIAMem(skt->nr);
skt->res_mem.end = _PCMCIAMem(skt->nr) + PCMCIAMemSp - 1;
skt->res_mem.name = "memory";
skt->res_mem.flags = IORESOURCE_MEM;
skt->res_attr.start = _PCMCIAAttr(skt->nr);
skt->res_attr.end = _PCMCIAAttr(skt->nr) + PCMCIAAttrSp - 1;
skt->res_attr.name = "attribute";
skt->res_attr.flags = IORESOURCE_MEM;
return soc_pcmcia_add_one(skt);
}
EXPORT_SYMBOL(pxa2xx_drv_pcmcia_add_one);
void pxa2xx_drv_pcmcia_ops(struct pcmcia_low_level *ops)
{
/* Provide our PXA2xx specific timing routines. */
ops->set_timing = pxa2xx_pcmcia_set_timing;
#ifdef CONFIG_CPU_FREQ
ops->frequency_change = pxa2xx_pcmcia_frequency_change;
#endif
}
EXPORT_SYMBOL(pxa2xx_drv_pcmcia_ops);
static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev)
{
int i, ret = 0;
struct pcmcia_low_level *ops;
struct skt_dev_info *sinfo;
struct soc_pcmcia_socket *skt;
struct clk *clk;
ops = (struct pcmcia_low_level *)dev->dev.platform_data;
if (!ops) {
ret = -ENODEV;
goto err0;
}
if (cpu_is_pxa320() && ops->nr > 1) {
dev_err(&dev->dev, "pxa320 supports only one pcmcia slot");
ret = -EINVAL;
Annotation
- Immediate include surface: `linux/module.h`, `linux/slab.h`, `linux/init.h`, `linux/cpufreq.h`, `linux/ioport.h`, `linux/kernel.h`, `linux/spinlock.h`, `linux/platform_device.h`.
- Detected declarations: `function Copyright`, `function pxa2xx_mcxx_asst`, `function pxa2xx_mcxx_setup`, `function pxa2xx_pcmcia_cmd_time`, `function pxa2xx_pcmcia_mcmem`, `function pxa2xx_pcmcia_mcio`, `function pxa2xx_pcmcia_mcatt`, `function pxa2xx_pcmcia_set_timing`, `function pxa2xx_pcmcia_frequency_change`, `function pxa2xx_configure_sockets`.
- Atlas domain: Driver Families / drivers/pcmcia.
- Implementation status: integration implementation candidate.
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.