drivers/media/platform/ti/omap3isp/ispcsiphy.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/ti/omap3isp/ispcsiphy.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/ti/omap3isp/ispcsiphy.c- Extension
.c- Size
- 9854 bytes
- Lines
- 366
- 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/regmap.hlinux/regulator/consumer.hisp.hispreg.hispcsiphy.h
Detected Declarations
function Copyrightfunction csiphy_routing_cfg_3430function controlfunction csiphy_power_autoswitch_enablefunction csiphy_set_powerfunction omap3isp_csiphy_configfunction omap3isp_csiphy_acquirefunction omap3isp_csiphy_releasefunction omap3isp_csiphy_initfunction omap3isp_csiphy_cleanup
Annotated Snippet
if (rval) {
regulator_disable(phy->vdd);
goto done;
}
csiphy_power_autoswitch_enable(phy, true);
}
done:
if (rval < 0)
phy->entity = NULL;
mutex_unlock(&phy->mutex);
return rval;
}
void omap3isp_csiphy_release(struct isp_csiphy *phy)
{
mutex_lock(&phy->mutex);
if (phy->entity) {
struct isp_pipeline *pipe = to_isp_pipeline(phy->entity);
struct isp_bus_cfg *buscfg;
buscfg = v4l2_subdev_to_bus_cfg(pipe->external);
if (WARN_ON(!buscfg)) {
mutex_unlock(&phy->mutex);
return;
}
csiphy_routing_cfg(phy, buscfg->interface, false,
buscfg->bus.ccp2.phy_layer);
if (phy->isp->revision == ISP_REVISION_15_0) {
csiphy_power_autoswitch_enable(phy, false);
csiphy_set_power(phy, ISPCSI2_PHY_CFG_PWR_CMD_OFF);
}
regulator_disable(phy->vdd);
phy->entity = NULL;
}
mutex_unlock(&phy->mutex);
}
/*
* omap3isp_csiphy_init - Initialize the CSI PHY frontends
*/
int omap3isp_csiphy_init(struct isp_device *isp)
{
struct isp_csiphy *phy1 = &isp->isp_csiphy1;
struct isp_csiphy *phy2 = &isp->isp_csiphy2;
phy2->isp = isp;
phy2->csi2 = &isp->isp_csi2a;
phy2->num_data_lanes = ISP_CSIPHY2_NUM_DATA_LANES;
phy2->cfg_regs = OMAP3_ISP_IOMEM_CSI2A_REGS1;
phy2->phy_regs = OMAP3_ISP_IOMEM_CSIPHY2;
mutex_init(&phy2->mutex);
phy1->isp = isp;
mutex_init(&phy1->mutex);
if (isp->revision == ISP_REVISION_15_0) {
phy1->csi2 = &isp->isp_csi2c;
phy1->num_data_lanes = ISP_CSIPHY1_NUM_DATA_LANES;
phy1->cfg_regs = OMAP3_ISP_IOMEM_CSI2C_REGS1;
phy1->phy_regs = OMAP3_ISP_IOMEM_CSIPHY1;
}
return 0;
}
void omap3isp_csiphy_cleanup(struct isp_device *isp)
{
mutex_destroy(&isp->isp_csiphy1.mutex);
mutex_destroy(&isp->isp_csiphy2.mutex);
}
Annotation
- Immediate include surface: `linux/delay.h`, `linux/device.h`, `linux/regmap.h`, `linux/regulator/consumer.h`, `isp.h`, `ispreg.h`, `ispcsiphy.h`.
- Detected declarations: `function Copyright`, `function csiphy_routing_cfg_3430`, `function control`, `function csiphy_power_autoswitch_enable`, `function csiphy_set_power`, `function omap3isp_csiphy_config`, `function omap3isp_csiphy_acquire`, `function omap3isp_csiphy_release`, `function omap3isp_csiphy_init`, `function omap3isp_csiphy_cleanup`.
- 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.