From: kettenis Date: Mon, 31 Jul 2023 09:00:43 +0000 (+0000) Subject: Make the RSB interface optional such that we can use this driver in kernels X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a20bb37734b498ea8b971714723d3749122e2f75;p=openbsd Make the RSB interface optional such that we can use this driver in kernels without the sxirsb(4) driver. ok uaa@ --- diff --git a/sys/dev/fdt/axppmic.c b/sys/dev/fdt/axppmic.c index 99ccc624974..2a2d9d9ddfe 100644 --- a/sys/dev/fdt/axppmic.c +++ b/sys/dev/fdt/axppmic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: axppmic.c,v 1.17 2023/07/06 20:02:36 uaa Exp $ */ +/* $OpenBSD: axppmic.c,v 1.18 2023/07/31 09:00:43 kettenis Exp $ */ /* * Copyright (c) 2017 Mark Kettenis * @@ -438,6 +438,10 @@ axppmic_i2c_write(struct axppmic_softc *sc, uint8_t reg, uint8_t value) /* RSB interface */ +#include "sxirsb.h" + +#if NSXIRSB > 0 + int axppmic_rsb_match(struct device *, void *, void *); void axppmic_rsb_attach(struct device *, struct device *, void *); @@ -489,6 +493,8 @@ axppmic_rsb_write(struct axppmic_softc *sc, uint8_t reg, uint8_t value) rsb_write_1(sc->sc_cookie, sc->sc_addr, reg, value); } +#endif + /* Common code */ void axppmic_attach_node(struct axppmic_softc *, int); diff --git a/sys/dev/fdt/files.fdt b/sys/dev/fdt/files.fdt index af80b6d33b6..22b5ed8023e 100644 --- a/sys/dev/fdt/files.fdt +++ b/sys/dev/fdt/files.fdt @@ -1,4 +1,4 @@ -# $OpenBSD: files.fdt,v 1.196 2023/07/22 22:43:53 patrick Exp $ +# $OpenBSD: files.fdt,v 1.197 2023/07/31 09:00:43 kettenis Exp $ # # Config file and device description for machine-independent FDT code. # Included by ports that need it. @@ -48,7 +48,7 @@ file dev/fdt/sxipio.c sxipio define rsb {} device sxirsb: rsb attach sxirsb at fdt -file dev/fdt/sxirsb.c sxirsb +file dev/fdt/sxirsb.c sxirsb needs-flag device sxipwm attach sxipwm at fdt