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