• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * linux-5.4/drivers/media/platform/sunxi-vin/utility/bsp_common.h
3  *
4  * Copyright (c) 2007-2017 Allwinnertech Co., Ltd.
5  *
6  * This software is licensed under the terms of the GNU General Public
7  * License version 2, as published by the Free Software Foundation, and
8  * may be copied, distributed, and modified under those terms.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  */
16 
17 #ifndef __BSP_COMMON__H__
18 #define __BSP_COMMON__H__
19 
20 #include <linux/videodev2.h>
21 #include <media/v4l2-mediabus.h>
22 
23 enum bus_pixeltype {
24 	BUS_FMT_RGB565,
25 	BUS_FMT_RGB888,
26 	BUS_FMT_Y_U_V,
27 	BUS_FMT_YY_YUYV,
28 	BUS_FMT_YY_YVYU,
29 	BUS_FMT_YY_UYVY,
30 	BUS_FMT_YY_VYUY,
31 	BUS_FMT_YUYV,
32 	BUS_FMT_YVYU,
33 	BUS_FMT_UYVY,
34 	BUS_FMT_VYUY,
35 	BUS_FMT_SBGGR,
36 	BUS_FMT_SGBRG,
37 	BUS_FMT_SGRBG,
38 	BUS_FMT_SRGGB,
39 };
40 
41 enum pixel_fmt_type {
42 	RGB565,
43 	RGB888,
44 	PRGB888,
45 	YUV422_INTLVD,
46 	YUV422_PL,
47 	YUV422_SPL,
48 	YUV422_MB,
49 	YUV420_PL,
50 	YUV420_SPL,
51 	YUV420_MB,
52 	BAYER_RGB,
53 };
54 
55 enum bit_width {
56 	W_1BIT,
57 	W_2BIT,
58 	W_4BIT,
59 	W_6BIT,
60 	W_8BIT,
61 	W_10BIT,
62 	W_12BIT,
63 	W_14BIT,
64 	W_16BIT,
65 	W_20BIT,
66 	W_24BIT,
67 	W_32BIT,
68 };
69 
70 extern enum bus_pixeltype find_bus_type(u32 code);
71 extern enum bit_width find_bus_width(u32 code);
72 extern enum bit_width find_bus_precision(u32 code);
73 extern enum pixel_fmt_type find_pixel_fmt_type(unsigned int pix_fmt);
74 
75 #endif /*__BSP_COMMON__H__*/
76