2 * Copyright (c) 2006 Dave Airlie <airlied@linux.ie>
3 * Copyright (c) 2007 Intel Corporation
4 * Jesse Barnes <jesse.barnes@intel.com>
6 #ifndef __INTEL_DRV_H__
7 #define __INTEL_DRV_H__
10 #include <linux/i2c-id.h>
11 #include <linux/i2c-algo-bit.h>
15 * Display related stuff
18 /* store information about an Ixxx DVO */
19 /* The i830->i865 use multiple DVOs with multiple i2cs */
20 /* the i915, i945 have a single sDVO i2c bus - which is different */
23 #define INTEL_I2C_BUS_DVO 1
24 #define INTEL_I2C_BUS_SDVO 2
26 /* these are outputs from the chip - integrated only
27 external chips are via DVO or SDVO output */
28 #define INTEL_OUTPUT_UNUSED 0
29 #define INTEL_OUTPUT_ANALOG 1
30 #define INTEL_OUTPUT_DVO 2
31 #define INTEL_OUTPUT_SDVO 3
32 #define INTEL_OUTPUT_LVDS 4
33 #define INTEL_OUTPUT_TVOUT 5
35 #define INTEL_DVO_CHIP_NONE 0
36 #define INTEL_DVO_CHIP_LVDS 1
37 #define INTEL_DVO_CHIP_TMDS 2
38 #define INTEL_DVO_CHIP_TVOUT 4
40 struct intel_i2c_chan {
41 struct drm_device *drm_dev; /* for getting at dev. private (mmio etc.) */
42 u32 reg; /* GPIO reg */
43 struct i2c_adapter adapter;
44 struct i2c_algo_bit_data algo;
50 struct intel_i2c_chan *i2c_bus; /* for control functions */
51 struct intel_i2c_chan *ddc_bus; /* for DDC only stuff */
58 u8 lut_r[256], lut_g[256], lut_b[256];
61 struct intel_i2c_chan *intel_i2c_create(struct drm_device *dev, const u32 reg,
63 void intel_i2c_destroy(struct intel_i2c_chan *chan);
64 int intel_ddc_get_modes(struct drm_output *output);
65 extern bool intel_ddc_probe(struct drm_output *output);
67 extern void intel_crt_init(struct drm_device *dev);
68 extern void intel_sdvo_init(struct drm_device *dev, int output_device);
69 extern void intel_lvds_init(struct drm_device *dev);
71 extern void intel_crtc_load_lut(struct drm_crtc *crtc);
72 extern void intel_output_prepare (struct drm_output *output);
73 extern void intel_output_commit (struct drm_output *output);
74 extern struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev,
75 struct drm_crtc *crtc);
76 extern void intel_wait_for_vblank(struct drm_device *dev);
77 extern struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe);
79 extern int intelfb_probe(struct drm_device *dev, struct drm_crtc *crtc);
80 extern int intelfb_remove(struct drm_device *dev, struct drm_crtc *crtc);
82 #endif /* __INTEL_DRV_H__ */