drivers/gpu/drm/exynos/exynos_drm_mic.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/exynos/exynos_drm_mic.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/exynos/exynos_drm_mic.c- Extension
.c- Size
- 10979 bytes
- Lines
- 467
- Domain
- Driver Families
- Bucket
- drivers/gpu
- 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/clk.hlinux/component.hlinux/delay.hlinux/mfd/syscon.hlinux/module.hlinux/mutex.hlinux/of.hlinux/of_address.hlinux/of_graph.hlinux/platform_device.hlinux/pm_runtime.hlinux/regmap.hvideo/of_videomode.hvideo/videomode.hdrm/drm_bridge.hdrm/drm_encoder.hdrm/drm_print.hexynos_drm_drv.hexynos_drm_crtc.h
Detected Declarations
struct exynos_micfunction mic_set_pathfunction mic_sw_resetfunction mic_set_porch_timingfunction mic_set_img_sizefunction mic_set_output_timingfunction mic_set_reg_onfunction mic_post_disablefunction mic_mode_setfunction mic_pre_enablefunction exynos_mic_bindfunction exynos_mic_unbindfunction exynos_mic_suspendfunction exynos_mic_resumefunction exynos_mic_probefunction exynos_mic_remove
Annotated Snippet
struct exynos_mic {
struct device *dev;
void __iomem *reg;
struct regmap *sysreg;
struct clk *clks[NUM_CLKS];
bool i80_mode;
struct videomode vm;
struct drm_bridge bridge;
bool enabled;
};
static void mic_set_path(struct exynos_mic *mic, bool enable)
{
int ret;
unsigned int val;
ret = regmap_read(mic->sysreg, DSD_CFG_MUX, &val);
if (ret) {
DRM_DEV_ERROR(mic->dev,
"mic: Failed to read system register\n");
return;
}
if (enable) {
if (mic->i80_mode)
val |= MIC0_I80_MUX;
else
val |= MIC0_RGB_MUX;
val |= MIC0_ON_MUX;
} else
val &= ~(MIC0_RGB_MUX | MIC0_I80_MUX | MIC0_ON_MUX);
ret = regmap_write(mic->sysreg, DSD_CFG_MUX, val);
if (ret)
DRM_DEV_ERROR(mic->dev,
"mic: Failed to read system register\n");
}
static int mic_sw_reset(struct exynos_mic *mic)
{
unsigned int retry = 100;
int ret;
writel(MIC_SW_RST, mic->reg + MIC_OP);
while (retry-- > 0) {
ret = readl(mic->reg + MIC_OP);
if (!(ret & MIC_SW_RST))
return 0;
udelay(10);
}
return -ETIMEDOUT;
}
static void mic_set_porch_timing(struct exynos_mic *mic)
{
struct videomode vm = mic->vm;
u32 reg;
reg = MIC_V_PULSE_WIDTH(vm.vsync_len) +
MIC_V_PERIOD_LINE(vm.vsync_len + vm.vactive +
vm.vback_porch + vm.vfront_porch);
writel(reg, mic->reg + MIC_V_TIMING_0);
reg = MIC_VBP_SIZE(vm.vback_porch) +
MIC_VFP_SIZE(vm.vfront_porch);
writel(reg, mic->reg + MIC_V_TIMING_1);
reg = MIC_V_PULSE_WIDTH(vm.hsync_len) +
MIC_V_PERIOD_LINE(vm.hsync_len + vm.hactive +
vm.hback_porch + vm.hfront_porch);
writel(reg, mic->reg + MIC_INPUT_TIMING_0);
reg = MIC_VBP_SIZE(vm.hback_porch) +
MIC_VFP_SIZE(vm.hfront_porch);
writel(reg, mic->reg + MIC_INPUT_TIMING_1);
}
static void mic_set_img_size(struct exynos_mic *mic)
{
struct videomode *vm = &mic->vm;
u32 reg;
reg = MIC_IMG_H_SIZE(vm->hactive) +
MIC_IMG_V_SIZE(vm->vactive);
Annotation
- Immediate include surface: `linux/clk.h`, `linux/component.h`, `linux/delay.h`, `linux/mfd/syscon.h`, `linux/module.h`, `linux/mutex.h`, `linux/of.h`, `linux/of_address.h`.
- Detected declarations: `struct exynos_mic`, `function mic_set_path`, `function mic_sw_reset`, `function mic_set_porch_timing`, `function mic_set_img_size`, `function mic_set_output_timing`, `function mic_set_reg_on`, `function mic_post_disable`, `function mic_mode_set`, `function mic_pre_enable`.
- Atlas domain: Driver Families / drivers/gpu.
- 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.