drivers/media/platform/ti/omap3isp/isph3a_aewb.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/ti/omap3isp/isph3a_aewb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/ti/omap3isp/isph3a_aewb.c- Extension
.c- Size
- 10510 bytes
- Lines
- 351
- Domain
- Driver Families
- Bucket
- drivers/media
- 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/slab.hlinux/uaccess.hisp.hisph3a.hispstat.h
Detected Declarations
function Copyrightfunction h3a_aewb_enablefunction h3a_aewb_busyfunction h3a_aewb_get_buf_sizefunction h3a_aewb_validate_paramsfunction h3a_aewb_set_paramsfunction h3a_aewb_ioctlfunction omap3isp_h3a_aewb_initfunction omap3isp_h3a_aewb_cleanup
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* isph3a.c
*
* TI OMAP3 ISP - H3A module
*
* Copyright (C) 2010 Nokia Corporation
* Copyright (C) 2009 Texas Instruments, Inc.
*
* Contacts: David Cohen <dacohen@gmail.com>
* Laurent Pinchart <laurent.pinchart@ideasonboard.com>
* Sakari Ailus <sakari.ailus@iki.fi>
*/
#include <linux/slab.h>
#include <linux/uaccess.h>
#include "isp.h"
#include "isph3a.h"
#include "ispstat.h"
/*
* h3a_aewb_update_regs - Helper function to update h3a registers.
*/
static void h3a_aewb_setup_regs(struct ispstat *aewb, void *priv)
{
struct omap3isp_h3a_aewb_config *conf = priv;
u32 pcr;
u32 win1;
u32 start;
u32 blk;
u32 subwin;
if (aewb->state == ISPSTAT_DISABLED)
return;
isp_reg_writel(aewb->isp, aewb->active_buf->dma_addr,
OMAP3_ISP_IOMEM_H3A, ISPH3A_AEWBUFST);
if (!aewb->update)
return;
/* Converting config metadata into reg values */
pcr = conf->saturation_limit << ISPH3A_PCR_AEW_AVE2LMT_SHIFT;
pcr |= !!conf->alaw_enable << ISPH3A_PCR_AEW_ALAW_EN_SHIFT;
win1 = ((conf->win_height >> 1) - 1) << ISPH3A_AEWWIN1_WINH_SHIFT;
win1 |= ((conf->win_width >> 1) - 1) << ISPH3A_AEWWIN1_WINW_SHIFT;
win1 |= (conf->ver_win_count - 1) << ISPH3A_AEWWIN1_WINVC_SHIFT;
win1 |= (conf->hor_win_count - 1) << ISPH3A_AEWWIN1_WINHC_SHIFT;
start = conf->hor_win_start << ISPH3A_AEWINSTART_WINSH_SHIFT;
start |= conf->ver_win_start << ISPH3A_AEWINSTART_WINSV_SHIFT;
blk = conf->blk_ver_win_start << ISPH3A_AEWINBLK_WINSV_SHIFT;
blk |= ((conf->blk_win_height >> 1) - 1) << ISPH3A_AEWINBLK_WINH_SHIFT;
subwin = ((conf->subsample_ver_inc >> 1) - 1) <<
ISPH3A_AEWSUBWIN_AEWINCV_SHIFT;
subwin |= ((conf->subsample_hor_inc >> 1) - 1) <<
ISPH3A_AEWSUBWIN_AEWINCH_SHIFT;
isp_reg_writel(aewb->isp, win1, OMAP3_ISP_IOMEM_H3A, ISPH3A_AEWWIN1);
isp_reg_writel(aewb->isp, start, OMAP3_ISP_IOMEM_H3A,
ISPH3A_AEWINSTART);
isp_reg_writel(aewb->isp, blk, OMAP3_ISP_IOMEM_H3A, ISPH3A_AEWINBLK);
isp_reg_writel(aewb->isp, subwin, OMAP3_ISP_IOMEM_H3A,
ISPH3A_AEWSUBWIN);
isp_reg_clr_set(aewb->isp, OMAP3_ISP_IOMEM_H3A, ISPH3A_PCR,
ISPH3A_PCR_AEW_MASK, pcr);
aewb->update = 0;
aewb->config_counter += aewb->inc_config;
aewb->inc_config = 0;
aewb->buf_size = conf->buf_size;
}
static void h3a_aewb_enable(struct ispstat *aewb, int enable)
{
if (enable) {
isp_reg_set(aewb->isp, OMAP3_ISP_IOMEM_H3A, ISPH3A_PCR,
ISPH3A_PCR_AEW_EN);
omap3isp_subclk_enable(aewb->isp, OMAP3_ISP_SUBCLK_AEWB);
} else {
isp_reg_clr(aewb->isp, OMAP3_ISP_IOMEM_H3A, ISPH3A_PCR,
ISPH3A_PCR_AEW_EN);
omap3isp_subclk_disable(aewb->isp, OMAP3_ISP_SUBCLK_AEWB);
}
}
Annotation
- Immediate include surface: `linux/slab.h`, `linux/uaccess.h`, `isp.h`, `isph3a.h`, `ispstat.h`.
- Detected declarations: `function Copyright`, `function h3a_aewb_enable`, `function h3a_aewb_busy`, `function h3a_aewb_get_buf_size`, `function h3a_aewb_validate_params`, `function h3a_aewb_set_params`, `function h3a_aewb_ioctl`, `function omap3isp_h3a_aewb_init`, `function omap3isp_h3a_aewb_cleanup`.
- Atlas domain: Driver Families / drivers/media.
- 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.