Implement user-settable rfact in itesio.

Additionally, match on IT8721.
This commit is contained in:
jakllsch 2010-08-13 19:28:26 +00:00
parent 3d52b10fd5
commit ad67ca3e3a
2 changed files with 8 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: itesio_isa.c,v 1.20 2010/07/17 21:51:43 pgoyette Exp $ */
/* $NetBSD: itesio_isa.c,v 1.21 2010/08/13 19:28:26 jakllsch Exp $ */
/* Derived from $OpenBSD: it.c,v 1.19 2006/04/10 00:57:54 deraadt Exp $ */
/*
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: itesio_isa.c,v 1.20 2010/07/17 21:51:43 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: itesio_isa.c,v 1.21 2010/08/13 19:28:26 jakllsch Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -140,6 +140,7 @@ itesio_isa_match(device_t parent, cfdata_t match, void *aux)
case ITESIO_ID8712:
case ITESIO_ID8716:
case ITESIO_ID8718:
case ITESIO_ID8721:
case ITESIO_ID8726:
ia->ia_nio = 1;
ia->ia_io[0].ir_size = 2;
@ -462,9 +463,10 @@ itesio_refresh_volts(struct itesio_softc *sc, envsys_data_t *edata)
if (i == 5 || i == 6)
edata->value_cur -= ITESIO_EC_VREF;
/* rfact is (factor * 10^4) */
edata->value_cur *= itesio_vrfact[i];
if (edata->rfact)
edata->value_cur += edata->rfact;
edata->value_cur *= edata->rfact;
else
edata->value_cur *= itesio_vrfact[i];
/* division by 10 gets us back to uVDC */
edata->value_cur /= 10;
if (i == 5 || i == 6)

View File

@ -1,4 +1,4 @@
/* $NetBSD: itesio_isavar.h,v 1.7 2010/05/02 18:49:13 jakllsch Exp $ */
/* $NetBSD: itesio_isavar.h,v 1.8 2010/08/13 19:28:26 jakllsch Exp $ */
/* $OpenBSD: itvar.h,v 1.2 2003/11/05 20:57:10 grange Exp $ */
/*
@ -61,6 +61,7 @@
#define ITESIO_ID8712 0x8712
#define ITESIO_ID8716 0x8716
#define ITESIO_ID8718 0x8718
#define ITESIO_ID8721 0x8721
#define ITESIO_ID8726 0x8726
/*