From: kettenis Date: Sun, 21 Nov 2021 11:00:40 +0000 (+0000) Subject: Register i2c bus. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=cc17cd85d4f311648693d8d0223d950b765a7cfd;p=openbsd Register i2c bus. ok jsg@ --- diff --git a/sys/dev/fdt/bcm2835_bsc.c b/sys/dev/fdt/bcm2835_bsc.c index 017d5078264..9d57d72d0e4 100644 --- a/sys/dev/fdt/bcm2835_bsc.c +++ b/sys/dev/fdt/bcm2835_bsc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bcm2835_bsc.c,v 1.2 2021/03/11 09:15:25 patrick Exp $ */ +/* $OpenBSD: bcm2835_bsc.c,v 1.3 2021/11/21 11:00:40 kettenis Exp $ */ /* * Copyright (c) 2020 Mark Kettenis * @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -72,6 +73,7 @@ struct bcmbsc_softc { int sc_node; struct i2c_controller sc_ic; + struct i2c_bus sc_ib; }; int bcmbsc_match(struct device *, void *, void *); @@ -154,6 +156,10 @@ bcmbsc_attach(struct device *parent, struct device *self, void *aux) iba.iba_bus_scan_arg = &sc->sc_node; config_found(&sc->sc_dev, &iba, iicbus_print); + + sc->sc_ib.ib_node = sc->sc_node; + sc->sc_ib.ib_ic = &sc->sc_ic; + i2c_register(&sc->sc_ib); } int