Date: Wed, 14 Dec 2016 16:21:10 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310071 - stable/10/sys/dev/iicbus Message-ID: <201612141621.uBEGLAdL096133@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Wed Dec 14 16:21:10 2016 New Revision: 310071 URL: https://svnweb.freebsd.org/changeset/base/310071 Log: MFC r306589: Implement iicbus_write_ivar and impelemnt the NOSTOP ivar in both read and write. Modified: stable/10/sys/dev/iicbus/iicbus.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iicbus/iicbus.c ============================================================================== --- stable/10/sys/dev/iicbus/iicbus.c Wed Dec 14 16:20:51 2016 (r310070) +++ stable/10/sys/dev/iicbus/iicbus.c Wed Dec 14 16:21:10 2016 (r310071) @@ -192,6 +192,26 @@ iicbus_read_ivar(device_t bus, device_t case IICBUS_IVAR_ADDR: *result = devi->addr; break; + case IICBUS_IVAR_NOSTOP: + *result = devi->nostop; + break; + } + return (0); +} + +static int +iicbus_write_ivar(device_t bus, device_t child, int which, uintptr_t value) +{ + struct iicbus_ivar *devi = IICBUS_IVAR(child); + + switch (which) { + default: + return (EINVAL); + case IICBUS_IVAR_ADDR: + return (EINVAL); + case IICBUS_IVAR_NOSTOP: + devi->nostop = value; + break; } return (0); } @@ -302,6 +322,7 @@ static device_method_t iicbus_methods[] DEVMETHOD(bus_print_child, iicbus_print_child), DEVMETHOD(bus_probe_nomatch, iicbus_probe_nomatch), DEVMETHOD(bus_read_ivar, iicbus_read_ivar), + DEVMETHOD(bus_write_ivar, iicbus_write_ivar), DEVMETHOD(bus_child_pnpinfo_str, iicbus_child_pnpinfo_str), DEVMETHOD(bus_child_location_str, iicbus_child_location_str), DEVMETHOD(bus_hinted_child, iicbus_hinted_child),
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612141621.uBEGLAdL096133>