Rev 3120 | Rev 3480 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3120 | Rev 3243 | ||
---|---|---|---|
Line 25... | Line 25... | ||
25 | * Authors: |
25 | * Authors: |
26 | * Eric Anholt |
26 | * Eric Anholt |
27 | */ |
27 | */ |
28 | #include |
28 | #include |
29 | #include |
29 | #include |
30 | //#include |
30 | #include |
31 | #include |
31 | #include |
32 | #include |
32 | #include |
33 | #include |
33 | #include |
34 | #include |
34 | #include |
35 | #include "intel_drv.h" |
35 | #include "intel_drv.h" |
Line 516... | Line 516... | ||
516 | } |
516 | } |
Line 517... | Line 517... | ||
517 | 517 | ||
518 | static bool intel_sdvo_read_response(struct intel_sdvo *intel_sdvo, |
518 | static bool intel_sdvo_read_response(struct intel_sdvo *intel_sdvo, |
519 | void *response, int response_len) |
519 | void *response, int response_len) |
520 | { |
520 | { |
521 | u8 retry = 5; |
521 | u8 retry = 15; /* 5 quick checks, followed by 10 long checks */ |
522 | u8 status; |
522 | u8 status; |
Line 523... | Line 523... | ||
523 | int i; |
523 | int i; |
Line 529... | Line 529... | ||
529 | * processed within 15µs, and that we need only poll |
529 | * processed within 15µs, and that we need only poll |
530 | * the status byte a maximum of 3 times in order for the |
530 | * the status byte a maximum of 3 times in order for the |
531 | * command to be complete. |
531 | * command to be complete. |
532 | * |
532 | * |
533 | * Check 5 times in case the hardware failed to read the docs. |
533 | * Check 5 times in case the hardware failed to read the docs. |
- | 534 | * |
|
- | 535 | * Also beware that the first response by many devices is to |
|
- | 536 | * reply PENDING and stall for time. TVs are notorious for |
|
- | 537 | * requiring longer than specified to complete their replies. |
|
- | 538 | * Originally (in the DDX long ago), the delay was only ever 15ms |
|
- | 539 | * with an additional delay of 30ms applied for TVs added later after |
|
- | 540 | * many experiments. To accommodate both sets of delays, we do a |
|
- | 541 | * sequence of slow checks if the device is falling behind and fails |
|
- | 542 | * to reply within 5*15µs. |
|
534 | */ |
543 | */ |
535 | if (!intel_sdvo_read_byte(intel_sdvo, |
544 | if (!intel_sdvo_read_byte(intel_sdvo, |
536 | SDVO_I2C_CMD_STATUS, |
545 | SDVO_I2C_CMD_STATUS, |
537 | &status)) |
546 | &status)) |
538 | goto log_fail; |
547 | goto log_fail; |
Line 539... | Line 548... | ||
539 | 548 | ||
- | 549 | while (status == SDVO_CMD_STATUS_PENDING && --retry) { |
|
- | 550 | if (retry < 10) |
|
- | 551 | msleep(15); |
|
540 | while (status == SDVO_CMD_STATUS_PENDING && retry--) { |
552 | else |
- | 553 | udelay(15); |
|
541 | udelay(15); |
554 | |
542 | if (!intel_sdvo_read_byte(intel_sdvo, |
555 | if (!intel_sdvo_read_byte(intel_sdvo, |
543 | SDVO_I2C_CMD_STATUS, |
556 | SDVO_I2C_CMD_STATUS, |
544 | &status)) |
557 | &status)) |
545 | goto log_fail; |
558 | goto log_fail; |
Line 1235... | Line 1248... | ||
1235 | intel_sdvo_set_encoder_power_state(intel_sdvo, |
1248 | intel_sdvo_set_encoder_power_state(intel_sdvo, |
1236 | DRM_MODE_DPMS_OFF); |
1249 | DRM_MODE_DPMS_OFF); |
Line 1237... | Line 1250... | ||
1237 | 1250 | ||
1238 | temp = I915_READ(intel_sdvo->sdvo_reg); |
1251 | temp = I915_READ(intel_sdvo->sdvo_reg); |
- | 1252 | if ((temp & SDVO_ENABLE) != 0) { |
|
- | 1253 | /* HW workaround for IBX, we need to move the port to |
|
- | 1254 | * transcoder A before disabling it. */ |
|
- | 1255 | if (HAS_PCH_IBX(encoder->base.dev)) { |
|
- | 1256 | struct drm_crtc *crtc = encoder->base.crtc; |
|
- | 1257 | int pipe = crtc ? to_intel_crtc(crtc)->pipe : -1; |
|
- | 1258 | ||
- | 1259 | if (temp & SDVO_PIPE_B_SELECT) { |
|
- | 1260 | temp &= ~SDVO_PIPE_B_SELECT; |
|
- | 1261 | I915_WRITE(intel_sdvo->sdvo_reg, temp); |
|
- | 1262 | POSTING_READ(intel_sdvo->sdvo_reg); |
|
- | 1263 | ||
- | 1264 | /* Again we need to write this twice. */ |
|
- | 1265 | I915_WRITE(intel_sdvo->sdvo_reg, temp); |
|
- | 1266 | POSTING_READ(intel_sdvo->sdvo_reg); |
|
- | 1267 | ||
- | 1268 | /* Transcoder selection bits only update |
|
- | 1269 | * effectively on vblank. */ |
|
- | 1270 | if (crtc) |
|
- | 1271 | intel_wait_for_vblank(encoder->base.dev, pipe); |
|
- | 1272 | else |
|
- | 1273 | msleep(50); |
|
- | 1274 | } |
|
- | 1275 | } |
|
1239 | if ((temp & SDVO_ENABLE) != 0) { |
1276 | |
1240 | intel_sdvo_write_sdvox(intel_sdvo, temp & ~SDVO_ENABLE); |
1277 | intel_sdvo_write_sdvox(intel_sdvo, temp & ~SDVO_ENABLE); |
1241 | } |
1278 | } |
Line 1242... | Line 1279... | ||
1242 | } |
1279 | } |
Line 1251... | Line 1288... | ||
1251 | bool input1, input2; |
1288 | bool input1, input2; |
1252 | int i; |
1289 | int i; |
1253 | u8 status; |
1290 | u8 status; |
Line 1254... | Line 1291... | ||
1254 | 1291 | ||
1255 | temp = I915_READ(intel_sdvo->sdvo_reg); |
1292 | temp = I915_READ(intel_sdvo->sdvo_reg); |
- | 1293 | if ((temp & SDVO_ENABLE) == 0) { |
|
- | 1294 | /* HW workaround for IBX, we need to move the port |
|
- | 1295 | * to transcoder A before disabling it. */ |
|
- | 1296 | if (HAS_PCH_IBX(dev)) { |
|
- | 1297 | struct drm_crtc *crtc = encoder->base.crtc; |
|
- | 1298 | int pipe = crtc ? to_intel_crtc(crtc)->pipe : -1; |
|
- | 1299 | ||
- | 1300 | /* Restore the transcoder select bit. */ |
|
- | 1301 | if (pipe == PIPE_B) |
|
- | 1302 | temp |= SDVO_PIPE_B_SELECT; |
|
- | 1303 | } |
|
1256 | if ((temp & SDVO_ENABLE) == 0) |
1304 | |
- | 1305 | intel_sdvo_write_sdvox(intel_sdvo, temp | SDVO_ENABLE); |
|
1257 | intel_sdvo_write_sdvox(intel_sdvo, temp | SDVO_ENABLE); |
1306 | } |
1258 | for (i = 0; i < 2; i++) |
1307 | for (i = 0; i < 2; i++) |
Line 1259... | Line 1308... | ||
1259 | intel_wait_for_vblank(dev, intel_crtc->pipe); |
1308 | intel_wait_for_vblank(dev, intel_crtc->pipe); |
1260 | 1309 | ||
Line 1506... | Line 1555... | ||
1506 | uint16_t response; |
1555 | uint16_t response; |
1507 | struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector); |
1556 | struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector); |
1508 | struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector); |
1557 | struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector); |
1509 | enum drm_connector_status ret; |
1558 | enum drm_connector_status ret; |
Line 1510... | Line 1559... | ||
1510 | 1559 | ||
1511 | if (!intel_sdvo_write_cmd(intel_sdvo, |
1560 | if (!intel_sdvo_get_value(intel_sdvo, |
1512 | SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0)) |
- | |
1513 | return connector_status_unknown; |
- | |
1514 | - | ||
1515 | /* add 30ms delay when the output type might be TV */ |
- | |
1516 | if (intel_sdvo->caps.output_flags & SDVO_TV_MASK) |
1561 | SDVO_CMD_GET_ATTACHED_DISPLAYS, |
1517 | msleep(30); |
- | |
1518 | - | ||
1519 | if (!intel_sdvo_read_response(intel_sdvo, &response, 2)) |
1562 | &response, 2)) |
Line 1520... | Line 1563... | ||
1520 | return connector_status_unknown; |
1563 | return connector_status_unknown; |
1521 | 1564 | ||
1522 | DRM_DEBUG_KMS("SDVO response %d %d [%x]\n", |
1565 | DRM_DEBUG_KMS("SDVO response %d %d [%x]\n", |
Line 1803... | Line 1846... | ||
1803 | intel_sdvo_connector->tv_format); |
1846 | intel_sdvo_connector->tv_format); |
Line 1804... | Line 1847... | ||
1804 | 1847 | ||
1805 | intel_sdvo_destroy_enhance_property(connector); |
1848 | intel_sdvo_destroy_enhance_property(connector); |
1806 | drm_sysfs_connector_remove(connector); |
1849 | drm_sysfs_connector_remove(connector); |
1807 | drm_connector_cleanup(connector); |
1850 | drm_connector_cleanup(connector); |
1808 | kfree(connector); |
1851 | kfree(intel_sdvo_connector); |
Line 1809... | Line 1852... | ||
1809 | } |
1852 | } |
1810 | 1853 | ||
1811 | static bool intel_sdvo_detect_hdmi_audio(struct drm_connector *connector) |
1854 | static bool intel_sdvo_detect_hdmi_audio(struct drm_connector *connector) |
Line 1835... | Line 1878... | ||
1835 | struct drm_i915_private *dev_priv = connector->dev->dev_private; |
1878 | struct drm_i915_private *dev_priv = connector->dev->dev_private; |
1836 | uint16_t temp_value; |
1879 | uint16_t temp_value; |
1837 | uint8_t cmd; |
1880 | uint8_t cmd; |
1838 | int ret; |
1881 | int ret; |
Line 1839... | Line 1882... | ||
1839 | 1882 | ||
1840 | ret = drm_connector_property_set_value(connector, property, val); |
1883 | ret = drm_object_property_set_value(&connector->base, property, val); |
1841 | if (ret) |
1884 | if (ret) |
Line 1842... | Line 1885... | ||
1842 | return ret; |
1885 | return ret; |
1843 | 1886 | ||
Line 1892... | Line 1935... | ||
1892 | intel_sdvo->tv_format_index = intel_sdvo_connector->tv_format_supported[val]; |
1935 | intel_sdvo->tv_format_index = intel_sdvo_connector->tv_format_supported[val]; |
1893 | goto done; |
1936 | goto done; |
1894 | } else if (IS_TV_OR_LVDS(intel_sdvo_connector)) { |
1937 | } else if (IS_TV_OR_LVDS(intel_sdvo_connector)) { |
1895 | temp_value = val; |
1938 | temp_value = val; |
1896 | if (intel_sdvo_connector->left == property) { |
1939 | if (intel_sdvo_connector->left == property) { |
1897 | drm_connector_property_set_value(connector, |
1940 | drm_object_property_set_value(&connector->base, |
1898 | intel_sdvo_connector->right, val); |
1941 | intel_sdvo_connector->right, val); |
1899 | if (intel_sdvo_connector->left_margin == temp_value) |
1942 | if (intel_sdvo_connector->left_margin == temp_value) |
1900 | return 0; |
1943 | return 0; |
Line 1901... | Line 1944... | ||
1901 | 1944 | ||
Line 1904... | Line 1947... | ||
1904 | temp_value = intel_sdvo_connector->max_hscan - |
1947 | temp_value = intel_sdvo_connector->max_hscan - |
1905 | intel_sdvo_connector->left_margin; |
1948 | intel_sdvo_connector->left_margin; |
1906 | cmd = SDVO_CMD_SET_OVERSCAN_H; |
1949 | cmd = SDVO_CMD_SET_OVERSCAN_H; |
1907 | goto set_value; |
1950 | goto set_value; |
1908 | } else if (intel_sdvo_connector->right == property) { |
1951 | } else if (intel_sdvo_connector->right == property) { |
1909 | drm_connector_property_set_value(connector, |
1952 | drm_object_property_set_value(&connector->base, |
1910 | intel_sdvo_connector->left, val); |
1953 | intel_sdvo_connector->left, val); |
1911 | if (intel_sdvo_connector->right_margin == temp_value) |
1954 | if (intel_sdvo_connector->right_margin == temp_value) |
1912 | return 0; |
1955 | return 0; |
Line 1913... | Line 1956... | ||
1913 | 1956 | ||
Line 1916... | Line 1959... | ||
1916 | temp_value = intel_sdvo_connector->max_hscan - |
1959 | temp_value = intel_sdvo_connector->max_hscan - |
1917 | intel_sdvo_connector->left_margin; |
1960 | intel_sdvo_connector->left_margin; |
1918 | cmd = SDVO_CMD_SET_OVERSCAN_H; |
1961 | cmd = SDVO_CMD_SET_OVERSCAN_H; |
1919 | goto set_value; |
1962 | goto set_value; |
1920 | } else if (intel_sdvo_connector->top == property) { |
1963 | } else if (intel_sdvo_connector->top == property) { |
1921 | drm_connector_property_set_value(connector, |
1964 | drm_object_property_set_value(&connector->base, |
1922 | intel_sdvo_connector->bottom, val); |
1965 | intel_sdvo_connector->bottom, val); |
1923 | if (intel_sdvo_connector->top_margin == temp_value) |
1966 | if (intel_sdvo_connector->top_margin == temp_value) |
1924 | return 0; |
1967 | return 0; |
Line 1925... | Line 1968... | ||
1925 | 1968 | ||
Line 1928... | Line 1971... | ||
1928 | temp_value = intel_sdvo_connector->max_vscan - |
1971 | temp_value = intel_sdvo_connector->max_vscan - |
1929 | intel_sdvo_connector->top_margin; |
1972 | intel_sdvo_connector->top_margin; |
1930 | cmd = SDVO_CMD_SET_OVERSCAN_V; |
1973 | cmd = SDVO_CMD_SET_OVERSCAN_V; |
1931 | goto set_value; |
1974 | goto set_value; |
1932 | } else if (intel_sdvo_connector->bottom == property) { |
1975 | } else if (intel_sdvo_connector->bottom == property) { |
1933 | drm_connector_property_set_value(connector, |
1976 | drm_object_property_set_value(&connector->base, |
1934 | intel_sdvo_connector->top, val); |
1977 | intel_sdvo_connector->top, val); |
1935 | if (intel_sdvo_connector->bottom_margin == temp_value) |
1978 | if (intel_sdvo_connector->bottom_margin == temp_value) |
1936 | return 0; |
1979 | return 0; |
Line 1937... | Line 1980... | ||
1937 | 1980 | ||
Line 2001... | Line 2044... | ||
2001 | 2044 | ||
2002 | if (intel_sdvo->sdvo_lvds_fixed_mode != NULL) |
2045 | if (intel_sdvo->sdvo_lvds_fixed_mode != NULL) |
2003 | drm_mode_destroy(encoder->dev, |
2046 | drm_mode_destroy(encoder->dev, |
Line 2004... | Line 2047... | ||
2004 | intel_sdvo->sdvo_lvds_fixed_mode); |
2047 | intel_sdvo->sdvo_lvds_fixed_mode); |
2005 | 2048 | ||
2006 | // i2c_del_adapter(&intel_sdvo->ddc); |
2049 | i2c_del_adapter(&intel_sdvo->ddc); |
Line 2007... | Line 2050... | ||
2007 | intel_encoder_destroy(encoder); |
2050 | intel_encoder_destroy(encoder); |
2008 | } |
2051 | } |
Line 2081... | Line 2124... | ||
2081 | if (sdvo->is_sdvob) |
2124 | if (sdvo->is_sdvob) |
2082 | mapping = &dev_priv->sdvo_mappings[0]; |
2125 | mapping = &dev_priv->sdvo_mappings[0]; |
2083 | else |
2126 | else |
2084 | mapping = &dev_priv->sdvo_mappings[1]; |
2127 | mapping = &dev_priv->sdvo_mappings[1]; |
Line 2085... | Line -... | ||
2085 | - | ||
2086 | pin = GMBUS_PORT_DPB; |
2128 | |
2087 | if (mapping->initialized) |
2129 | if (mapping->initialized && intel_gmbus_is_port_valid(mapping->i2c_pin)) |
- | 2130 | pin = mapping->i2c_pin; |
|
- | 2131 | else |
|
Line 2088... | Line -... | ||
2088 | pin = mapping->i2c_pin; |
- | |
2089 | 2132 | pin = GMBUS_PORT_DPB; |
|
- | 2133 | ||
2090 | if (intel_gmbus_is_port_valid(pin)) { |
2134 | sdvo->i2c = intel_gmbus_get_adapter(dev_priv, pin); |
- | 2135 | ||
- | 2136 | /* With gmbus we should be able to drive sdvo i2c at 2MHz, but somehow |
|
2091 | sdvo->i2c = intel_gmbus_get_adapter(dev_priv, pin); |
2137 | * our code totally fails once we start using gmbus. Hence fall back to |
2092 | intel_gmbus_set_speed(sdvo->i2c, GMBUS_RATE_1MHZ); |
- | |
2093 | intel_gmbus_force_bit(sdvo->i2c, true); |
- | |
2094 | } else { |
2138 | * bit banging for now. */ |
- | 2139 | intel_gmbus_force_bit(sdvo->i2c, true); |
|
- | 2140 | } |
|
- | 2141 | ||
- | 2142 | /* undo any changes intel_sdvo_select_i2c_bus() did to sdvo->i2c */ |
|
- | 2143 | static void |
|
- | 2144 | intel_sdvo_unselect_i2c_bus(struct intel_sdvo *sdvo) |
|
2095 | sdvo->i2c = intel_gmbus_get_adapter(dev_priv, GMBUS_PORT_DPB); |
2145 | { |
Line 2096... | Line 2146... | ||
2096 | } |
2146 | intel_gmbus_force_bit(sdvo->i2c, false); |
2097 | } |
2147 | } |
2098 | 2148 | ||
Line 2436... | Line 2486... | ||
2436 | drm_property_add_enum( |
2486 | drm_property_add_enum( |
2437 | intel_sdvo_connector->tv_format, i, |
2487 | intel_sdvo_connector->tv_format, i, |
2438 | i, tv_format_names[intel_sdvo_connector->tv_format_supported[i]]); |
2488 | i, tv_format_names[intel_sdvo_connector->tv_format_supported[i]]); |
Line 2439... | Line 2489... | ||
2439 | 2489 | ||
2440 | intel_sdvo->tv_format_index = intel_sdvo_connector->tv_format_supported[0]; |
2490 | intel_sdvo->tv_format_index = intel_sdvo_connector->tv_format_supported[0]; |
2441 | drm_connector_attach_property(&intel_sdvo_connector->base.base, |
2491 | drm_object_attach_property(&intel_sdvo_connector->base.base.base, |
2442 | intel_sdvo_connector->tv_format, 0); |
2492 | intel_sdvo_connector->tv_format, 0); |
Line 2443... | Line 2493... | ||
2443 | return true; |
2493 | return true; |
Line 2452... | Line 2502... | ||
2452 | intel_sdvo_connector->max_##name = data_value[0]; \ |
2502 | intel_sdvo_connector->max_##name = data_value[0]; \ |
2453 | intel_sdvo_connector->cur_##name = response; \ |
2503 | intel_sdvo_connector->cur_##name = response; \ |
2454 | intel_sdvo_connector->name = \ |
2504 | intel_sdvo_connector->name = \ |
2455 | drm_property_create_range(dev, 0, #name, 0, data_value[0]); \ |
2505 | drm_property_create_range(dev, 0, #name, 0, data_value[0]); \ |
2456 | if (!intel_sdvo_connector->name) return false; \ |
2506 | if (!intel_sdvo_connector->name) return false; \ |
2457 | drm_connector_attach_property(connector, \ |
2507 | drm_object_attach_property(&connector->base, \ |
2458 | intel_sdvo_connector->name, \ |
2508 | intel_sdvo_connector->name, \ |
2459 | intel_sdvo_connector->cur_##name); \ |
2509 | intel_sdvo_connector->cur_##name); \ |
2460 | DRM_DEBUG_KMS(#name ": max %d, default %d, current %d\n", \ |
2510 | DRM_DEBUG_KMS(#name ": max %d, default %d, current %d\n", \ |
2461 | data_value[0], data_value[1], response); \ |
2511 | data_value[0], data_value[1], response); \ |
2462 | } \ |
2512 | } \ |
Line 2489... | Line 2539... | ||
2489 | intel_sdvo_connector->left = |
2539 | intel_sdvo_connector->left = |
2490 | drm_property_create_range(dev, 0, "left_margin", 0, data_value[0]); |
2540 | drm_property_create_range(dev, 0, "left_margin", 0, data_value[0]); |
2491 | if (!intel_sdvo_connector->left) |
2541 | if (!intel_sdvo_connector->left) |
2492 | return false; |
2542 | return false; |
Line 2493... | Line 2543... | ||
2493 | 2543 | ||
2494 | drm_connector_attach_property(connector, |
2544 | drm_object_attach_property(&connector->base, |
2495 | intel_sdvo_connector->left, |
2545 | intel_sdvo_connector->left, |
Line 2496... | Line 2546... | ||
2496 | intel_sdvo_connector->left_margin); |
2546 | intel_sdvo_connector->left_margin); |
2497 | 2547 | ||
2498 | intel_sdvo_connector->right = |
2548 | intel_sdvo_connector->right = |
2499 | drm_property_create_range(dev, 0, "right_margin", 0, data_value[0]); |
2549 | drm_property_create_range(dev, 0, "right_margin", 0, data_value[0]); |
Line 2500... | Line 2550... | ||
2500 | if (!intel_sdvo_connector->right) |
2550 | if (!intel_sdvo_connector->right) |
2501 | return false; |
2551 | return false; |
2502 | 2552 | ||
2503 | drm_connector_attach_property(connector, |
2553 | drm_object_attach_property(&connector->base, |
2504 | intel_sdvo_connector->right, |
2554 | intel_sdvo_connector->right, |
2505 | intel_sdvo_connector->right_margin); |
2555 | intel_sdvo_connector->right_margin); |
Line 2526... | Line 2576... | ||
2526 | drm_property_create_range(dev, 0, |
2576 | drm_property_create_range(dev, 0, |
2527 | "top_margin", 0, data_value[0]); |
2577 | "top_margin", 0, data_value[0]); |
2528 | if (!intel_sdvo_connector->top) |
2578 | if (!intel_sdvo_connector->top) |
2529 | return false; |
2579 | return false; |
Line 2530... | Line 2580... | ||
2530 | 2580 | ||
2531 | drm_connector_attach_property(connector, |
2581 | drm_object_attach_property(&connector->base, |
2532 | intel_sdvo_connector->top, |
2582 | intel_sdvo_connector->top, |
Line 2533... | Line 2583... | ||
2533 | intel_sdvo_connector->top_margin); |
2583 | intel_sdvo_connector->top_margin); |
2534 | 2584 | ||
2535 | intel_sdvo_connector->bottom = |
2585 | intel_sdvo_connector->bottom = |
2536 | drm_property_create_range(dev, 0, |
2586 | drm_property_create_range(dev, 0, |
2537 | "bottom_margin", 0, data_value[0]); |
2587 | "bottom_margin", 0, data_value[0]); |
Line 2538... | Line 2588... | ||
2538 | if (!intel_sdvo_connector->bottom) |
2588 | if (!intel_sdvo_connector->bottom) |
2539 | return false; |
2589 | return false; |
2540 | 2590 | ||
2541 | drm_connector_attach_property(connector, |
2591 | drm_object_attach_property(&connector->base, |
2542 | intel_sdvo_connector->bottom, |
2592 | intel_sdvo_connector->bottom, |
2543 | intel_sdvo_connector->bottom_margin); |
2593 | intel_sdvo_connector->bottom_margin); |
Line 2568... | Line 2618... | ||
2568 | intel_sdvo_connector->dot_crawl = |
2618 | intel_sdvo_connector->dot_crawl = |
2569 | drm_property_create_range(dev, 0, "dot_crawl", 0, 1); |
2619 | drm_property_create_range(dev, 0, "dot_crawl", 0, 1); |
2570 | if (!intel_sdvo_connector->dot_crawl) |
2620 | if (!intel_sdvo_connector->dot_crawl) |
2571 | return false; |
2621 | return false; |
Line 2572... | Line 2622... | ||
2572 | 2622 | ||
2573 | drm_connector_attach_property(connector, |
2623 | drm_object_attach_property(&connector->base, |
2574 | intel_sdvo_connector->dot_crawl, |
2624 | intel_sdvo_connector->dot_crawl, |
2575 | intel_sdvo_connector->cur_dot_crawl); |
2625 | intel_sdvo_connector->cur_dot_crawl); |
2576 | DRM_DEBUG_KMS("dot crawl: current %d\n", response); |
2626 | DRM_DEBUG_KMS("dot crawl: current %d\n", response); |
Line 2653... | Line 2703... | ||
2653 | snprintf(sdvo->ddc.name, I2C_NAME_SIZE, "SDVO DDC proxy"); |
2703 | snprintf(sdvo->ddc.name, I2C_NAME_SIZE, "SDVO DDC proxy"); |
2654 | sdvo->ddc.dev.parent = &dev->pdev->dev; |
2704 | sdvo->ddc.dev.parent = &dev->pdev->dev; |
2655 | sdvo->ddc.algo_data = sdvo; |
2705 | sdvo->ddc.algo_data = sdvo; |
2656 | sdvo->ddc.algo = &intel_sdvo_ddc_proxy; |
2706 | sdvo->ddc.algo = &intel_sdvo_ddc_proxy; |
Line 2657... | Line 2707... | ||
2657 | 2707 | ||
2658 | return 1; //i2c_add_adapter(&sdvo->ddc) == 0; |
2708 | return i2c_add_adapter(&sdvo->ddc) == 0; |
Line 2659... | Line 2709... | ||
2659 | } |
2709 | } |
2660 | 2710 | ||
2661 | bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob) |
2711 | bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob) |
Line 2672... | Line 2722... | ||
2672 | 2722 | ||
2673 | intel_sdvo->sdvo_reg = sdvo_reg; |
2723 | intel_sdvo->sdvo_reg = sdvo_reg; |
2674 | intel_sdvo->is_sdvob = is_sdvob; |
2724 | intel_sdvo->is_sdvob = is_sdvob; |
2675 | intel_sdvo->slave_addr = intel_sdvo_get_slave_addr(dev, intel_sdvo) >> 1; |
2725 | intel_sdvo->slave_addr = intel_sdvo_get_slave_addr(dev, intel_sdvo) >> 1; |
2676 | intel_sdvo_select_i2c_bus(dev_priv, intel_sdvo, sdvo_reg); |
2726 | intel_sdvo_select_i2c_bus(dev_priv, intel_sdvo, sdvo_reg); |
2677 | if (!intel_sdvo_init_ddc_proxy(intel_sdvo, dev)) { |
- | |
2678 | kfree(intel_sdvo); |
2727 | if (!intel_sdvo_init_ddc_proxy(intel_sdvo, dev)) |
2679 | return false; |
- | |
Line 2680... | Line 2728... | ||
2680 | } |
2728 | goto err_i2c_bus; |
2681 | 2729 | ||
2682 | /* encoder type will be decided later */ |
2730 | /* encoder type will be decided later */ |
2683 | intel_encoder = &intel_sdvo->base; |
2731 | intel_encoder = &intel_sdvo->base; |
Line 2773... | Line 2821... | ||
2773 | err_output: |
2821 | err_output: |
2774 | intel_sdvo_output_cleanup(intel_sdvo); |
2822 | intel_sdvo_output_cleanup(intel_sdvo); |
Line 2775... | Line 2823... | ||
2775 | 2823 | ||
2776 | err: |
2824 | err: |
2777 | drm_encoder_cleanup(&intel_encoder->base); |
2825 | drm_encoder_cleanup(&intel_encoder->base); |
- | 2826 | i2c_del_adapter(&intel_sdvo->ddc); |
|
- | 2827 | err_i2c_bus: |
|
2778 | // i2c_del_adapter(&intel_sdvo->ddc); |
2828 | intel_sdvo_unselect_i2c_bus(intel_sdvo); |
Line 2779... | Line 2829... | ||
2779 | kfree(intel_sdvo); |
2829 | kfree(intel_sdvo); |
2780 | 2830 |