xref: /netbsd-src/sys/external/bsd/drm2/dist/include/drm/i2c/ch7006.h (revision 41ec02673d281bbb3d38e6c78504ce6e30c228c1)
1 /*	$NetBSD: ch7006.h,v 1.3 2021/12/18 23:45:46 riastradh Exp $	*/
2 
3 /*
4  * Copyright (C) 2009 Francisco Jerez.
5  * All Rights Reserved.
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining
8  * a copy of this software and associated documentation files (the
9  * "Software"), to deal in the Software without restriction, including
10  * without limitation the rights to use, copy, modify, merge, publish,
11  * distribute, sublicense, and/or sell copies of the Software, and to
12  * permit persons to whom the Software is furnished to do so, subject to
13  * the following conditions:
14  *
15  * The above copyright notice and this permission notice (including the
16  * next paragraph) shall be included in all copies or substantial
17  * portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
23  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26  *
27  */
28 
29 #ifndef __DRM_I2C_CH7006_H__
30 #define __DRM_I2C_CH7006_H__
31 
32 /**
33  * struct ch7006_encoder_params
34  *
35  * Describes how the ch7006 is wired up with the GPU. It should be
36  * used as the @params parameter of its @set_config method.
37  *
38  * See "http://www.chrontel.com/pdf/7006.pdf" for their precise
39  * meaning.
40  */
41 struct ch7006_encoder_params {
42 	enum {
43 		CH7006_FORMAT_RGB16 = 0,
44 		CH7006_FORMAT_YCrCb24m16,
45 		CH7006_FORMAT_RGB24m16,
46 		CH7006_FORMAT_RGB15,
47 		CH7006_FORMAT_RGB24m12C,
48 		CH7006_FORMAT_RGB24m12I,
49 		CH7006_FORMAT_RGB24m8,
50 		CH7006_FORMAT_RGB16m8,
51 		CH7006_FORMAT_RGB15m8,
52 		CH7006_FORMAT_YCrCb24m8,
53 	} input_format;
54 
55 	enum {
56 		CH7006_CLOCK_SLAVE = 0,
57 		CH7006_CLOCK_MASTER,
58 	} clock_mode;
59 
60 	enum {
61 		CH7006_CLOCK_EDGE_NEG = 0,
62 		CH7006_CLOCK_EDGE_POS,
63 	} clock_edge;
64 
65 	int xcm, pcm;
66 
67 	enum {
68 		CH7006_SYNC_SLAVE = 0,
69 		CH7006_SYNC_MASTER,
70 	} sync_direction;
71 
72 	enum {
73 		CH7006_SYNC_SEPARATED = 0,
74 		CH7006_SYNC_EMBEDDED,
75 	} sync_encoding;
76 
77 	enum {
78 		CH7006_POUT_1_8V = 0,
79 		CH7006_POUT_3_3V,
80 	} pout_level;
81 
82 	enum {
83 		CH7006_ACTIVE_HSYNC = 0,
84 		CH7006_ACTIVE_DSTART,
85 	} active_detect;
86 };
87 
88 #endif
89