2
superio: Handle special I/O operations needed by most Super-I/O chips
4
Copyright (C) 2005-2008 Jean Delvare <jdelvare@suse.de>
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
26
int superio_parse_key(unsigned char *key, const char *s)
33
tmp = strtol(s, &end, 0);
34
if ((*end != '\0' && *end != ',')
35
|| (tmp < 0x00 || tmp > 0xff))
38
/* Byte is valid, store it */
42
if (key[0] == SUPERIO_MAX_KEY
50
/* Unexpected end of string */
54
void superio_write_key(int addrreg, unsigned char *key)
58
for (i = 1; i <= key[0]; i++)
59
outb(key[i], addrreg);
62
void superio_reset(int addrreg, int datareg)
64
/* Some chips (SMSC, Winbond) want this */
67
/* Return to "Wait For Key" state (PNP-ISA spec) */