diff --git a/sys/dev/isa/pcppi.c b/sys/dev/isa/pcppi.c index 7ec3409755c8..9a2fb3b3fbd6 100644 --- a/sys/dev/isa/pcppi.c +++ b/sys/dev/isa/pcppi.c @@ -1,4 +1,4 @@ -/* $NetBSD: pcppi.c,v 1.44 2015/05/17 05:20:37 pgoyette Exp $ */ +/* $NetBSD: pcppi.c,v 1.45 2017/06/14 05:01:35 pgoyette Exp $ */ /* * Copyright (c) 1996 Carnegie-Mellon University. @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pcppi.c,v 1.44 2015/05/17 05:20:37 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pcppi.c,v 1.45 2017/06/14 05:01:35 pgoyette Exp $"); #include "attimer.h" @@ -246,6 +246,7 @@ pcppi_rescan(device_t self, const char *ifattr, const int *flags) return 0; pa.pa_cookie = sc; + pa.pa_bell_func = pcppi_bell; config_search_loc(pcppisearch, sc->sc_dv, "pcppi", NULL, &pa); return 0; diff --git a/sys/dev/isa/pcppivar.h b/sys/dev/isa/pcppivar.h index dccff22f9497..32ef9395a2cc 100644 --- a/sys/dev/isa/pcppivar.h +++ b/sys/dev/isa/pcppivar.h @@ -1,4 +1,4 @@ -/* $NetBSD: pcppivar.h,v 1.11 2011/11/23 23:07:32 jmcneill Exp $ */ +/* $NetBSD: pcppivar.h,v 1.12 2017/06/14 05:01:35 pgoyette Exp $ */ /* * Copyright (c) 1996 Carnegie-Mellon University. @@ -34,6 +34,7 @@ typedef void *pcppi_tag_t; struct pcppi_attach_args { pcppi_tag_t pa_cookie; + void (*pa_bell_func)(pcppi_tag_t, int, int, int); }; struct pcppi_softc { diff --git a/sys/dev/isa/spkr_pcppi.c b/sys/dev/isa/spkr_pcppi.c index ce0117e4eb2c..8fc1c88cff85 100644 --- a/sys/dev/isa/spkr_pcppi.c +++ b/sys/dev/isa/spkr_pcppi.c @@ -1,4 +1,4 @@ -/* $NetBSD: spkr_pcppi.c,v 1.10 2017/06/11 21:54:22 pgoyette Exp $ */ +/* $NetBSD: spkr_pcppi.c,v 1.11 2017/06/14 05:01:35 pgoyette Exp $ */ /* * Copyright (c) 1990 Eric S. Raymond (esr@snark.thyrsus.com) @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: spkr_pcppi.c,v 1.10 2017/06/11 21:54:22 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spkr_pcppi.c,v 1.11 2017/06/14 05:01:35 pgoyette Exp $"); #include #include @@ -66,6 +66,7 @@ __KERNEL_RCSID(0, "$NetBSD: spkr_pcppi.c,v 1.10 2017/06/11 21:54:22 pgoyette Exp struct spkr_pcppi_softc { struct spkr_softc sc_spkr; pcppi_tag_t sc_pcppicookie; + void (*sc_bell_func)(pcppi_tag_t, int, int, int); }; static int spkr_pcppi_probe(device_t, cfdata_t, void *); @@ -88,7 +89,7 @@ spkr_pcppi_tone(device_t self, u_int xhz, u_int ticks) aprint_debug_dev(self, "%s: %u %u\n", __func__, xhz, ticks); #endif /* SPKRDEBUG */ struct spkr_pcppi_softc *sc = device_private(self); - pcppi_bell(sc->sc_pcppicookie, xhz, ticks, PCPPI_BELL_SLEEP); + (*sc->sc_bell_func)(sc->sc_pcppicookie, xhz, ticks, PCPPI_BELL_SLEEP); } /* rest for given number of ticks */ @@ -123,6 +124,7 @@ spkr_pcppi_attach(device_t parent, device_t self, void *aux) aprint_normal(": PC Speaker\n"); sc->sc_pcppicookie = pa->pa_cookie; + sc->sc_bell_func = pa->pa_bell_func; spkr_attach(self, spkr_pcppi_tone, spkr_pcppi_rest); if (!pmf_device_register(self, NULL, NULL)) aprint_error_dev(self, "couldn't establish power handler\n");