xref: /freebsd/share/man/man9/superio.9 (revision 22cf89c938886d14f5796fc49f9f020c23ea8eaf)
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.Dd October 11, 2019
28.Dt SUPERIO 9
29.Os
30.Sh NAME
31.Nm superio ,
32.Nm superio_devid ,
33.Nm superio_dev_disable ,
34.Nm superio_dev_enable ,
35.Nm superio_dev_enabled ,
36.Nm superio_find_dev ,
37.Nm superio_get_dma ,
38.Nm superio_get_iobase ,
39.Nm superio_get_irq ,
40.Nm superio_get_ldn ,
41.Nm superio_get_type ,
42.Nm superio_read ,
43.Nm superio_revid ,
44.Nm superio_vendor ,
45.Nm superio_write
46.Nd Super I/O bus interface
47.Sh SYNOPSIS
48.In sys/bus.h
49.In dev/superio/superio.h
50.Ft uint16_t
51.Fn superio_devid "device_t dev"
52.Ft void
53.Fn superio_dev_disable "device_t dev" "uint8_t mask"
54.Ft void
55.Fn superio_dev_enable "device_t dev" "uint8_t mask"
56.Ft bool
57.Fn superio_dev_enabled "device_t dev" "uint8_t mask"
58.Ft device_t
59.Fn superio_find_dev "device_t dev" "superio_dev_type_t type" "int ldn"
60.Ft uint8_t
61.Fn superio_get_dma "device_t dev"
62.Ft uint16_t
63.Fn superio_get_iobase "device_t dev"
64.Ft uint8_t
65.Fn superio_get_irq "device_t dev"
66.Ft uint8_t
67.Fn superio_get_ldn "device_t dev"
68.Ft superio_dev_type_t
69.Fn superio_get_type "device_t dev"
70.Ft uint8_t
71.Fn superio_read "device_t dev" "uint8_t reg"
72.Ft uint8_t
73.Fn superio_revid "device_t dev"
74.Ft superio_vendor_t
75.Fn superio_vendor "device_t dev"
76.Ft void
77.Fn superio_write "device_t dev" "uint8_t reg" "uint8_t val"
78.Sh DESCRIPTION
79The
80.Nm
81set of functions are used for managing Super I/O devices.
82The functions provide support for
83raw configuration access,
84locating devices,
85device information,
86and
87device configuration.
88.Ss The controller interface
89The
90.Fn superio_vendor
91function is used to get a vendor of the Super I/O controller
92.Fa dev .
93Possible return values are
94.Dv SUPERIO_VENDOR_ITE
95and
96.Dv SUPERIO_VENDOR_NUVOTON .
97.Pp
98The
99.Fn superio_devid
100function is used to get a device ID of the Super I/O controller
101.Fa dev .
102.Pp
103The
104.Fn superio_revid
105function is used to get a revision ID of the Super I/O controller
106.Fa dev .
107.Pp
108The
109.Fn superio_find_dev
110function is used to find a device on the
111.Xr superio 4
112bus, specified by
113.Fa dev ,
114that has the requested type and logical device number.
115Either of those, but not both, can be a wildcard.
116Supported types are
117.Dv SUPERIO_DEV_GPIO ,
118.Dv SUPERIO_DEV_HWM ,
119and
120.Dv SUPERIO_DEV_WDT .
121The wildcard value for
122.Fa type
123is
124.Dv SUPERIO_DEV_NONE .
125The wildcard value for
126.Fa ldn
127is -1.
128.Ss The device interface
129The
130.Fn superio_read
131function is used to read data from the Super I/O configuration register
132of the device
133.Fa dev .
134.Pp
135The
136.Fn superio_write
137function is used to write data to the Super I/O configuration register
138of the device
139.Fa dev .
140.Pp
141The
142.Fn superio_dev_enable ,
143.Fn superio_dev_disable ,
144and
145.Fn superio_dev_enabled
146functions are used to enable, disable, or check status of the device
147.Fa dev .
148The
149.Fa mask
150parameter selects sub-functions of a device that supports them.
151For devices that do not have sub-functions,
152.Fa mask
153should be set to 1.
154.Ss The accessor interface
155The
156.Fn superio_get_dma
157is used to get a DMA channel number configured for the device
158.Fa dev .
159.Pp
160The
161.Fn superio_get_iobase
162is used to get a base I/O port configured for the device
163.Fa dev .
164The device may expose additional or alternative configuration access via
165the I/O ports.
166.Pp
167The
168.Fn superio_get_irq
169is used to get an interrupt number configured for the device
170.Fa dev .
171.Pp
172The
173.Fn superio_get_ldn
174is used to get a Logical Device Number of the device
175.Fa dev .
176.Pp
177The
178.Fn superio_get_type
179is used to get a type of the device
180.Fa dev .
181.Sh SEE ALSO
182.Xr superio 4 ,
183.Xr device 9 ,
184.Xr driver 9
185.Sh AUTHORS
186This manual page was written by
187.An Andriy Gapon Mt avg@FreeBSD.org
188