drivers/media/platform/ti/omap3isp/ispccp2.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/ti/omap3isp/ispccp2.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/ti/omap3isp/ispccp2.c- Extension
.c- Size
- 34441 bytes
- Lines
- 1184
- 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.
- 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
linux/delay.hlinux/device.hlinux/mm.hlinux/module.hlinux/mutex.hlinux/uaccess.hlinux/regulator/consumer.hisp.hispreg.hispccp2.h
Detected Declarations
function isp_reg_readlfunction ccp2_resetfunction ccp2_pwr_cfgfunction ccp2_if_enablefunction ccp2_mem_enablefunction ccp2_phyif_configfunction ccp2_vp_configfunction ccp2_lcx_configfunction ccp2_if_configurefunction ccp2_adjust_bandwidthfunction ccp2_mem_configurefunction ccp2_set_inaddrfunction ccp2_isr_bufferfunction omap3isp_ccp2_isrfunction __ccp2_get_formatfunction ccp2_try_formatfunction ccp2_enum_mbus_codefunction ccp2_enum_frame_sizefunction ccp2_get_formatfunction ccp2_set_formatfunction ccp2_init_formatsfunction ccp2_s_streamfunction ccp2_video_queuefunction ccp2_link_setupfunction omap3isp_ccp2_unregister_entitiesfunction omap3isp_ccp2_register_entitiesfunction ccp2_init_entitiesfunction omap3isp_ccp2_initfunction omap3isp_ccp2_cleanup
Annotated Snippet
if (i++ > 10) { /* try read 10 times */
dev_warn(isp->dev,
"omap3_isp: timeout waiting for ccp2 reset\n");
break;
}
}
}
/*
* ccp2_pwr_cfg - Configure the power mode settings
* @ccp2: pointer to ISP CCP2 device
*/
static void ccp2_pwr_cfg(struct isp_ccp2_device *ccp2)
{
struct isp_device *isp = to_isp_device(ccp2);
isp_reg_writel(isp, ISPCCP2_SYSCONFIG_MSTANDBY_MODE_SMART |
((isp->revision == ISP_REVISION_15_0 && isp->autoidle) ?
ISPCCP2_SYSCONFIG_AUTO_IDLE : 0),
OMAP3_ISP_IOMEM_CCP2, ISPCCP2_SYSCONFIG);
}
/*
* ccp2_if_enable - Enable CCP2 interface.
* @ccp2: pointer to ISP CCP2 device
* @enable: enable/disable flag
*/
static int ccp2_if_enable(struct isp_ccp2_device *ccp2, u8 enable)
{
struct isp_device *isp = to_isp_device(ccp2);
int ret;
int i;
if (enable && ccp2->vdds_csib) {
ret = regulator_enable(ccp2->vdds_csib);
if (ret < 0)
return ret;
}
/* Enable/Disable all the LCx channels */
for (i = 0; i < CCP2_LCx_CHANS_NUM; i++)
isp_reg_clr_set(isp, OMAP3_ISP_IOMEM_CCP2, ISPCCP2_LCx_CTRL(i),
ISPCCP2_LCx_CTRL_CHAN_EN,
enable ? ISPCCP2_LCx_CTRL_CHAN_EN : 0);
/* Enable/Disable ccp2 interface in ccp2 mode */
isp_reg_clr_set(isp, OMAP3_ISP_IOMEM_CCP2, ISPCCP2_CTRL,
ISPCCP2_CTRL_MODE | ISPCCP2_CTRL_IF_EN,
enable ? (ISPCCP2_CTRL_MODE | ISPCCP2_CTRL_IF_EN) : 0);
if (!enable && ccp2->vdds_csib)
regulator_disable(ccp2->vdds_csib);
return 0;
}
/*
* ccp2_mem_enable - Enable CCP2 memory interface.
* @ccp2: pointer to ISP CCP2 device
* @enable: enable/disable flag
*/
static void ccp2_mem_enable(struct isp_ccp2_device *ccp2, u8 enable)
{
struct isp_device *isp = to_isp_device(ccp2);
if (enable)
ccp2_if_enable(ccp2, 0);
/* Enable/Disable ccp2 interface in ccp2 mode */
isp_reg_clr_set(isp, OMAP3_ISP_IOMEM_CCP2, ISPCCP2_CTRL,
ISPCCP2_CTRL_MODE, enable ? ISPCCP2_CTRL_MODE : 0);
isp_reg_clr_set(isp, OMAP3_ISP_IOMEM_CCP2, ISPCCP2_LCM_CTRL,
ISPCCP2_LCM_CTRL_CHAN_EN,
enable ? ISPCCP2_LCM_CTRL_CHAN_EN : 0);
}
/*
* ccp2_phyif_config - Initialize CCP2 phy interface config
* @ccp2: Pointer to ISP CCP2 device
* @buscfg: CCP2 platform data
*
* Configure the CCP2 physical interface module from platform data.
*
* Returns -EIO if strobe is chosen in CSI1 mode, or 0 on success.
*/
static int ccp2_phyif_config(struct isp_ccp2_device *ccp2,
const struct isp_ccp2_cfg *buscfg)
{
struct isp_device *isp = to_isp_device(ccp2);
Annotation
- Immediate include surface: `linux/delay.h`, `linux/device.h`, `linux/mm.h`, `linux/module.h`, `linux/mutex.h`, `linux/uaccess.h`, `linux/regulator/consumer.h`, `isp.h`.
- Detected declarations: `function isp_reg_readl`, `function ccp2_reset`, `function ccp2_pwr_cfg`, `function ccp2_if_enable`, `function ccp2_mem_enable`, `function ccp2_phyif_config`, `function ccp2_vp_config`, `function ccp2_lcx_config`, `function ccp2_if_configure`, `function ccp2_adjust_bandwidth`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source 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.