From owner-svn-src-head@freebsd.org Sat Jul 7 01:58:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C4AD1023CC8; Sat, 7 Jul 2018 01:58:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BCD67BACA; Sat, 7 Jul 2018 01:58:41 +0000 (UTC) (envelope-from jhibbits@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CA3A10F0C; Sat, 7 Jul 2018 01:58:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w671wetn070738; Sat, 7 Jul 2018 01:58:40 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w671weiT070737; Sat, 7 Jul 2018 01:58:40 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201807070158.w671weiT070737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 7 Jul 2018 01:58:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336056 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 336056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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: Sat, 07 Jul 2018 01:58:41 -0000 Author: jhibbits Date: Sat Jul 7 01:58:40 2018 New Revision: 336056 URL: https://svnweb.freebsd.org/changeset/base/336056 Log: Let ofw_iicbus work its magic on OPAL i2c buses. ofw_iicbus already has attachments on iichb. Rather than adding an explicit attachment onto opal_i2c, simply change the exposed name of the OPAL i2c bus to 'iichb'. Modified: head/sys/powerpc/powernv/opal_i2c.c Modified: head/sys/powerpc/powernv/opal_i2c.c ============================================================================== --- head/sys/powerpc/powernv/opal_i2c.c Sat Jul 7 01:54:45 2018 (r336055) +++ head/sys/powerpc/powernv/opal_i2c.c Sat Jul 7 01:58:40 2018 (r336056) @@ -90,6 +90,7 @@ static int opal_i2c_callback(device_t, int, caddr_t); static int opal_i2c_probe(device_t); static int opal_i2c_transfer(device_t, struct iic_msg *, uint32_t); static int i2c_opal_send_request(uint32_t, struct opal_i2c_request *); +static phandle_t opal_i2c_get_node(device_t bus, device_t dev); static device_method_t opal_i2c_methods[] = { /* Device interface */ @@ -99,6 +100,7 @@ static device_method_t opal_i2c_methods[] = { /* iicbus interface */ DEVMETHOD(iicbus_callback, opal_i2c_callback), DEVMETHOD(iicbus_transfer, opal_i2c_transfer), + DEVMETHOD(ofw_bus_get_node, opal_i2c_get_node), DEVMETHOD_END }; @@ -111,7 +113,7 @@ static device_method_t opal_i2c_methods[] = { static devclass_t opal_i2c_devclass; static driver_t opal_i2c_driver = { - "i2c", + "iichb", opal_i2c_methods, sizeof(struct opal_i2c_softc), }; @@ -244,6 +246,14 @@ opal_i2c_callback(device_t dev, int index, caddr_t dat } return (error); +} + +static phandle_t +opal_i2c_get_node(device_t bus, device_t dev) +{ + + /* Share controller node with iibus device. */ + return (ofw_bus_get_node(bus)); } DRIVER_MODULE(opal_i2c, opal_i2cm, opal_i2c_driver, opal_i2c_devclass, NULL,