Date: Tue, 6 Jan 2009 17:23:37 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r186833 - head/sys/dev/iicbus Message-ID: <200901061723.n06HNbgY037287@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901061723.n06HNbgY037287>