diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-12 21:09:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-12 21:09:18 -0400 |
commit | 6b702462cbe5b6f372966a53f4465d745d86b65c (patch) | |
tree | 19a8d090b284bb804e8a2ffa38fa51b58118db6a /drivers/gpu/drm/drm_edid.c | |
parent | 947ec0b0c1e7e80eef4fe64f7763a06d0cf04d2e (diff) | |
parent | 3c24475c1e4e8d10e50df161d8c4f1d382997a7c (diff) |
Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (50 commits)
drm: include kernel list header file in hashtab header
drm: Export hash table functionality.
drm: Split out the mm declarations in a separate header. Add atomic operations.
drm/radeon: add support for RV790.
drm/radeon: add rv740 drm support.
drm_calloc_large: check right size, check integer overflow, use GFP_ZERO
drm: Eliminate magic I2C frobbing when reading EDID
drm/i915: duplicate desired mode for use by fbcon.
drm/via: vfree() no need checking before calling it
drm: Replace DRM_DEBUG with DRM_DEBUG_DRIVER in i915 driver
drm: Replace DRM_DEBUG with DRM_DEBUG_MODE in drm_mode
drm/i915: Replace DRM_DEBUG with DRM_DEBUG_KMS in intel_sdvo
drm/i915: replace DRM_DEBUG with DRM_DEBUG_KMS in intel_lvds
drm: add separate drm debugging levels
radeon: remove _DRM_DRIVER from the preadded sarea map
drm: don't associate _DRM_DRIVER maps with a master
drm: simplify kcalloc() call to kzalloc().
intelfb: fix spelling of "CLOCK"
drm: fix LOCK_TEST_WITH_RETURN macro
drm/i915: Hook connector to encoder during load detection (fixes tv/vga detect)
...
Diffstat (limited to 'drivers/gpu/drm/drm_edid.c')
-rw-r--r-- | drivers/gpu/drm/drm_edid.c | 74 |
1 files changed, 1 insertions, 73 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 6f6b26479d82..801a0d0e0810 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c | |||
@@ -589,85 +589,13 @@ int drm_do_probe_ddc_edid(struct i2c_adapter *adapter, | |||
589 | } | 589 | } |
590 | EXPORT_SYMBOL(drm_do_probe_ddc_edid); | 590 | EXPORT_SYMBOL(drm_do_probe_ddc_edid); |
591 | 591 | ||
592 | /** | ||
593 | * Get EDID information. | ||
594 | * | ||
595 | * \param adapter : i2c device adaptor. | ||
596 | * \param buf : EDID data buffer to be filled | ||
597 | * \param len : EDID data buffer length | ||
598 | * \return 0 on success or -1 on failure. | ||
599 | * | ||
600 | * Initialize DDC, then fetch EDID information | ||
601 | * by calling drm_do_probe_ddc_edid function. | ||
602 | */ | ||
603 | static int drm_ddc_read(struct i2c_adapter *adapter, | ||
604 | unsigned char *buf, int len) | ||
605 | { | ||
606 | struct i2c_algo_bit_data *algo_data = adapter->algo_data; | ||
607 | int i, j; | ||
608 | int ret = -1; | ||
609 | |||
610 | algo_data->setscl(algo_data->data, 1); | ||
611 | |||
612 | for (i = 0; i < 1; i++) { | ||
613 | /* For some old monitors we need the | ||
614 | * following process to initialize/stop DDC | ||
615 | */ | ||
616 | algo_data->setsda(algo_data->data, 1); | ||
617 | msleep(13); | ||
618 | |||
619 | algo_data->setscl(algo_data->data, 1); | ||
620 | for (j = 0; j < 5; j++) { | ||
621 | msleep(10); | ||
622 | if (algo_data->getscl(algo_data->data)) | ||
623 | break; | ||
624 | } | ||
625 | if (j == 5) | ||
626 | continue; | ||
627 | |||
628 | algo_data->setsda(algo_data->data, 0); | ||
629 | msleep(15); | ||
630 | algo_data->setscl(algo_data->data, 0); | ||
631 | msleep(15); | ||
632 | algo_data->setsda(algo_data->data, 1); | ||
633 | msleep(15); | ||
634 | |||
635 | /* Do the real work */ | ||
636 | ret = drm_do_probe_ddc_edid(adapter, buf, len); | ||
637 | algo_data->setsda(algo_data->data, 0); | ||
638 | algo_data->setscl(algo_data->data, 0); | ||
639 | msleep(15); | ||
640 | |||
641 | algo_data->setscl(algo_data->data, 1); | ||
642 | for (j = 0; j < 10; j++) { | ||
643 | msleep(10); | ||
644 | if (algo_data->getscl(algo_data->data)) | ||
645 | break; | ||
646 | } | ||
647 | |||
648 | algo_data->setsda(algo_data->data, 1); | ||
649 | msleep(15); | ||
650 | algo_data->setscl(algo_data->data, 0); | ||
651 | algo_data->setsda(algo_data->data, 0); | ||
652 | if (ret == 0) | ||
653 | break; | ||
654 | } | ||
655 | /* Release the DDC lines when done or the Apple Cinema HD display | ||
656 | * will switch off | ||
657 | */ | ||
658 | algo_data->setsda(algo_data->data, 1); | ||
659 | algo_data->setscl(algo_data->data, 1); | ||
660 | |||
661 | return ret; | ||
662 | } | ||
663 | |||
664 | static int drm_ddc_read_edid(struct drm_connector *connector, | 592 | static int drm_ddc_read_edid(struct drm_connector *connector, |
665 | struct i2c_adapter *adapter, | 593 | struct i2c_adapter *adapter, |
666 | char *buf, int len) | 594 | char *buf, int len) |
667 | { | 595 | { |
668 | int ret; | 596 | int ret; |
669 | 597 | ||
670 | ret = drm_ddc_read(adapter, buf, len); | 598 | ret = drm_do_probe_ddc_edid(adapter, buf, len); |
671 | if (ret != 0) { | 599 | if (ret != 0) { |
672 | dev_info(&connector->dev->pdev->dev, "%s: no EDID data\n", | 600 | dev_info(&connector->dev->pdev->dev, "%s: no EDID data\n", |
673 | drm_get_connector_name(connector)); | 601 | drm_get_connector_name(connector)); |