Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262539AbVA0KAT (ORCPT ); Thu, 27 Jan 2005 05:00:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262543AbVA0KAT (ORCPT ); Thu, 27 Jan 2005 05:00:19 -0500 Received: from rproxy.gmail.com ([64.233.170.196]:45260 "EHLO rproxy.gmail.com") by vger.kernel.org with ESMTP id S262539AbVA0J7q (ORCPT ); Thu, 27 Jan 2005 04:59:46 -0500 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=i4nW1feNaCH29kh15Rev8ZjDqhh1NaVBjDN41P3zxxTjJtECRBatfLmF8zrW+p1UftqRLSXZSsVx7BuK+OdxmFWDYN1xY/JaMflzU8Zqd1ctjNlj8VlFOIPwSDwmCw+qa1fY4aTf7FeuQRY+22Nf3ISfmpwUe3BrjcKwn1fNgQ0= Message-ID: <9e473391050127015970e1fedc@mail.gmail.com> Date: Thu, 27 Jan 2005 04:59:45 -0500 From: Jon Smirl Reply-To: Jon Smirl To: Greg KH Subject: Re: Fwd: Patch to control VGA bus routing and active VGA device. Cc: Russell King , Jeff Garzik , Matthew Wilcox , Jesse Barnes , linux-pci@atrey.karlin.mff.cuni.cz, lkml In-Reply-To: <20050125042459.GA32697@kroah.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_588_14386459.1106819985598" References: <9e47339105011719436a9e5038@mail.gmail.com> <41ED3BD2.1090105@pobox.com> <9e473391050122083822a7f81c@mail.gmail.com> <200501240847.51208.jbarnes@sgi.com> <20050124175131.GM31455@parcelfarce.linux.theplanet.co.uk> <9e473391050124111767a9c6b7@mail.gmail.com> <41F54FC1.6080207@pobox.com> <20050124195523.B5541@flint.arm.linux.org.uk> <20050125042459.GA32697@kroah.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 16685 Lines: 238 ------=_Part_588_14386459.1106819985598 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Mon, 24 Jan 2005 20:24:59 -0800, Greg KH wrote: > This can be done today in the bus specific match functions. And because > of that, I would argue that this belongs in the bus specific code, and > not in the driver core, as it's up to the bus to know what the different > types of "matches" that can happen, and what the priority is. Here's a version of the VGA control code that actually works. It helps if I pci_enable() the device before using it. There was nothing wrong with the routing code. I can also control multiple cards on the same bus by turning on/off their response to IO space and then enabling VGA via the standard ports. I can use this to move my console from card to card. I have this code in drivers/pci because it needs to know add/remove from hotplug. Is there a better way to structure it? Note that this is not a VGA device, it is just a mechanism for controlling which VGA device is active. Another item I need to add is generating an initial hotplug event for each secondary card. This event has to happen even if there is a card specific driver loaded. The event will be used to run the reset program needed by secondary cards. -- Jon Smirl jonsmirl@gmail.com ------=_Part_588_14386459.1106819985598 Content-Type: application/octet-stream; name="patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="patch" ZGlmZiAtTnJ1IGEvYXJjaC9pMzg2L3BjaS9maXh1cC5jIGIvYXJjaC9pMzg2L3BjaS9maXh1cC5j Ci0tLSBhL2FyY2gvaTM4Ni9wY2kvZml4dXAuYwkyMDA1LTAxLTI3IDA0OjAxOjA4IC0wNTowMAor KysgYi9hcmNoL2kzODYvcGNpL2ZpeHVwLmMJMjAwNS0wMS0yNyAwNDowMTowOCAtMDU6MDAKQEAg LTM3NSw2ICszNzUsNiBAQAogCQl9CiAJCWJ1cyA9IGJ1cy0+cGFyZW50OwogCX0KLQlwZGV2LT5y ZXNvdXJjZVtQQ0lfUk9NX1JFU09VUkNFXS5mbGFncyB8PSBJT1JFU09VUkNFX1JPTV9TSEFET1c7 CisJcGRldi0+cmVzb3VyY2VbUENJX1JPTV9SRVNPVVJDRV0uZmxhZ3MgfD0gSU9SRVNPVVJDRV9S T01fU0hBRE9XIHwgSU9SRVNPVVJDRV9WR0FfQUNUSVZFOwogfQogREVDT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BWR0EgZGV2aWNlIGlzIGFjdGl2ZSAq LwogCiAvKiBQQy9JU0Evd2hhdGV2ZXIgLSB0aGUgbm9ybWFsIFBDIGFkZHJlc3Mgc3BhY2VzOiBJ TyBhbmQgbWVtb3J5ICovCiBleHRlcm4gc3RydWN0IHJlc291cmNlIGlvcG9ydF9yZXNvdXJjZTsK ------=_Part_588_14386459.1106819985598-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/