2 * Copyright 2007 Jérôme Glisse
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
26 * Jerome Glisse <glisse@freedesktop.org>
30 #include "radeon_ms.h"
32 struct radeon_ms_output radeon_ms_dac1 = {
36 radeon_ms_dac1_initialize,
37 radeon_ms_dac1_detect,
39 radeon_ms_dac1_get_modes,
40 radeon_ms_dac1_mode_fixup,
41 radeon_ms_dac1_mode_set,
42 radeon_ms_dac1_restore,
46 struct radeon_ms_output radeon_ms_dac2 = {
50 radeon_ms_dac2_initialize,
51 radeon_ms_dac2_detect,
53 radeon_ms_dac2_get_modes,
54 radeon_ms_dac2_mode_fixup,
55 radeon_ms_dac2_mode_set,
56 radeon_ms_dac2_restore,
60 struct radeon_ms_connector radeon_ms_vga = {
61 NULL, NULL, NULL, CONNECTOR_VGA, MT_NONE, 0, GPIO_DDC1,
63 0, -1, -1, -1, -1, -1, -1, -1
68 struct radeon_ms_connector radeon_ms_dvi_i_2 = {
69 NULL, NULL, NULL, CONNECTOR_DVI_I, MT_NONE, 0, GPIO_DDC2,
71 1, -1, -1, -1, -1, -1, -1, -1
76 struct radeon_ms_properties properties[] = {
77 /* default only one VGA connector */
79 0, 0, 27000, 12, 25000, 200000, 1, 1, 1, 1,
81 &radeon_ms_dac1, NULL, NULL, NULL, NULL, NULL, NULL,
85 &radeon_ms_vga, NULL, NULL, NULL, NULL, NULL, NULL,
91 int radeon_ms_properties_init(struct drm_device *dev)
93 struct drm_radeon_private *dev_priv = dev->dev_private;
96 for (i = 1; i < sizeof(properties)/sizeof(properties[0]); i++) {
97 if (dev->pdev->subsystem_vendor == properties[i].subvendor &&
98 dev->pdev->subsystem_device == properties[i].subdevice) {
99 DRM_INFO("[radeon_ms] found properties for "
100 "0x%04X:0x%04X\n", properties[i].subvendor,
101 properties[i].subdevice);
102 memcpy(&dev_priv->properties, &properties[i],
103 sizeof(struct radeon_ms_properties));
106 if (dev_priv->properties.subvendor == 0) {
107 ret = radeon_ms_rom_get_properties(dev);
112 memcpy(&dev_priv->properties, &properties[0],
113 sizeof(struct radeon_ms_properties));
115 dev_priv->properties.pll_dummy_reads = 1;
116 dev_priv->properties.pll_delay = 1;
117 dev_priv->properties.pll_r300_errata = 1;
119 dev_priv->properties.subvendor = dev->pdev->subsystem_vendor;
120 dev_priv->properties.subdevice = dev->pdev->subsystem_device;