drivers/pcmcia/sa1100_generic.c
Source file repositories/reference/linux-study-clean/drivers/pcmcia/sa1100_generic.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pcmcia/sa1100_generic.c- Extension
.c- Size
- 5928 bytes
- Lines
- 212
- Domain
- Driver Families
- Bucket
- drivers/pcmcia
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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/gpio/consumer.hlinux/init.hlinux/regulator/consumer.hlinux/slab.hlinux/platform_device.hpcmcia/ss.hasm/hardware/scoop.hsa1100_generic.h
Detected Declarations
function sa11x0_cf_hw_initfunction sa11x0_cf_configure_socketfunction sa11x0_drv_pcmcia_legacy_probefunction sa11x0_drv_pcmcia_legacy_removefunction sa11x0_drv_pcmcia_probefunction sa11x0_drv_pcmcia_removefunction sa11x0_pcmcia_initfunction sa11x0_pcmcia_exitmodule init sa11x0_pcmcia_init
Annotated Snippet
Device driver for the PCMCIA control functionality of StrongARM
SA-1100 microprocessors.
The contents of this file are subject to the Mozilla Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The initial developer of the original code is John G. Dorsey
<john+@cs.cmu.edu>. Portions created by John G. Dorsey are
Copyright (C) 1999 John G. Dorsey. All Rights Reserved.
Alternatively, the contents of this file may be used under the
terms of the GNU Public License version 2 (the "GPL"), in which
case the provisions of the GPL are applicable instead of the
above. If you wish to allow the use of your version of this file
only under the terms of the GPL and not to allow others to use
your version of this file under the MPL, indicate your decision
by deleting the provisions above and replace them with the notice
and other provisions required by the GPL. If you do not delete
the provisions above, a recipient may use your version of this
file under either the MPL or the GPL.
======================================================================*/
#include <linux/module.h>
#include <linux/gpio/consumer.h>
#include <linux/init.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/platform_device.h>
#include <pcmcia/ss.h>
#include <asm/hardware/scoop.h>
#include "sa1100_generic.h"
static const char *sa11x0_cf_gpio_names[] = {
[SOC_STAT_CD] = "detect",
[SOC_STAT_BVD1] = "bvd1",
[SOC_STAT_BVD2] = "bvd2",
[SOC_STAT_RDY] = "ready",
};
static int sa11x0_cf_hw_init(struct soc_pcmcia_socket *skt)
{
struct device *dev = skt->socket.dev.parent;
int i;
skt->gpio_reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(skt->gpio_reset))
return PTR_ERR(skt->gpio_reset);
skt->gpio_bus_enable = devm_gpiod_get_optional(dev, "bus-enable",
GPIOD_OUT_HIGH);
if (IS_ERR(skt->gpio_bus_enable))
return PTR_ERR(skt->gpio_bus_enable);
skt->vcc.reg = devm_regulator_get_optional(dev, "vcc");
if (IS_ERR(skt->vcc.reg))
return PTR_ERR(skt->vcc.reg);
if (!skt->vcc.reg)
dev_warn(dev,
"no Vcc regulator provided, ignoring Vcc controls\n");
for (i = 0; i < ARRAY_SIZE(sa11x0_cf_gpio_names); i++) {
skt->stat[i].name = sa11x0_cf_gpio_names[i];
skt->stat[i].desc = devm_gpiod_get_optional(dev,
sa11x0_cf_gpio_names[i], GPIOD_IN);
if (IS_ERR(skt->stat[i].desc))
return PTR_ERR(skt->stat[i].desc);
}
return 0;
}
static int sa11x0_cf_configure_socket(struct soc_pcmcia_socket *skt,
const socket_state_t *state)
{
return soc_pcmcia_regulator_set(skt, &skt->vcc, state->Vcc);
}
static struct pcmcia_low_level sa11x0_cf_ops = {
.owner = THIS_MODULE,
Annotation
- Immediate include surface: `linux/module.h`, `linux/gpio/consumer.h`, `linux/init.h`, `linux/regulator/consumer.h`, `linux/slab.h`, `linux/platform_device.h`, `pcmcia/ss.h`, `asm/hardware/scoop.h`.
- Detected declarations: `function sa11x0_cf_hw_init`, `function sa11x0_cf_configure_socket`, `function sa11x0_drv_pcmcia_legacy_probe`, `function sa11x0_drv_pcmcia_legacy_remove`, `function sa11x0_drv_pcmcia_probe`, `function sa11x0_drv_pcmcia_remove`, `function sa11x0_pcmcia_init`, `function sa11x0_pcmcia_exit`, `module init sa11x0_pcmcia_init`.
- Atlas domain: Driver Families / drivers/pcmcia.
- Implementation status: source 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.