drivers/media/platform/samsung/s5p-jpeg/jpeg-hw-exynos3250.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/samsung/s5p-jpeg/jpeg-hw-exynos3250.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/samsung/s5p-jpeg/jpeg-hw-exynos3250.c- Extension
.c- Size
- 11662 bytes
- Lines
- 482
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/io.hlinux/videodev2.hlinux/delay.hjpeg-core.hjpeg-regs.hjpeg-hw-exynos3250.h
Detected Declarations
function Copyrightfunction exynos3250_jpeg_poweronfunction exynos3250_jpeg_set_dma_numfunction exynos3250_jpeg_clk_setfunction exynos3250_jpeg_input_raw_fmtfunction exynos3250_jpeg_set_y16function exynos3250_jpeg_proc_modefunction exynos3250_jpeg_subsampling_modefunction exynos3250_jpeg_get_subsampling_modefunction exynos3250_jpeg_drifunction exynos3250_jpeg_qtblfunction exynos3250_jpeg_htbl_acfunction exynos3250_jpeg_htbl_dcfunction exynos3250_jpeg_set_yfunction exynos3250_jpeg_set_xfunction exynos3250_jpeg_get_yfunction exynos3250_jpeg_get_xfunction exynos3250_jpeg_interrupts_enablefunction exynos3250_jpeg_enc_stream_boundfunction exynos3250_jpeg_output_raw_fmtfunction exynos3250_jpeg_jpgadrfunction exynos3250_jpeg_imgadrfunction exynos3250_jpeg_stridefunction exynos3250_jpeg_offsetfunction exynos3250_jpeg_coeffunction exynos3250_jpeg_startfunction exynos3250_jpeg_rstartfunction exynos3250_jpeg_get_int_statusfunction exynos3250_jpeg_clear_int_statusfunction exynos3250_jpeg_compressed_sizefunction exynos3250_jpeg_dec_stream_sizefunction exynos3250_jpeg_dec_scaling_ratiofunction exynos3250_jpeg_set_timerfunction exynos3250_jpeg_get_timer_statusfunction exynos3250_jpeg_clear_timer_status
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/* linux/drivers/media/platform/exynos3250-jpeg/jpeg-hw.h
*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
* Author: Jacek Anaszewski <j.anaszewski@samsung.com>
*/
#include <linux/io.h>
#include <linux/videodev2.h>
#include <linux/delay.h>
#include "jpeg-core.h"
#include "jpeg-regs.h"
#include "jpeg-hw-exynos3250.h"
void exynos3250_jpeg_reset(void __iomem *regs)
{
u32 reg = 1;
int count = 1000;
writel(1, regs + EXYNOS3250_SW_RESET);
/* no other way but polling for when JPEG IP becomes operational */
while (reg != 0 && --count > 0) {
udelay(1);
cpu_relax();
reg = readl(regs + EXYNOS3250_SW_RESET);
}
reg = 0;
count = 1000;
while (reg != 1 && --count > 0) {
writel(1, regs + EXYNOS3250_JPGDRI);
udelay(1);
cpu_relax();
reg = readl(regs + EXYNOS3250_JPGDRI);
}
writel(0, regs + EXYNOS3250_JPGDRI);
}
void exynos3250_jpeg_poweron(void __iomem *regs)
{
writel(EXYNOS3250_POWER_ON, regs + EXYNOS3250_JPGCLKCON);
}
void exynos3250_jpeg_set_dma_num(void __iomem *regs)
{
writel(((EXYNOS3250_DMA_MO_COUNT << EXYNOS3250_WDMA_ISSUE_NUM_SHIFT) &
EXYNOS3250_WDMA_ISSUE_NUM_MASK) |
((EXYNOS3250_DMA_MO_COUNT << EXYNOS3250_RDMA_ISSUE_NUM_SHIFT) &
EXYNOS3250_RDMA_ISSUE_NUM_MASK) |
((EXYNOS3250_DMA_MO_COUNT << EXYNOS3250_ISSUE_GATHER_NUM_SHIFT) &
EXYNOS3250_ISSUE_GATHER_NUM_MASK),
regs + EXYNOS3250_DMA_ISSUE_NUM);
}
void exynos3250_jpeg_clk_set(void __iomem *base)
{
u32 reg;
reg = readl(base + EXYNOS3250_JPGCMOD) & ~EXYNOS3250_HALF_EN_MASK;
writel(reg | EXYNOS3250_HALF_EN, base + EXYNOS3250_JPGCMOD);
}
void exynos3250_jpeg_input_raw_fmt(void __iomem *regs, unsigned int fmt)
{
u32 reg;
reg = readl(regs + EXYNOS3250_JPGCMOD) &
EXYNOS3250_MODE_Y16_MASK;
switch (fmt) {
case V4L2_PIX_FMT_RGB32:
reg |= EXYNOS3250_MODE_SEL_ARGB8888;
break;
case V4L2_PIX_FMT_BGR32:
reg |= EXYNOS3250_MODE_SEL_ARGB8888 | EXYNOS3250_SRC_SWAP_RGB;
break;
case V4L2_PIX_FMT_RGB565:
reg |= EXYNOS3250_MODE_SEL_RGB565;
break;
case V4L2_PIX_FMT_RGB565X:
reg |= EXYNOS3250_MODE_SEL_RGB565 | EXYNOS3250_SRC_SWAP_RGB;
break;
case V4L2_PIX_FMT_YUYV:
reg |= EXYNOS3250_MODE_SEL_422_1P_LUM_CHR;
Annotation
- Immediate include surface: `linux/io.h`, `linux/videodev2.h`, `linux/delay.h`, `jpeg-core.h`, `jpeg-regs.h`, `jpeg-hw-exynos3250.h`.
- Detected declarations: `function Copyright`, `function exynos3250_jpeg_poweron`, `function exynos3250_jpeg_set_dma_num`, `function exynos3250_jpeg_clk_set`, `function exynos3250_jpeg_input_raw_fmt`, `function exynos3250_jpeg_set_y16`, `function exynos3250_jpeg_proc_mode`, `function exynos3250_jpeg_subsampling_mode`, `function exynos3250_jpeg_get_subsampling_mode`, `function exynos3250_jpeg_dri`.
- 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.