Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/broadcom Add missing call to fdtbus_register_i2...



details:   https://anonhg.NetBSD.org/src/rev/13873264e6f0
branches:  trunk
changeset: 979301:13873264e6f0
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Dec 23 02:56:11 2020 +0000

description:
Add missing call to fdtbus_register_i2c_controller().  This doesn't
affect basic child attachment, but would have broken other references
to the i2c controller in DT overlays.

diffstat:

 sys/arch/arm/broadcom/bcm2835_bsc_fdt.c |  18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diffs (45 lines):

diff -r c0a0be1bd527 -r 13873264e6f0 sys/arch/arm/broadcom/bcm2835_bsc_fdt.c
--- a/sys/arch/arm/broadcom/bcm2835_bsc_fdt.c   Tue Dec 22 23:26:42 2020 +0000
+++ b/sys/arch/arm/broadcom/bcm2835_bsc_fdt.c   Wed Dec 23 02:56:11 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcm2835_bsc_fdt.c,v 1.2 2020/05/31 23:52:19 thorpej Exp $      */
+/*     $NetBSD: bcm2835_bsc_fdt.c,v 1.3 2020/12/23 02:56:11 thorpej Exp $      */
 
 /*
  * Copyright (c) 2019 Jason R. Thorpe
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc_fdt.c,v 1.2 2020/05/31 23:52:19 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc_fdt.c,v 1.3 2020/12/23 02:56:11 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -46,6 +46,18 @@
 
 #include <dev/fdt/fdtvar.h>
 
+static i2c_tag_t
+bsciic_fdt_get_tag(device_t dev)
+{
+       struct bsciic_softc * const sc = device_private(dev);
+
+       return &sc->sc_i2c;
+}
+
+static const struct fdtbus_i2c_controller_func bsciic_fdt_funcs = {
+       .get_tag = bsciic_fdt_get_tag,
+};
+
 static int bsciic_fdt_match(device_t, cfdata_t, void *);
 static void bsciic_fdt_attach(device_t, device_t, void *);
 
@@ -129,5 +141,7 @@
        sc->sc_i2c.ic_release_bus = bsciic_release_bus;
        sc->sc_i2c.ic_exec = bsciic_exec;
 
+       fdtbus_register_i2c_controller(self, phandle, &bsciic_fdt_funcs);
+
        fdtbus_attach_i2cbus(self, phandle, &sc->sc_i2c, iicbus_print);
 }



Home | Main Index | Thread Index | Old Index