arch/arm/mach-pxa/am200epd.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-pxa/am200epd.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-pxa/am200epd.c- Extension
.c- Size
- 9986 bytes
- Lines
- 396
- Domain
- Architecture Layer
- Bucket
- arch/arm
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/kernel.hlinux/errno.hlinux/string.hlinux/delay.hlinux/interrupt.hlinux/fb.hlinux/init.hlinux/platform_device.hlinux/irq.hlinux/gpio.hpxa25x.hgumstix.hlinux/platform_data/video-pxafb.hgeneric.hvideo/metronomefb.h
Detected Declarations
function am200_init_gpio_regsfunction am200_cleanupfunction am200_share_video_memfunction am200_unshare_video_memfunction am200_fb_notifier_callbackfunction am200_presetup_fbfunction am200_setup_fbfunction am200_get_panel_typefunction am200_handle_irqfunction am200_setup_irqfunction am200_set_rstfunction am200_set_stdbyfunction am200_wait_eventfunction am200_wait_event_intrfunction am200_init
Annotated Snippet
if (err) {
dev_err(&am200_device->dev, "failed requesting "
"gpio %s, err=%d\n", gpio_names[i], err);
goto err_req_gpio;
}
}
gpio_direction_output(LED_GPIO_PIN, 0);
gpio_direction_output(STDBY_GPIO_PIN, 0);
gpio_direction_output(RST_GPIO_PIN, 0);
gpio_direction_input(RDY_GPIO_PIN);
gpio_direction_input(ERR_GPIO_PIN);
gpio_direction_output(PCBPWR_GPIO_PIN, 0);
return 0;
err_req_gpio:
while (--i >= 0)
gpio_free(gpios[i]);
return err;
}
static void am200_cleanup(struct metronomefb_par *par)
{
int i;
free_irq(PXA_GPIO_TO_IRQ(RDY_GPIO_PIN), par);
for (i = 0; i < ARRAY_SIZE(gpios); i++)
gpio_free(gpios[i]);
}
static int am200_share_video_mem(struct fb_info *info)
{
/* rough check if this is our desired fb and not something else */
if ((info->var.xres != am200_fb_info.modes->xres)
|| (info->var.yres != am200_fb_info.modes->yres))
return 0;
/* we've now been notified that we have our new fb */
am200_board.metromem = info->screen_base;
am200_board.host_fbinfo = info;
/* try to refcount host drv since we are the consumer after this */
if (!try_module_get(info->fbops->owner))
return -ENODEV;
return 0;
}
static int am200_unshare_video_mem(struct fb_info *info)
{
dev_dbg(&am200_device->dev, "ENTER %s\n", __func__);
if (info != am200_board.host_fbinfo)
return 0;
module_put(am200_board.host_fbinfo->fbops->owner);
return 0;
}
static int am200_fb_notifier_callback(struct notifier_block *self,
unsigned long event, void *data)
{
struct fb_event *evdata = data;
struct fb_info *info = evdata->info;
dev_dbg(&am200_device->dev, "ENTER %s\n", __func__);
if (event == FB_EVENT_FB_REGISTERED)
return am200_share_video_mem(info);
else if (event == FB_EVENT_FB_UNREGISTERED)
return am200_unshare_video_mem(info);
return 0;
}
static struct notifier_block am200_fb_notif = {
.notifier_call = am200_fb_notifier_callback,
};
/* this gets called as part of our init. these steps must be done now so
* that we can use pxa_set_fb_info */
static void __init am200_presetup_fb(void)
{
int fw;
int fh;
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/errno.h`, `linux/string.h`, `linux/delay.h`, `linux/interrupt.h`, `linux/fb.h`, `linux/init.h`.
- Detected declarations: `function am200_init_gpio_regs`, `function am200_cleanup`, `function am200_share_video_mem`, `function am200_unshare_video_mem`, `function am200_fb_notifier_callback`, `function am200_presetup_fb`, `function am200_setup_fb`, `function am200_get_panel_type`, `function am200_handle_irq`, `function am200_setup_irq`.
- Atlas domain: Architecture Layer / arch/arm.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.