Module Name:    src
Committed By:   thorpej
Date:           Wed Dec 23 02:56:11 UTC 2020

Modified Files:
        src/sys/arch/arm/broadcom: bcm2835_bsc_fdt.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/broadcom/bcm2835_bsc_fdt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/broadcom/bcm2835_bsc_fdt.c
diff -u src/sys/arch/arm/broadcom/bcm2835_bsc_fdt.c:1.2 src/sys/arch/arm/broadcom/bcm2835_bsc_fdt.c:1.3
--- src/sys/arch/arm/broadcom/bcm2835_bsc_fdt.c:1.2	Sun May 31 23:52:19 2020
+++ src/sys/arch/arm/broadcom/bcm2835_bsc_fdt.c	Wed Dec 23 02:56:11 2020
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc_
 
 #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 @@ bsciic_fdt_attach(device_t parent, devic
 	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);
 }

Reply via email to