]> git.ipfire.org Git - thirdparty/kernel/stable.git/blame - drivers/gpu/drm/i915/display/intel_dvo_dev.h
Merge tag 'drm-intel-next-2024-02-27-1' of git://anongit.freedesktop.org/drm/drm...
[thirdparty/kernel/stable.git] / drivers / gpu / drm / i915 / display / intel_dvo_dev.h
CommitLineData
79e53945
JB
1/*
2 * Copyright © 2006 Eric Anholt
3 *
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that copyright
7 * notice and this permission notice appear in supporting documentation, and
8 * that the name of the copyright holders not be used in advertising or
9 * publicity pertaining to distribution of the software without specific,
10 * written prior permission. The copyright holders make no representations
11 * about the suitability of this software for any purpose. It is provided "as
12 * is" without express or implied warranty.
13 *
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
20 * OF THIS SOFTWARE.
21 */
22
531747b8
JN
23#ifndef __INTEL_DVO_DEV_H__
24#define __INTEL_DVO_DEV_H__
79e53945 25
ce2fce25 26#include "i915_reg_defs.h"
356d725d 27
acc855d3 28#include "intel_display_limits.h"
a8d9a13d 29
356d725d
JN
30enum drm_connector_status;
31struct drm_display_mode;
32struct i2c_adapter;
79e53945
JB
33
34struct intel_dvo_device {
ea5b213a 35 const char *name;
79e53945 36 int type;
a8d9a13d
VS
37 /* DVOA/B/C */
38 enum port port;
79e53945
JB
39 /* GPIO register used for i2c bus to control this device */
40 u32 gpio;
41 int slave_addr;
79e53945
JB
42
43 const struct intel_dvo_dev_ops *dev_ops;
44 void *dev_priv;
ea5b213a 45 struct i2c_adapter *i2c_bus;
79e53945
JB
46};
47
48struct intel_dvo_dev_ops {
49 /*
50 * Initialize the device at startup time.
51 * Returns NULL if the device does not exist.
52 */
53 bool (*init)(struct intel_dvo_device *dvo,
f9c10a9b 54 struct i2c_adapter *i2cbus);
79e53945 55
79e53945 56 /*
fac3274c 57 * Turn on/off output.
79e53945 58 *
fac3274c
SV
59 * Because none of our dvo drivers support an intermediate power levels,
60 * we don't expose this in the interfac.
79e53945 61 */
fac3274c 62 void (*dpms)(struct intel_dvo_device *dvo, bool enable);
79e53945 63
79e53945
JB
64 /*
65 * Callback for testing a video mode for a given output.
66 *
67 * This function should only check for cases where a mode can't
68 * be supported on the output specifically, and not represent
69 * generic CRTC limitations.
70 *
71 * \return MODE_OK if the mode is valid, or another MODE_* otherwise.
72 */
21f0b7da
NH
73 enum drm_mode_status (*mode_valid)(struct intel_dvo_device *dvo,
74 struct drm_display_mode *mode);
79e53945 75
79e53945
JB
76 /*
77 * Callback for setting up a video mode after fixups have been made.
78 *
79 * This is only called while the output is disabled. The dpms callback
80 * must be all that's necessary for the output, to turn the output on
81 * after this function is called.
82 */
83 void (*mode_set)(struct intel_dvo_device *dvo,
7c5f93b0
VS
84 const struct drm_display_mode *mode,
85 const struct drm_display_mode *adjusted_mode);
79e53945
JB
86
87 /*
88 * Probe for a connected output, and return detect_status.
89 */
90 enum drm_connector_status (*detect)(struct intel_dvo_device *dvo);
91
732ce74f
SV
92 /*
93 * Probe the current hw status, returning true if the connected output
94 * is active.
95 */
96 bool (*get_hw_state)(struct intel_dvo_device *dev);
97
79e53945
JB
98 /**
99 * Clean up driver-specific bits of the output
100 */
101 void (*destroy) (struct intel_dvo_device *dvo);
102
103 /**
104 * Debugging hook to dump device registers to log file
105 */
106 void (*dump_regs)(struct intel_dvo_device *dvo);
107};
108
0f555644
JL
109extern const struct intel_dvo_dev_ops sil164_ops;
110extern const struct intel_dvo_dev_ops ch7xxx_ops;
111extern const struct intel_dvo_dev_ops ivch_ops;
112extern const struct intel_dvo_dev_ops tfp410_ops;
113extern const struct intel_dvo_dev_ops ch7017_ops;
114extern const struct intel_dvo_dev_ops ns2501_ops;
606df4e0 115
531747b8 116#endif /* __INTEL_DVO_DEV_H__ */