From owner-svn-src-all@freebsd.org Tue Jun 20 18:25:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1D7BD9EC2D; Tue, 20 Jun 2017 18:25:28 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A084D6A8CA; Tue, 20 Jun 2017 18:25:28 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5KIPRRx071488; Tue, 20 Jun 2017 18:25:27 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5KIPRng071486; Tue, 20 Jun 2017 18:25:27 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201706201825.v5KIPRng071486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 20 Jun 2017 18:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320159 - in head/sys/dev/iicbus: . twsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jun 2017 18:25:28 -0000 Author: loos Date: Tue Jun 20 18:25:27 2017 New Revision: 320159 URL: https://svnweb.freebsd.org/changeset/base/320159 Log: Make ofw_iicbus attach to twsi I2C controllers. Add the ofw_bus_get_node() callback in mv_twsi, it is mandatory for the ofw_iicbus usage. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/iicbus/ofw_iicbus.c head/sys/dev/iicbus/twsi/mv_twsi.c Modified: head/sys/dev/iicbus/ofw_iicbus.c ============================================================================== --- head/sys/dev/iicbus/ofw_iicbus.c Tue Jun 20 18:14:56 2017 (r320158) +++ head/sys/dev/iicbus/ofw_iicbus.c Tue Jun 20 18:25:27 2017 (r320159) @@ -84,6 +84,8 @@ EARLY_DRIVER_MODULE(ofw_iicbus, iicbb, ofw_iicbus_driv 0, 0, BUS_PASS_BUS); EARLY_DRIVER_MODULE(ofw_iicbus, iichb, ofw_iicbus_driver, ofwiicbus_devclass, 0, 0, BUS_PASS_BUS); +EARLY_DRIVER_MODULE(ofw_iicbus, twsi, ofw_iicbus_driver, ofwiicbus_devclass, + 0, 0, BUS_PASS_BUS); MODULE_VERSION(ofw_iicbus, 1); MODULE_DEPEND(ofw_iicbus, iicbus, 1, 1, 1); Modified: head/sys/dev/iicbus/twsi/mv_twsi.c ============================================================================== --- head/sys/dev/iicbus/twsi/mv_twsi.c Tue Jun 20 18:14:56 2017 (r320158) +++ head/sys/dev/iicbus/twsi/mv_twsi.c Tue Jun 20 18:25:27 2017 (r320159) @@ -91,6 +91,7 @@ __FBSDID("$FreeBSD$"); #define debugf(fmt, args...) #endif +static phandle_t mv_twsi_get_node(device_t, device_t); static int mv_twsi_probe(device_t); static int mv_twsi_attach(device_t); @@ -105,7 +106,10 @@ static device_method_t mv_twsi_methods[] = { DEVMETHOD(device_probe, mv_twsi_probe), DEVMETHOD(device_attach, mv_twsi_attach), - { 0, 0 } + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, mv_twsi_get_node), + + DEVMETHOD_END }; DEFINE_CLASS_1(twsi, mv_twsi_driver, mv_twsi_methods, @@ -116,6 +120,14 @@ static devclass_t mv_twsi_devclass; DRIVER_MODULE(twsi, simplebus, mv_twsi_driver, mv_twsi_devclass, 0, 0); DRIVER_MODULE(iicbus, twsi, iicbus_driver, iicbus_devclass, 0, 0); MODULE_DEPEND(twsi, iicbus, 1, 1, 1); + +static phandle_t +mv_twsi_get_node(device_t bus, device_t dev) +{ + + /* Used by ofw_iicbus. */ + return (ofw_bus_get_node(bus)); +} static int mv_twsi_probe(device_t dev)