From owner-freebsd-arch@FreeBSD.ORG Sun Nov 23 17:39:16 2008 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D642C106564A for ; Sun, 23 Nov 2008 17:39:16 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id AECD08FC0A for ; Sun, 23 Nov 2008 17:39:16 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=ISO-8859-1; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 6.3-6.03 (built Mar 14 2008; 32bit)) id <0KAS00J02OXFPM00@smtpauth2.wiscmail.wisc.edu> for freebsd-arch@freebsd.org; Sun, 23 Nov 2008 10:39:15 -0600 (CST) Received: from trantor.tachypleus.net (adsl-99-154-3-101.dsl.mdsnwi.sbcglobal.net [99.154.3.101]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 6.3-6.03 (built Mar 14 2008; 32bit)) with ESMTPSA id <0KAS00IJLOXEFW00@smtpauth2.wiscmail.wisc.edu> for freebsd-arch@freebsd.org; Sun, 23 Nov 2008 10:39:15 -0600 (CST) Date: Sun, 23 Nov 2008 10:40:27 -0600 From: Nathan Whitehorn To: freebsd-arch@freebsd.org Message-id: <4929877B.6060307@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=99.154.3.101 X-Spam-PmxInfo: Server=avs-13, Version=5.4.2.344556, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2008.11.23.162221, SenderIP=99.154.3.101 User-Agent: Thunderbird 2.0.0.17 (X11/20080928) Subject: Enumerable I2C busses X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Nov 2008 17:39:16 -0000 On Apple's PowerPC systems, the firmware device tree helpfully enumerates the system's I2C busses. Marco Trillo has recently written a driver for one of the system's I2C controllers in order to support the attached audio codecs, and I'm trying to figure out the best way to import it. The current I2C bus mechanism does not support the bus adding its own children and instead relies on hints or other out-of-band information for device attachment. It would be nice to do something like what the firmware-assisted PCI bus drivers do (ofw_pci, for instance): hijack child enumeration from the MI layer and attach information from the firmware. However, since all current I2C drivers' probe() routines return 0, I can't simply add the firmware devices, because as soon as the probe() methods of the existing drivers are called, they will take over all the devices on the bus. What is the best way to handle this? -Nathan