drivers/media/platform/samsung/s5p-jpeg/jpeg-hw-s5p.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/samsung/s5p-jpeg/jpeg-hw-s5p.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/samsung/s5p-jpeg/jpeg-hw-s5p.c- Extension
.c- Size
- 7022 bytes
- Lines
- 306
- 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.
Dependency Surface
linux/io.hlinux/videodev2.hjpeg-core.hjpeg-regs.hjpeg-hw-s5p.h
Detected Declarations
function Copyrightfunction s5p_jpeg_poweronfunction s5p_jpeg_input_raw_modefunction s5p_jpeg_proc_modefunction s5p_jpeg_subsampling_modefunction s5p_jpeg_get_subsampling_modefunction s5p_jpeg_drifunction s5p_jpeg_qtblfunction s5p_jpeg_htbl_acfunction s5p_jpeg_htbl_dcfunction s5p_jpeg_yfunction s5p_jpeg_xfunction s5p_jpeg_rst_int_enablefunction s5p_jpeg_data_num_int_enablefunction s5p_jpeg_final_mcu_num_int_enablefunction s5p_jpeg_timer_statfunction s5p_jpeg_clear_timer_statfunction s5p_jpeg_enc_stream_intfunction s5p_jpeg_enc_stream_statfunction s5p_jpeg_clear_enc_stream_statfunction s5p_jpeg_outform_rawfunction s5p_jpeg_jpgadrfunction s5p_jpeg_imgadrfunction s5p_jpeg_coeffunction s5p_jpeg_startfunction s5p_jpeg_result_stat_okfunction s5p_jpeg_stream_stat_okfunction s5p_jpeg_clear_intfunction s5p_jpeg_compressed_size
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/* linux/drivers/media/platform/samsung/s5p-jpeg/jpeg-hw.h
*
* Copyright (c) 2011 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
* Author: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>
*/
#include <linux/io.h>
#include <linux/videodev2.h>
#include "jpeg-core.h"
#include "jpeg-regs.h"
#include "jpeg-hw-s5p.h"
void s5p_jpeg_reset(void __iomem *regs)
{
unsigned long reg;
writel(1, regs + S5P_JPG_SW_RESET);
reg = readl(regs + S5P_JPG_SW_RESET);
/* no other way but polling for when JPEG IP becomes operational */
while (reg != 0) {
cpu_relax();
reg = readl(regs + S5P_JPG_SW_RESET);
}
}
void s5p_jpeg_poweron(void __iomem *regs)
{
writel(S5P_POWER_ON, regs + S5P_JPGCLKCON);
}
void s5p_jpeg_input_raw_mode(void __iomem *regs, unsigned long mode)
{
unsigned long reg, m;
m = S5P_MOD_SEL_565;
if (mode == S5P_JPEG_RAW_IN_565)
m = S5P_MOD_SEL_565;
else if (mode == S5P_JPEG_RAW_IN_422)
m = S5P_MOD_SEL_422;
reg = readl(regs + S5P_JPGCMOD);
reg &= ~S5P_MOD_SEL_MASK;
reg |= m;
writel(reg, regs + S5P_JPGCMOD);
}
void s5p_jpeg_proc_mode(void __iomem *regs, unsigned long mode)
{
unsigned long reg, m;
if (mode == S5P_JPEG_ENCODE)
m = S5P_PROC_MODE_COMPR;
else
m = S5P_PROC_MODE_DECOMPR;
reg = readl(regs + S5P_JPGMOD);
reg &= ~S5P_PROC_MODE_MASK;
reg |= m;
writel(reg, regs + S5P_JPGMOD);
}
void s5p_jpeg_subsampling_mode(void __iomem *regs, unsigned int mode)
{
unsigned long reg, m;
if (mode == V4L2_JPEG_CHROMA_SUBSAMPLING_420)
m = S5P_SUBSAMPLING_MODE_420;
else
m = S5P_SUBSAMPLING_MODE_422;
reg = readl(regs + S5P_JPGMOD);
reg &= ~S5P_SUBSAMPLING_MODE_MASK;
reg |= m;
writel(reg, regs + S5P_JPGMOD);
}
unsigned int s5p_jpeg_get_subsampling_mode(void __iomem *regs)
{
return readl(regs + S5P_JPGMOD) & S5P_SUBSAMPLING_MODE_MASK;
}
void s5p_jpeg_dri(void __iomem *regs, unsigned int dri)
{
unsigned long reg;
reg = readl(regs + S5P_JPGDRI_U);
reg &= ~0xff;
Annotation
- Immediate include surface: `linux/io.h`, `linux/videodev2.h`, `jpeg-core.h`, `jpeg-regs.h`, `jpeg-hw-s5p.h`.
- Detected declarations: `function Copyright`, `function s5p_jpeg_poweron`, `function s5p_jpeg_input_raw_mode`, `function s5p_jpeg_proc_mode`, `function s5p_jpeg_subsampling_mode`, `function s5p_jpeg_get_subsampling_mode`, `function s5p_jpeg_dri`, `function s5p_jpeg_qtbl`, `function s5p_jpeg_htbl_ac`, `function s5p_jpeg_htbl_dc`.
- 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.