1 /* $NetBSD: ugvar.h,v 1.3 2007/11/16 08:00:15 xtraeme Exp $ */
4 * Copyright (c) 2007 Mihai Chelaru <kefren@netbsd.ro>
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. The name of the author may not be used to endorse or promote products
13 * derived from this software without specific prior written permission.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23 * 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
32 bus_space_tag_t sc_iot
;
33 bus_space_handle_t sc_ioh
;
35 struct sysmon_envsys
*sc_sme
;
36 envsys_data_t sc_sensor
[UG_MAX_SENSORS
];
41 struct ug2_sensor_info
{
50 struct ug2_motherboard_info
{
53 struct ug2_sensor_info sensors
[UG2_MAX_NO_SENSORS
+ 1];
56 /* driver internal functions */
57 int ug_reset(struct ug_softc
*);
58 uint8_t ug_read(struct ug_softc
*, unsigned short);
59 int ug_waitfor(struct ug_softc
*, uint16_t, uint8_t);
60 void ug_setup_sensors(struct ug_softc
*);
61 void ug2_attach(device_t
);
62 int ug2_wait_ready(struct ug_softc
*);
63 int ug2_wait_readable(struct ug_softc
*);
64 int ug2_sync(struct ug_softc
*);
65 int ug2_read(struct ug_softc
*, uint8_t, uint8_t, uint8_t, uint8_t*);
68 void ug_refresh(struct sysmon_envsys
*, envsys_data_t
*);
69 void ug2_refresh(struct sysmon_envsys
*, envsys_data_t
*);
71 #endif /* _UGVAR_H_ */