From patchwork Mon Feb 8 19:43:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 77800 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o18Jixxj010248 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 8 Feb 2010 19:45:35 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NeZW7-0002m6-O3; Mon, 08 Feb 2010 19:43:31 +0000 Received: from sfi-mx-2.v28.ch3.sourceforge.com ([172.29.28.122] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NeZW6-0002lr-6u for dri-devel@lists.sourceforge.net; Mon, 08 Feb 2010 19:43:30 +0000 Received-SPF: pass (sfi-mx-2.v28.ch3.sourceforge.com: domain of gmail.com designates 209.85.220.216 as permitted sender) client-ip=209.85.220.216; envelope-from=alexdeucher@gmail.com; helo=mail-fx0-f216.google.com; Received: from mail-fx0-f216.google.com ([209.85.220.216]) by sfi-mx-2.v28.ch3.sourceforge.com with esmtp (Exim 4.69) id 1NeZW4-0000eZ-In for dri-devel@lists.sourceforge.net; Mon, 08 Feb 2010 19:43:29 +0000 Received: by fxm8 with SMTP id 8so5783574fxm.6 for ; Mon, 08 Feb 2010 11:43:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.144.74 with SMTP id y10mr8562323fau.18.1265658201858; Mon, 08 Feb 2010 11:43:21 -0800 (PST) Date: Mon, 8 Feb 2010 14:43:21 -0500 Message-ID: Subject: [PATCH] drm/radeon/kms: more hw i2c fixes From: Alex Deucher To: Dave Airlie , DRI Development Mailing List X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -0.0 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.0 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.0 AWL AWL: From: address is in the auto white-list X-Headers-End: 1NeZW4-0000eZ-In X-BeenThere: dri-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 08 Feb 2010 19:45:36 +0000 (UTC) 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) {