Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
jpeg-core.h
Go to the documentation of this file.
1 /* linux/drivers/media/platform/s5p-jpeg/jpeg-core.h
2  *
3  * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4  * http://www.samsung.com
5  *
6  * Author: Andrzej Pietrasiewicz <[email protected]>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation.
11  */
12 
13 #ifndef JPEG_CORE_H_
14 #define JPEG_CORE_H_
15 
16 #include <media/v4l2-device.h>
17 #include <media/v4l2-fh.h>
18 #include <media/v4l2-ctrls.h>
19 
20 #define S5P_JPEG_M2M_NAME "s5p-jpeg"
21 
22 /* JPEG compression quality setting */
23 #define S5P_JPEG_COMPR_QUAL_BEST 0
24 #define S5P_JPEG_COMPR_QUAL_WORST 3
25 
26 /* JPEG RGB to YCbCr conversion matrix coefficients */
27 #define S5P_JPEG_COEF11 0x4d
28 #define S5P_JPEG_COEF12 0x97
29 #define S5P_JPEG_COEF13 0x1e
30 #define S5P_JPEG_COEF21 0x2c
31 #define S5P_JPEG_COEF22 0x57
32 #define S5P_JPEG_COEF23 0x83
33 #define S5P_JPEG_COEF31 0x83
34 #define S5P_JPEG_COEF32 0x6e
35 #define S5P_JPEG_COEF33 0x13
36 
37 /* a selection of JPEG markers */
38 #define TEM 0x01
39 #define SOF0 0xc0
40 #define RST 0xd0
41 #define SOI 0xd8
42 #define EOI 0xd9
43 #define DHP 0xde
44 
45 /* Flags that indicate a format can be used for capture/output */
46 #define MEM2MEM_CAPTURE (1 << 0)
47 #define MEM2MEM_OUTPUT (1 << 1)
48 
63 struct s5p_jpeg {
64  struct mutex lock;
65  struct spinlock slock;
66 
71 
72  void __iomem *regs;
73  unsigned int irq;
74  struct clk *clk;
75  struct device *dev;
76  void *alloc_ctx;
77 };
78 
89 struct s5p_jpeg_fmt {
90  char *name;
92  int depth;
93  int colplanes;
94  int h_align;
95  int v_align;
97 };
98 
107  struct s5p_jpeg_fmt *fmt;
111 };
112 
124 struct s5p_jpeg_ctx {
125  struct s5p_jpeg *jpeg;
126  unsigned int mode;
127  unsigned short compr_quality;
128  unsigned short restart_interval;
129  unsigned short subsampling;
133  struct v4l2_fh fh;
136 };
137 
145  unsigned long size;
146  unsigned long curr;
147  unsigned long data;
148 };
149 
150 #endif /* JPEG_CORE_H */