xref: /freebsd/share/man/man9/superio.9 (revision 4e8d558c)
1.\"
2.\" SPDX-License-Identifier: BSD-2-Clause
3.\"
4.\" Copyright (c) 2019 Andriy Gapon <avg@FreeBSD.org>
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.\" $FreeBSD$
28.\"
29.Dd October 11, 2019
30.Dt SUPERIO 9
31.Os
32.Sh NAME
33.Nm superio ,
34.Nm superio_devid ,
35.Nm superio_dev_disable ,
36.Nm superio_dev_enable ,
37.Nm superio_dev_enabled ,
38.Nm superio_find_dev ,
39.Nm superio_get_dma ,
40.Nm superio_get_iobase ,
41.Nm superio_get_irq ,
42.Nm superio_get_ldn ,
43.Nm superio_get_type ,
44.Nm superio_read ,
45.Nm superio_revid ,
46.Nm superio_vendor ,
47.Nm superio_write
48.Nd Super I/O bus interface
49.Sh SYNOPSIS
50.In sys/bus.h
51.In dev/superio/superio.h
52.Ft uint16_t
53.Fn superio_devid "device_t dev"
54.Ft void
55.Fn superio_dev_disable "device_t dev" "uint8_t mask"
56.Ft void
57.Fn superio_dev_enable "device_t dev" "uint8_t mask"
58.Ft bool
59.Fn superio_dev_enabled "device_t dev" "uint8_t mask"
60.Ft device_t
61.Fn superio_find_dev "device_t dev" "superio_dev_type_t type" "int ldn"
62.Ft uint8_t
63.Fn superio_get_dma "device_t dev"
64.Ft uint16_t
65.Fn superio_get_iobase "device_t dev"
66.Ft uint8_t
67.Fn superio_get_irq "device_t dev"
68.Ft uint8_t
69.Fn superio_get_ldn "device_t dev"
70.Ft superio_dev_type_t
71.Fn superio_get_type "device_t dev"
72.Ft uint8_t
73.Fn superio_read "device_t dev" "uint8_t reg"
74.Ft uint8_t
75.Fn superio_revid "device_t dev"
76.Ft superio_vendor_t
77.Fn superio_vendor "device_t dev"
78.Ft void
79.Fn superio_write "device_t dev" "uint8_t reg" "uint8_t val"
80.Sh DESCRIPTION
81The
82.Nm
83set of functions are used for managing Super I/O devices.
84The functions provide support for
85raw configuration access,
86locating devices,
87device information,
88and
89device configuration.
90.Ss The controller interface
91The
92.Fn superio_vendor
93function is used to get a vendor of the Super I/O controller
94.Fa dev .
95Possible return values are
96.Dv SUPERIO_VENDOR_ITE
97and
98.Dv SUPERIO_VENDOR_NUVOTON .
99.Pp
100The
101.Fn superio_devid
102function is used to get a device ID of the Super I/O controller
103.Fa dev .
104.Pp
105The
106.Fn superio_revid
107function is used to get a revision ID of the Super I/O controller
108.Fa dev .
109.Pp
110The
111.Fn superio_find_dev
112function is used to find a device on the
113.Xr superio 4
114bus, specified by
115.Fa dev ,
116that has the requested type and logical device number.
117Either of those, but not both, can be a wildcard.
118Supported types are
119.Dv SUPERIO_DEV_GPIO ,
120.Dv SUPERIO_DEV_HWM ,
121and
122.Dv SUPERIO_DEV_WDT .
123The wildcard value for
124.Fa type
125is
126.Dv SUPERIO_DEV_NONE .
127The wildcard value for
128.Fa ldn
129is -1.
130.Ss The device interface
131The
132.Fn superio_read
133function is used to read data from the Super I/O configuration register
134of the device
135.Fa dev .
136.Pp
137The
138.Fn superio_write
139function is used to write data to the Super I/O configuration register
140of the device
141.Fa dev .
142.Pp
143The
144.Fn superio_dev_enable ,
145.Fn superio_dev_disable ,
146and
147.Fn superio_dev_enabled
148functions are used to enable, disable, or check status of the device
149.Fa dev .
150The
151.Fa mask
152parameter selects sub-functions of a device that supports them.
153For devices that do not have sub-functions,
154.Fa mask
155should be set to 1.
156.Ss The accessor interface
157The
158.Fn superio_get_dma
159is used to get a DMA channel number configured for the device
160.Fa dev .
161.Pp
162The
163.Fn superio_get_iobase
164is used to get a base I/O port configured for the device
165.Fa dev .
166The device may expose additional or alternative configuration access via
167the I/O ports.
168.Pp
169The
170.Fn superio_get_irq
171is used to get an interrupt number configured for the device
172.Fa dev .
173.Pp
174The
175.Fn superio_get_ldn
176is used to get a Logical Device Number of the device
177.Fa dev .
178.Pp
179The
180.Fn superio_get_type
181is used to get a type of the device
182.Fa dev .
183.Sh SEE ALSO
184.Xr superio 4 ,
185.Xr device 9 ,
186.Xr driver 9
187.Sh AUTHORS
188This manual page was written by
189.An Andriy Gapon Mt avg@FreeBSD.org
190