aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-11-05 18:27:30 -0500
committerDave Airlie <airlied@redhat.com>2009-12-01 20:36:38 -0500
commitab1e9ea08f1e94639b2d21a6bde5b55d31b1deee (patch)
treeaf87068cb71ef356e6b3065c017c635f6c1e8d77 /drivers/gpu
parent2127816366e0ffbc1426fa69e7b9b2bebd2e2288 (diff)
drm/radeon/kms: dont't pass a radeon_connector to radeon_i2c_do_lock()
We need this for supporting things other than ddc on i2c. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/radeon_connectors.c20
-rw-r--r--drivers/gpu/drm/radeon/radeon_display.c8
-rw-r--r--drivers/gpu/drm/radeon/radeon_i2c.c10
-rw-r--r--drivers/gpu/drm/radeon/radeon_mode.h2
4 files changed, 20 insertions, 20 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index 29763ceae3af..93f6a970b51d 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -445,10 +445,10 @@ static enum drm_connector_status radeon_lvds_detect(struct drm_connector *connec
445 ret = connector_status_connected; 445 ret = connector_status_connected;
446 else { 446 else {
447 if (radeon_connector->ddc_bus) { 447 if (radeon_connector->ddc_bus) {
448 radeon_i2c_do_lock(radeon_connector, 1); 448 radeon_i2c_do_lock(radeon_connector->ddc_bus, 1);
449 radeon_connector->edid = drm_get_edid(&radeon_connector->base, 449 radeon_connector->edid = drm_get_edid(&radeon_connector->base,
450 &radeon_connector->ddc_bus->adapter); 450 &radeon_connector->ddc_bus->adapter);
451 radeon_i2c_do_lock(radeon_connector, 0); 451 radeon_i2c_do_lock(radeon_connector->ddc_bus, 0);
452 if (radeon_connector->edid) 452 if (radeon_connector->edid)
453 ret = connector_status_connected; 453 ret = connector_status_connected;
454 } 454 }
@@ -553,17 +553,17 @@ static enum drm_connector_status radeon_vga_detect(struct drm_connector *connect
553 if (!encoder) 553 if (!encoder)
554 ret = connector_status_disconnected; 554 ret = connector_status_disconnected;
555 555
556 radeon_i2c_do_lock(radeon_connector, 1); 556 radeon_i2c_do_lock(radeon_connector->ddc_bus, 1);
557 dret = radeon_ddc_probe(radeon_connector); 557 dret = radeon_ddc_probe(radeon_connector);
558 radeon_i2c_do_lock(radeon_connector, 0); 558 radeon_i2c_do_lock(radeon_connector->ddc_bus, 0);
559 if (dret) { 559 if (dret) {
560 if (radeon_connector->edid) { 560 if (radeon_connector->edid) {
561 kfree(radeon_connector->edid); 561 kfree(radeon_connector->edid);
562 radeon_connector->edid = NULL; 562 radeon_connector->edid = NULL;
563 } 563 }
564 radeon_i2c_do_lock(radeon_connector, 1); 564 radeon_i2c_do_lock(radeon_connector->ddc_bus, 1);
565 radeon_connector->edid = drm_get_edid(&radeon_connector->base, &radeon_connector->ddc_bus->adapter); 565 radeon_connector->edid = drm_get_edid(&radeon_connector->base, &radeon_connector->ddc_bus->adapter);
566 radeon_i2c_do_lock(radeon_connector, 0); 566 radeon_i2c_do_lock(radeon_connector->ddc_bus, 0);
567 567
568 if (!radeon_connector->edid) { 568 if (!radeon_connector->edid) {
569 DRM_ERROR("%s: probed a monitor but no|invalid EDID\n", 569 DRM_ERROR("%s: probed a monitor but no|invalid EDID\n",
@@ -708,17 +708,17 @@ static enum drm_connector_status radeon_dvi_detect(struct drm_connector *connect
708 enum drm_connector_status ret = connector_status_disconnected; 708 enum drm_connector_status ret = connector_status_disconnected;
709 bool dret; 709 bool dret;
710 710
711 radeon_i2c_do_lock(radeon_connector, 1); 711 radeon_i2c_do_lock(radeon_connector->ddc_bus, 1);
712 dret = radeon_ddc_probe(radeon_connector); 712 dret = radeon_ddc_probe(radeon_connector);
713 radeon_i2c_do_lock(radeon_connector, 0); 713 radeon_i2c_do_lock(radeon_connector->ddc_bus, 0);
714 if (dret) { 714 if (dret) {
715 if (radeon_connector->edid) { 715 if (radeon_connector->edid) {
716 kfree(radeon_connector->edid); 716 kfree(radeon_connector->edid);
717 radeon_connector->edid = NULL; 717 radeon_connector->edid = NULL;
718 } 718 }
719 radeon_i2c_do_lock(radeon_connector, 1); 719 radeon_i2c_do_lock(radeon_connector->ddc_bus, 1);
720 radeon_connector->edid = drm_get_edid(&radeon_connector->base, &radeon_connector->ddc_bus->adapter); 720 radeon_connector->edid = drm_get_edid(&radeon_connector->base, &radeon_connector->ddc_bus->adapter);
721 radeon_i2c_do_lock(radeon_connector, 0); 721 radeon_i2c_do_lock(radeon_connector->ddc_bus, 0);
722 722
723 if (!radeon_connector->edid) { 723 if (!radeon_connector->edid) {
724 DRM_ERROR("%s: probed a monitor but no|invalid EDID\n", 724 DRM_ERROR("%s: probed a monitor but no|invalid EDID\n",
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index c85df4afcb7a..a3def191e98f 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -339,9 +339,9 @@ int radeon_ddc_get_modes(struct radeon_connector *radeon_connector)
339 if (!radeon_connector->ddc_bus) 339 if (!radeon_connector->ddc_bus)
340 return -1; 340 return -1;
341 if (!radeon_connector->edid) { 341 if (!radeon_connector->edid) {
342 radeon_i2c_do_lock(radeon_connector, 1); 342 radeon_i2c_do_lock(radeon_connector->ddc_bus, 1);
343 radeon_connector->edid = drm_get_edid(&radeon_connector->base, &radeon_connector->ddc_bus->adapter); 343 radeon_connector->edid = drm_get_edid(&radeon_connector->base, &radeon_connector->ddc_bus->adapter);
344 radeon_i2c_do_lock(radeon_connector, 0); 344 radeon_i2c_do_lock(radeon_connector->ddc_bus, 0);
345 } 345 }
346 346
347 if (radeon_connector->edid) { 347 if (radeon_connector->edid) {
@@ -361,9 +361,9 @@ static int radeon_ddc_dump(struct drm_connector *connector)
361 361
362 if (!radeon_connector->ddc_bus) 362 if (!radeon_connector->ddc_bus)
363 return -1; 363 return -1;
364 radeon_i2c_do_lock(radeon_connector, 1); 364 radeon_i2c_do_lock(radeon_connector->ddc_bus, 1);
365 edid = drm_get_edid(connector, &radeon_connector->ddc_bus->adapter); 365 edid = drm_get_edid(connector, &radeon_connector->ddc_bus->adapter);
366 radeon_i2c_do_lock(radeon_connector, 0); 366 radeon_i2c_do_lock(radeon_connector->ddc_bus, 0);
367 if (edid) { 367 if (edid) {
368 kfree(edid); 368 kfree(edid);
369 } 369 }
diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c b/drivers/gpu/drm/radeon/radeon_i2c.c
index dd438d32e5c0..d8296acb082f 100644
--- a/drivers/gpu/drm/radeon/radeon_i2c.c
+++ b/drivers/gpu/drm/radeon/radeon_i2c.c
@@ -59,11 +59,11 @@ bool radeon_ddc_probe(struct radeon_connector *radeon_connector)
59} 59}
60 60
61 61
62void radeon_i2c_do_lock(struct radeon_connector *radeon_connector, int lock_state) 62void radeon_i2c_do_lock(struct radeon_i2c_chan *i2c, int lock_state)
63{ 63{
64 struct radeon_device *rdev = radeon_connector->base.dev->dev_private; 64 struct radeon_device *rdev = i2c->dev->dev_private;
65 struct radeon_i2c_bus_rec *rec = &i2c->rec;
65 uint32_t temp; 66 uint32_t temp;
66 struct radeon_i2c_bus_rec *rec = &radeon_connector->ddc_bus->rec;
67 67
68 /* RV410 appears to have a bug where the hw i2c in reset 68 /* RV410 appears to have a bug where the hw i2c in reset
69 * holds the i2c port in a bad state - switch hw i2c away before 69 * holds the i2c port in a bad state - switch hw i2c away before
@@ -156,8 +156,8 @@ static void set_data(void *i2c_priv, int data)
156} 156}
157 157
158struct radeon_i2c_chan *radeon_i2c_create(struct drm_device *dev, 158struct radeon_i2c_chan *radeon_i2c_create(struct drm_device *dev,
159 struct radeon_i2c_bus_rec *rec, 159 struct radeon_i2c_bus_rec *rec,
160 const char *name) 160 const char *name)
161{ 161{
162 struct radeon_i2c_chan *i2c; 162 struct radeon_i2c_chan *i2c;
163 int ret; 163 int ret;
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h
index ace726aa0d76..491a1ec81a4c 100644
--- a/drivers/gpu/drm/radeon/radeon_mode.h
+++ b/drivers/gpu/drm/radeon/radeon_mode.h
@@ -426,7 +426,7 @@ void radeon_atombios_init_crtc(struct drm_device *dev,
426 struct radeon_crtc *radeon_crtc); 426 struct radeon_crtc *radeon_crtc);
427void radeon_legacy_init_crtc(struct drm_device *dev, 427void radeon_legacy_init_crtc(struct drm_device *dev,
428 struct radeon_crtc *radeon_crtc); 428 struct radeon_crtc *radeon_crtc);
429void radeon_i2c_do_lock(struct radeon_connector *radeon_connector, int lock_state); 429extern void radeon_i2c_do_lock(struct radeon_i2c_chan *i2c, int lock_state);
430 430
431void radeon_get_clock_info(struct drm_device *dev); 431void radeon_get_clock_info(struct drm_device *dev);
432 432