From owner-svn-src-head@FreeBSD.ORG Tue Jan 6 17:23:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D01011065673; Tue, 6 Jan 2009 17:23:37 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDEC68FC14; Tue, 6 Jan 2009 17:23:37 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n06HNbLV037295; Tue, 6 Jan 2009 17:23:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n06HNbgY037287; Tue, 6 Jan 2009 17:23:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200901061723.n06HNbgY037287@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 6 Jan 2009 17:23:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186833 - head/sys/dev/iicbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jan 2009 17:23:38 -0000 Author: nwhitehorn Date: Tue Jan 6 17:23:37 2009 New Revision: 186833 URL: http://svn.freebsd.org/changeset/base/186833 Log: Change the way I2C bus attachment works to allow firmware-assisted bus subclasses as are available with PCI. Changes I2C device drivers without real probe logic to return BUS_PROBE_NOWILDWARD to avoid interference with firmware bus enumeration, and reduces the probe priority of the iicbus base driver to allow subclass attachment at higher priority. Discussed on: freebsd-arch Modified: head/sys/dev/iicbus/ad7418.c head/sys/dev/iicbus/ds1672.c head/sys/dev/iicbus/icee.c head/sys/dev/iicbus/if_ic.c head/sys/dev/iicbus/iic.c head/sys/dev/iicbus/iicbus.c head/sys/dev/iicbus/iicsmb.c Modified: head/sys/dev/iicbus/ad7418.c ============================================================================== --- head/sys/dev/iicbus/ad7418.c Tue Jan 6 17:05:44 2009 (r186832) +++ head/sys/dev/iicbus/ad7418.c Tue Jan 6 17:23:37 2009 (r186833) @@ -82,7 +82,7 @@ ad7418_probe(device_t dev) { /* XXX really probe? */ device_set_desc(dev, "Analog Devices AD7418 ADC"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/dev/iicbus/ds1672.c ============================================================================== --- head/sys/dev/iicbus/ds1672.c Tue Jan 6 17:05:44 2009 (r186832) +++ head/sys/dev/iicbus/ds1672.c Tue Jan 6 17:23:37 2009 (r186833) @@ -61,7 +61,7 @@ ds1672_probe(device_t dev) { /* XXX really probe? */ device_set_desc(dev, "Dallas Semiconductor DS1672 RTC"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/dev/iicbus/icee.c ============================================================================== --- head/sys/dev/iicbus/icee.c Tue Jan 6 17:05:44 2009 (r186832) +++ head/sys/dev/iicbus/icee.c Tue Jan 6 17:23:37 2009 (r186833) @@ -86,7 +86,7 @@ icee_probe(device_t dev) { /* XXX really probe? -- not until we know the size... */ device_set_desc(dev, "I2C EEPROM"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/dev/iicbus/if_ic.c ============================================================================== --- head/sys/dev/iicbus/if_ic.c Tue Jan 6 17:05:44 2009 (r186832) +++ head/sys/dev/iicbus/if_ic.c Tue Jan 6 17:23:37 2009 (r186833) @@ -153,7 +153,7 @@ ic_alloc_buffers(struct ic_softc *sc, in static int icprobe(device_t dev) { - return (0); + return (BUS_PROBE_NOWILDCARD); } /* Modified: head/sys/dev/iicbus/iic.c ============================================================================== --- head/sys/dev/iicbus/iic.c Tue Jan 6 17:05:44 2009 (r186832) +++ head/sys/dev/iicbus/iic.c Tue Jan 6 17:23:37 2009 (r186833) @@ -110,14 +110,14 @@ iic_identify(driver_t *driver, device_t { if (device_find_child(parent, "iic", -1) == NULL) - BUS_ADD_CHILD(parent, 0, "iic", -1); + BUS_ADD_CHILD(parent, 0, "iic", 0); } static int iic_probe(device_t dev) { device_set_desc(dev, "I2C generic I/O"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/dev/iicbus/iicbus.c ============================================================================== --- head/sys/dev/iicbus/iicbus.c Tue Jan 6 17:05:44 2009 (r186832) +++ head/sys/dev/iicbus/iicbus.c Tue Jan 6 17:23:37 2009 (r186833) @@ -53,7 +53,9 @@ iicbus_probe(device_t dev) { device_set_desc(dev, "Philips I2C bus"); - return (0); + + /* Allow other subclasses to override this driver. */ + return (-1000); } #if SCAN_IICBUS Modified: head/sys/dev/iicbus/iicsmb.c ============================================================================== --- head/sys/dev/iicbus/iicsmb.c Tue Jan 6 17:05:44 2009 (r186832) +++ head/sys/dev/iicbus/iicsmb.c Tue Jan 6 17:23:37 2009 (r186833) @@ -149,7 +149,7 @@ static int iicsmb_probe(device_t dev) { device_set_desc(dev, "SMBus over I2C bridge"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int