1*f4104b78SMauro Carvalho Chehab /* SPDX-License-Identifier: GPL-2.0-only */ 2*f4104b78SMauro Carvalho Chehab /* linux/drivers/media/platform/samsung/s5p-jpeg/jpeg-hw.h 3*f4104b78SMauro Carvalho Chehab * 4*f4104b78SMauro Carvalho Chehab * Copyright (c) 2011 Samsung Electronics Co., Ltd. 5*f4104b78SMauro Carvalho Chehab * http://www.samsung.com 6*f4104b78SMauro Carvalho Chehab * 7*f4104b78SMauro Carvalho Chehab * Author: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com> 8*f4104b78SMauro Carvalho Chehab */ 9*f4104b78SMauro Carvalho Chehab #ifndef JPEG_HW_S5P_H_ 10*f4104b78SMauro Carvalho Chehab #define JPEG_HW_S5P_H_ 11*f4104b78SMauro Carvalho Chehab 12*f4104b78SMauro Carvalho Chehab #include <linux/io.h> 13*f4104b78SMauro Carvalho Chehab #include <linux/videodev2.h> 14*f4104b78SMauro Carvalho Chehab 15*f4104b78SMauro Carvalho Chehab #include "jpeg-regs.h" 16*f4104b78SMauro Carvalho Chehab 17*f4104b78SMauro Carvalho Chehab #define S5P_JPEG_MIN_WIDTH 32 18*f4104b78SMauro Carvalho Chehab #define S5P_JPEG_MIN_HEIGHT 32 19*f4104b78SMauro Carvalho Chehab #define S5P_JPEG_MAX_WIDTH 8192 20*f4104b78SMauro Carvalho Chehab #define S5P_JPEG_MAX_HEIGHT 8192 21*f4104b78SMauro Carvalho Chehab #define S5P_JPEG_RAW_IN_565 0 22*f4104b78SMauro Carvalho Chehab #define S5P_JPEG_RAW_IN_422 1 23*f4104b78SMauro Carvalho Chehab #define S5P_JPEG_RAW_OUT_422 0 24*f4104b78SMauro Carvalho Chehab #define S5P_JPEG_RAW_OUT_420 1 25*f4104b78SMauro Carvalho Chehab 26*f4104b78SMauro Carvalho Chehab void s5p_jpeg_reset(void __iomem *regs); 27*f4104b78SMauro Carvalho Chehab void s5p_jpeg_poweron(void __iomem *regs); 28*f4104b78SMauro Carvalho Chehab void s5p_jpeg_input_raw_mode(void __iomem *regs, unsigned long mode); 29*f4104b78SMauro Carvalho Chehab void s5p_jpeg_proc_mode(void __iomem *regs, unsigned long mode); 30*f4104b78SMauro Carvalho Chehab void s5p_jpeg_subsampling_mode(void __iomem *regs, unsigned int mode); 31*f4104b78SMauro Carvalho Chehab unsigned int s5p_jpeg_get_subsampling_mode(void __iomem *regs); 32*f4104b78SMauro Carvalho Chehab void s5p_jpeg_dri(void __iomem *regs, unsigned int dri); 33*f4104b78SMauro Carvalho Chehab void s5p_jpeg_qtbl(void __iomem *regs, unsigned int t, unsigned int n); 34*f4104b78SMauro Carvalho Chehab void s5p_jpeg_htbl_ac(void __iomem *regs, unsigned int t); 35*f4104b78SMauro Carvalho Chehab void s5p_jpeg_htbl_dc(void __iomem *regs, unsigned int t); 36*f4104b78SMauro Carvalho Chehab void s5p_jpeg_y(void __iomem *regs, unsigned int y); 37*f4104b78SMauro Carvalho Chehab void s5p_jpeg_x(void __iomem *regs, unsigned int x); 38*f4104b78SMauro Carvalho Chehab void s5p_jpeg_rst_int_enable(void __iomem *regs, bool enable); 39*f4104b78SMauro Carvalho Chehab void s5p_jpeg_data_num_int_enable(void __iomem *regs, bool enable); 40*f4104b78SMauro Carvalho Chehab void s5p_jpeg_final_mcu_num_int_enable(void __iomem *regs, bool enbl); 41*f4104b78SMauro Carvalho Chehab int s5p_jpeg_timer_stat(void __iomem *regs); 42*f4104b78SMauro Carvalho Chehab void s5p_jpeg_clear_timer_stat(void __iomem *regs); 43*f4104b78SMauro Carvalho Chehab void s5p_jpeg_enc_stream_int(void __iomem *regs, unsigned long size); 44*f4104b78SMauro Carvalho Chehab int s5p_jpeg_enc_stream_stat(void __iomem *regs); 45*f4104b78SMauro Carvalho Chehab void s5p_jpeg_clear_enc_stream_stat(void __iomem *regs); 46*f4104b78SMauro Carvalho Chehab void s5p_jpeg_outform_raw(void __iomem *regs, unsigned long format); 47*f4104b78SMauro Carvalho Chehab void s5p_jpeg_jpgadr(void __iomem *regs, unsigned long addr); 48*f4104b78SMauro Carvalho Chehab void s5p_jpeg_imgadr(void __iomem *regs, unsigned long addr); 49*f4104b78SMauro Carvalho Chehab void s5p_jpeg_coef(void __iomem *regs, unsigned int i, 50*f4104b78SMauro Carvalho Chehab unsigned int j, unsigned int coef); 51*f4104b78SMauro Carvalho Chehab void s5p_jpeg_start(void __iomem *regs); 52*f4104b78SMauro Carvalho Chehab int s5p_jpeg_result_stat_ok(void __iomem *regs); 53*f4104b78SMauro Carvalho Chehab int s5p_jpeg_stream_stat_ok(void __iomem *regs); 54*f4104b78SMauro Carvalho Chehab void s5p_jpeg_clear_int(void __iomem *regs); 55*f4104b78SMauro Carvalho Chehab unsigned int s5p_jpeg_compressed_size(void __iomem *regs); 56*f4104b78SMauro Carvalho Chehab 57*f4104b78SMauro Carvalho Chehab #endif /* JPEG_HW_S5P_H_ */ 58