All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: Dave Airlie <airlied@gmail.com>,
	DRI Development Mailing List <dri-devel@lists.sourceforge.net>
Subject: [PATCH] drm/radeon/kms: more hw i2c fixes
Date: Mon, 8 Feb 2010 14:43:21 -0500	[thread overview]
Message-ID: <a728f9f91002081143k55f4d4c7kaa9626618523a20f@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2489 bytes --]

>From c33d72912856c0c8fc7586170d10a906d7f854be Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexdeucher@gmail.com>
Date: Mon, 8 Feb 2010 14:40:24 -0500
Subject: [PATCH] drm/radeon/kms: more hw i2c fixes

- rs300 doesn't have a pin select bit
- r200 has a different pin select setup

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
---
 drivers/gpu/drm/radeon/radeon_combios.c |   12 +++++++++++-
 drivers/gpu/drm/radeon/radeon_i2c.c     |   16 +++++++++++++++-
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_combios.c
b/drivers/gpu/drm/radeon/radeon_combios.c
index 1d398af..31e4a61 100644
--- a/drivers/gpu/drm/radeon/radeon_combios.c
+++ b/drivers/gpu/drm/radeon/radeon_combios.c
@@ -513,6 +513,7 @@ static struct radeon_i2c_bus_rec
combios_setup_i2c_bus(struct radeon_device *rde
 	case CHIP_RS100:
 	case CHIP_RV200:
 	case CHIP_RS200:
+	case CHIP_RS300:
 		switch (ddc_line) {
 		case RADEON_GPIO_DVI_DDC:
 			/* in theory this should be hw capable,
@@ -526,8 +527,17 @@ static struct radeon_i2c_bus_rec
combios_setup_i2c_bus(struct radeon_device *rde
 		}
 		break;
 	case CHIP_R200:
+		switch (ddc_line) {
+		case RADEON_GPIO_DVI_DDC:
+		case RADEON_GPIO_MONID:
+			i2c.hw_capable = true;
+			break;
+		default:
+			i2c.hw_capable = false;
+			break;
+		}
+		break;
 	case CHIP_RV250:
-	case CHIP_RS300:
 	case CHIP_RV280:
 		switch (ddc_line) {
 		case RADEON_GPIO_VGA_DDC:
diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c
b/drivers/gpu/drm/radeon/radeon_i2c.c
index b715632..272c45d 100644
--- a/drivers/gpu/drm/radeon/radeon_i2c.c
+++ b/drivers/gpu/drm/radeon/radeon_i2c.c
@@ -228,6 +228,7 @@ static int r100_hw_i2c_xfer(struct i2c_adapter *i2c_adap,
 		case CHIP_RS100:
 		case CHIP_RV200:
 		case CHIP_RS200:
+		case CHIP_RS300:
 			switch (rec->mask_clk_reg) {
 			case RADEON_GPIO_DVI_DDC:
 				/* no gpio select bit */
@@ -239,8 +240,21 @@ static int r100_hw_i2c_xfer(struct i2c_adapter *i2c_adap,
 			}
 			break;
 		case CHIP_R200:
+			/* only bit 4 on r200 */
+			switch (rec->mask_clk_reg) {
+			case RADEON_GPIO_DVI_DDC:
+				reg |= R200_DVI_I2C_PIN_SEL(R200_SEL_DDC1);
+				break;
+			case RADEON_GPIO_MONID:
+				reg |= R200_DVI_I2C_PIN_SEL(R200_SEL_DDC3);
+				break;
+			default:
+				DRM_ERROR("gpio not supported with hw i2c\n");
+				ret = -EINVAL;
+				goto done;
+			}
+			break;
 		case CHIP_RV250:
-		case CHIP_RS300:
 		case CHIP_RV280:
 			/* bits 3 and 4 */
 			switch (rec->mask_clk_reg) {
-- 
1.5.6.3

[-- Attachment #2: 0001-drm-radeon-kms-more-hw-i2c-fixes.patch --]
[-- Type: application/mbox, Size: 2489 bytes --]

[-- Attachment #3: Type: text/plain, Size: 408 bytes --]

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com

[-- Attachment #4: Type: text/plain, Size: 161 bytes --]

--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

                 reply	other threads:[~2010-02-08 19:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a728f9f91002081143k55f4d4c7kaa9626618523a20f@mail.gmail.com \
    --to=alexdeucher@gmail.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.