From patchwork Sun Apr 3 12:54:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tormod Volden X-Patchwork-Id: 684131 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p33CsBBx015084 for ; Sun, 3 Apr 2011 12:54:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752327Ab1DCMyL (ORCPT ); Sun, 3 Apr 2011 08:54:11 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:51918 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752359Ab1DCMyK (ORCPT ); Sun, 3 Apr 2011 08:54:10 -0400 Received: by wwa36 with SMTP id 36so5558016wwa.1 for ; Sun, 03 Apr 2011 05:54:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=Ivt+P7z4LAUkm30fDMY8hGS23zAiU3oY//c9TXViXdM=; b=IVoQ1UerkAmCsMUjYh+MzzToKyXuob43Wpa5ogPzwe5ETsBU90l52nSlQ84ciZYwO5 kG4yNtfV91W1jTmM/67myrp9JA9G+xThRzU1TXsAW4DHkMaFKMOtJqMR5gG742ZZTZZH W+ZlbbKSIYWnx0d9nHyL+ROriRfotBKuEVP/A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=A45hXmxYZAbkjb0urcWX+MkAHPa/ac2eXLpKnM9Xm0iq7XgddRlrN+ToPWfVJGikxr 4fgn3lFvzBFIEQ594hUSK17xWGC4Q1MM/eFYKfH9iEybf6KQVy6eRYLlhLpR3CVt46Hx NyWQECffAFcM60EElMkV77KnqpzmCWGyzKMhM= Received: by 10.216.141.225 with SMTP id g75mr5879524wej.10.1301835249830; Sun, 03 Apr 2011 05:54:09 -0700 (PDT) Received: from localhost.localdomain (80-219-113-251.dclient.hispeed.ch [80.219.113.251]) by mx.google.com with ESMTPS id t11sm1804878wes.17.2011.04.03.05.54.09 (version=SSLv3 cipher=OTHER); Sun, 03 Apr 2011 05:54:09 -0700 (PDT) From: Tormod Volden To: linux-fbdev@vger.kernel.org Cc: Antonino Daplas Subject: [PATCH 2/2] savagefb: Set up I2C based on chip family instead of card id Date: Sun, 3 Apr 2011 14:54:05 +0200 Message-Id: <1301835246-6520-2-git-send-email-lists.tormod@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1301835246-6520-1-git-send-email-lists.tormod@gmail.com> References: <1301835246-6520-1-git-send-email-lists.tormod@gmail.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 03 Apr 2011 12:54:12 +0000 (UTC) From: Tormod Volden In practice this means enabling I2C (for DDC2) on all prosavage cards, like the xorg ddx does. The savage4 and savage2000 families have only one member each, so there is no change for those. Tested on TwisterK. Signed-off-by: Tormod Volden --- Since this seems to work fine in xorg, I do not expect any surprises. However, the framebuffer might now come up in higher resolution and refresh rate (as allowed by the EDID) than the old defaults. This might uncover broken EDIDs or other mode bugs. WRT my own testing, I can see that the EDID is read out successfully, but the external monitor goes black and complains with the chosen mode. (For the record, the same happened with the non-edid default mode.) This is because of other bugs in the mode calculations or the monitor itself I am testing on. With xorg the monitor comes up, because xorg picks a lower refresh rate by default. Tormod drivers/video/savage/savagefb-i2c.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/video/savage/savagefb-i2c.c b/drivers/video/savage/savagefb-i2c.c index 58c8a3c..5e7acda 100644 --- a/drivers/video/savage/savagefb-i2c.c +++ b/drivers/video/savage/savagefb-i2c.c @@ -170,9 +170,8 @@ void savagefb_create_i2c_busses(struct fb_info *info) struct savagefb_par *par = info->par; par->chan.par = par; - switch(info->fix.accel) { - case FB_ACCEL_PROSAVAGE_DDRK: - case FB_ACCEL_PROSAVAGE_PM: + switch (par->chip) { + case S3_PROSAVAGE: par->chan.reg = CR_SERIAL2; par->chan.ioaddr = par->mmio.vbase; par->chan.algo.setsda = prosavage_gpio_setsda; @@ -180,7 +179,7 @@ void savagefb_create_i2c_busses(struct fb_info *info) par->chan.algo.getsda = prosavage_gpio_getsda; par->chan.algo.getscl = prosavage_gpio_getscl; break; - case FB_ACCEL_SAVAGE4: + case S3_SAVAGE4: par->chan.reg = CR_SERIAL1; if (par->pcidev->revision > 1 && !(VGArCR(0xa6, par) & 0x40)) par->chan.reg = CR_SERIAL2; @@ -190,7 +189,7 @@ void savagefb_create_i2c_busses(struct fb_info *info) par->chan.algo.getsda = prosavage_gpio_getsda; par->chan.algo.getscl = prosavage_gpio_getscl; break; - case FB_ACCEL_SAVAGE2000: + case S3_SAVAGE2000: par->chan.reg = MM_SERIAL1; par->chan.ioaddr = par->mmio.vbase; par->chan.algo.setsda = savage4_gpio_setsda;