Commit Graph

8 Commits

Author SHA1 Message Date
Mateusz Guzik
99cce2a3a9 superio: clean up empty lines in .c and .h files 2020-09-01 21:52:05 +00:00
Andriy Gapon
e84d431622 superio: do not assume that current LDN cannot change after config exit
That assumption should be true when superio(4) uses the hardware
exlusively.  But it turns out to not hold on some real systems.
So, err on the side of correctness rather than performance.
Clear current_ldn in sio_conf_exit.

Reported by:	bz
Tested by:	bz
MFC after:	1 week
2020-06-04 13:18:21 +00:00
Andriy Gapon
174bd5b040 superio: do not crash if failed to create the character device
MFC after:	1 week
2019-10-25 16:30:24 +00:00
Andriy Gapon
c8001490f8 superio_io.h: fix the copyright
MFC after:	1 week
2019-10-25 16:28:39 +00:00
Andriy Gapon
0aee3bdc56 superio: add a simple ioctl interface
MFC after:	1 week
2019-10-25 16:07:24 +00:00
Andriy Gapon
50f14c4f68 superio: fix the copyright block and update the year
MFC after:	2 weeks
2019-09-03 12:40:58 +00:00
Li-Wen Hsu
6529459a96 - Fix gcc build for superio(4)
- Change string mapping of SUPERIO_DEV_NONE to distinguish from SUPERIO_DEV_MAX

Reviewed by:	imp
Discussed with:	avg, imp, jhb
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D20880
2019-07-08 20:01:28 +00:00
Andriy Gapon
e3722b788e add superio driver
The goal of this driver is consolidate information about SuperIO chips
and to provide for peaceful coexistence of drivers that need to access
SuperIO configuration registers.

While SuperIO chips can host various functions most of them are
discoverable and accessible without any knowledge of the SuperIO.
Examples are: keyboard and mouse controllers, UARTs, floppy disk
controllers.  SuperIO-s also provide non-standard functions such as
GPIO, watchdog timers and hardware monitoring.  Such functions do
require drivers with a knowledge of a specific SuperIO.

At this time the driver supports a number of ITE and Nuvoton (fka
Winbond) SuperIO chips.
There is a single driver for all devices.  So, I have not done the usual
split between the hardware driver and the bus functionality.  Although,
superio does act as a bus for devices that represent known non-standard
functions of a SuperIO chip.  The bus provides enumeration of child
devices based on the hardcoded knowledge of such functions.  The
knowledge as extracted from datasheets and other drivers.
As there is a single driver, I have not defined a kobj interface for it.
So, its interface is currently made of simple functions.
I think that we can the flexibility (and complications) when we actually
need it.

I am planning to convert nctgpio and wbwd to superio bus very soon.
Also, I am working on itwd driver (watchdog in ITE SuperIO-s).
Additionally, there is ithwm driver based on the reverted sensors
import, but I am not sure how to integrate it given that we still lack
any sensors interface.

Discussed with:	imp, jhb
MFC after:	7 weeks
Differential Revision: https://reviews.freebsd.org/D8175
2019-07-01 17:05:41 +00:00