14166dd7aSMarcel Moolenaar.\" Copyright (c) 2003 Marcel Moolenaar 24166dd7aSMarcel Moolenaar.\" All rights reserved. 34166dd7aSMarcel Moolenaar.\" 44166dd7aSMarcel Moolenaar.\" Redistribution and use in source and binary forms, with or without 54166dd7aSMarcel Moolenaar.\" modification, are permitted provided that the following conditions 64166dd7aSMarcel Moolenaar.\" are met: 74166dd7aSMarcel Moolenaar.\" 84166dd7aSMarcel Moolenaar.\" 1. Redistributions of source code must retain the above copyright 94166dd7aSMarcel Moolenaar.\" notice, this list of conditions and the following disclaimer. 104166dd7aSMarcel Moolenaar.\" 2. Redistributions in binary form must reproduce the above copyright 114166dd7aSMarcel Moolenaar.\" notice, this list of conditions and the following disclaimer in the 124166dd7aSMarcel Moolenaar.\" documentation and/or other materials provided with the distribution. 134166dd7aSMarcel Moolenaar.\" 144166dd7aSMarcel Moolenaar.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 154166dd7aSMarcel Moolenaar.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 164166dd7aSMarcel Moolenaar.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 174166dd7aSMarcel Moolenaar.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 184166dd7aSMarcel Moolenaar.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 194166dd7aSMarcel Moolenaar.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 204166dd7aSMarcel Moolenaar.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 214166dd7aSMarcel Moolenaar.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 224166dd7aSMarcel Moolenaar.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 234166dd7aSMarcel Moolenaar.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 244166dd7aSMarcel Moolenaar.\" SUCH DAMAGE. 254166dd7aSMarcel Moolenaar.\" 26*e2012b81SJohn Baldwin.Dd January 16, 2025 274166dd7aSMarcel Moolenaar.Dt BUS_CONFIG_INTR 9 284166dd7aSMarcel Moolenaar.Os 294166dd7aSMarcel Moolenaar.\" 304166dd7aSMarcel Moolenaar.Sh NAME 31*e2012b81SJohn Baldwin.Nm BUS_CONFIG_INTR , 32*e2012b81SJohn Baldwin.Nm bus_config_intr 33db79bbffSRuslan Ermilov.Nd "configure interrupt polarity and trigger mode" 344166dd7aSMarcel Moolenaar.\" 354166dd7aSMarcel Moolenaar.Sh SYNOPSIS 364166dd7aSMarcel Moolenaar.In sys/param.h 374166dd7aSMarcel Moolenaar.In sys/bus.h 384166dd7aSMarcel Moolenaar.Ft int 39db79bbffSRuslan Ermilov.Fo BUS_CONFIG_INTR 40*e2012b81SJohn Baldwin.Fa "device_t bus" "device_t dev" "int irq" "enum intr_trigger trig" 41*e2012b81SJohn Baldwin.Fa "enum intr_polarity pol" 42*e2012b81SJohn Baldwin.Fc 43*e2012b81SJohn Baldwin.Ft int 44*e2012b81SJohn Baldwin.Fo bus_config_intr 45db79bbffSRuslan Ermilov.Fa "device_t dev" "int irq" "enum intr_trigger trig" "enum intr_polarity pol" 46db79bbffSRuslan Ermilov.Fc 474166dd7aSMarcel Moolenaar.Sh DESCRIPTION 484166dd7aSMarcel MoolenaarThe 49db79bbffSRuslan Ermilov.Fn BUS_CONFIG_INTR 504166dd7aSMarcel Moolenaarmethod allows bus or device drivers to provide interrupt polarity and trigger 51db4fcadfSConrad Meyermode to parent buses. 525203edcdSRuslan ErmilovThis typically bubbles all the way up to the root bus (e.g.\& nexus) where the 534166dd7aSMarcel Moolenaarnecessary actions are taken to actually program the hardware. 544166dd7aSMarcel MoolenaarSince the 55db79bbffSRuslan Ermilov.Fn BUS_CONFIG_INTR 564166dd7aSMarcel Moolenaarmethod takes an interrupt number, it is assumed but not necessarily required 574166dd7aSMarcel Moolenaarthat it is called prior to 584166dd7aSMarcel Moolenaar.Xr BUS_SETUP_INTR 9 . 594166dd7aSMarcel Moolenaar.Pp 604166dd7aSMarcel MoolenaarThe 61*e2012b81SJohn Baldwin.Fn bus_config_intr 62*e2012b81SJohn Baldwinfunction is a simple wrapper around 63*e2012b81SJohn Baldwin.Fn BUS_CONFIG_INTR . 64*e2012b81SJohn Baldwin.Pp 65*e2012b81SJohn BaldwinThe 664166dd7aSMarcel Moolenaar.Fa trig 67db79bbffSRuslan Ermilovargument can be one of: 68db79bbffSRuslan Ermilov.Bl -tag -width ".Dv INTR_TRIGGER_CONFORM" 694166dd7aSMarcel Moolenaar.It Dv INTR_TRIGGER_CONFORM 704166dd7aSMarcel MoolenaarThe interrupt trigger mode is standard for the bus to which the device is 714166dd7aSMarcel Moolenaarattached. 724166dd7aSMarcel Moolenaar.It Dv INTR_TRIGGER_EDGE 734166dd7aSMarcel MoolenaarThe interrupt is edge triggered. 744166dd7aSMarcel MoolenaarThis means that the interrupt is raised by the rising edge of the signal on 754166dd7aSMarcel Moolenaarthe interrupt line. 76db79bbffSRuslan ErmilovThe signal typically reverts to the original state so as to cause a spike. 7785e2993aSGiorgos Keramidas.It Dv INTR_TRIGGER_LEVEL 784166dd7aSMarcel MoolenaarThe interrupt is level triggered. 794166dd7aSMarcel MoolenaarThis means that the interrupt is raised when the signal on the interrupt line 804166dd7aSMarcel Moolenaartransitions and remains unchanged after that until the interrupt has been 814166dd7aSMarcel Moolenaarserviced, after which the signal transitions back. 824166dd7aSMarcel Moolenaar.El 834166dd7aSMarcel Moolenaar.Pp 844166dd7aSMarcel MoolenaarThe 854166dd7aSMarcel Moolenaar.Fa pol 86db79bbffSRuslan Ermilovargument can be any one of: 87db79bbffSRuslan Ermilov.Bl -tag -width ".Dv INTR_POLARITY_CONFORM" 884166dd7aSMarcel Moolenaar.It Dv INTR_POLARITY_CONFORM 894166dd7aSMarcel MoolenaarThe interrupt polarity is standard for the bus to which the device is attached. 904166dd7aSMarcel Moolenaar.It Dv INTR_POLARITY_HIGH 914166dd7aSMarcel MoolenaarThe interrupt is activated by a high voltage on the interrupt line. 924166dd7aSMarcel Moolenaar.It Dv INTR_POLARITY_LOW 934166dd7aSMarcel MoolenaarThe interrupt is activated by a low voltage on the interrupt line. 944166dd7aSMarcel Moolenaar.El 954166dd7aSMarcel Moolenaar.\" 964166dd7aSMarcel Moolenaar.Sh RETURN VALUES 974166dd7aSMarcel MoolenaarZero is returned on success, otherwise an appropriate error is returned. 984166dd7aSMarcel Moolenaar.\" 994166dd7aSMarcel Moolenaar.Sh SEE ALSO 1004166dd7aSMarcel Moolenaar.Xr BUS_SETUP_INTR 9 , 1014166dd7aSMarcel Moolenaar.Xr BUS_TEARDOWN_INTR 9 , 1024166dd7aSMarcel Moolenaar.Xr device 9 , 1034166dd7aSMarcel Moolenaar.Xr driver 9 1044166dd7aSMarcel Moolenaar.\" 1054166dd7aSMarcel Moolenaar.Sh HISTORY 1064166dd7aSMarcel MoolenaarThe 107db79bbffSRuslan Ermilov.Fn BUS_CONFIG_INTR 1084166dd7aSMarcel Moolenaarmethod first appeared in 1094166dd7aSMarcel Moolenaar.Fx 5.2 . 1104166dd7aSMarcel Moolenaar.\" 1114166dd7aSMarcel Moolenaar.Sh AUTHORS 11209356c84SHiten PandyaThis manual page was written by 1138a7314fcSBaptiste Daroussin.An Marcel Moolenaar Aq Mt marcel@xcllnt.net . 114