Commit Graph

56 Commits

Author SHA1 Message Date
jakllsch 563adefd93 Fix vcore readings in some cases on W83627THF by being mindful of the VRM9 mode. 2010-10-06 18:13:33 +00:00
njoly 712d8d88f4 Add some missing aprint_naive calls. 2010-03-23 12:13:28 +00:00
jakllsch 15c24d9ce4 Explicitly mark voltage readings as valid in Winbond voltage refresh functions.
This fixes forever-N/A VCore and -12V readings on my W83627THF chips.
.
2010-02-13 04:09:36 +00:00
njoly b7a0ac57a9 Kill extra semi-column. 2010-02-09 23:04:15 +00:00
pgoyette b3ab12f08e Correct setting of bits in the "generic thermistor" mode. Cut&paste
error pointed out by njoly@
2010-02-09 13:59:01 +00:00
pgoyette daefdf6156 After reviewing the datasheets, most of the supported Winbond chips can
handles the new flags for selecting sensor type.  Update code and man
page accordingly.
2010-02-08 23:10:35 +00:00
pgoyette fe173e0687 Add temp-sensor type selection (via autoconfig flags). Currently only
enabled for W83627HF but easily extended to others if appropriate.

Fixes PR kern-42758
2010-02-08 21:42:01 +00:00
pgoyette 54a63b92b0 Fix up the bus-independant probe code. Patch from njoly@ 2008-10-13 12:44:46 +00:00
pgoyette eacec974a3 Add an i2c attachment for the LM78 family of temp sensor/fan control
Tested by Martin Husemann
2008-10-12 13:17:28 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
xtraeme 3680f71913 Split device_t/softc in the lm(4) driver and its attachments, and
other related cosmetic changes.
2008-03-05 15:41:31 +00:00
xtraeme 96da5b3142 lm_refresh_volt: don't overwrite the state of the sensor. Patch by
Fukumoto Atsushi - PR kern/37977.
2008-02-07 20:35:44 +00:00
xtraeme 31962fc6e5 Extend the envsys2 API (one more time, sorry) as defined in:
http://mail-index.netbsd.org/tech-kern/2007/11/09/0001.html

sysmon_envsys_create() and sysmon_envsys_destroy() were added to
create/destroy sysmon_envsys objects (and its TAILQ/LIST for sensors/events).

sysmon_envsys_sensor_attach() and sysmon_envsys_sensor_detach() were
added to attach/detach sensors to a specified sysmon_envsys device.

The events framework is now per device and configurable via the
ENVSYS_SETDICTIONARY ioctl or /etc/envsys.conf and envstat(8).

Update all users and documentation to reflect these changes.
2007-11-16 08:00:11 +00:00
ad a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
xtraeme 94b4332c25 Update a comment. 2007-09-08 03:42:20 +00:00
xtraeme cf08870553 Use a 2 seconds period to refresh sensor data, previous value wasn't
accepted and triggered an assertion.
2007-09-08 03:38:35 +00:00
xtraeme e193a16137 - Use a callout(9) to refresh sensor data each 1.5 seconds, respecting
the limit in some LM chips.
- Add the lm_detach() function that stops/destroys the callout and
  unregisters the driver from the sysmon_envsys(9) framework.
2007-09-08 00:42:11 +00:00
xtraeme bab89d201b w83627ehf_sensors: don't add sensors with duplicate descriptions.
These are voltage sensors and the VINX name is appropiate.

Found by Heron Gallegos.
2007-08-08 10:09:43 +00:00
xtraeme f77ec0c18c Winbond W83627EHF-A support, from OpenBSD. 2007-07-02 17:49:47 +00:00
xtraeme bb8e671373 Imported envsys 2, a brief description of the new features:
(Part 2: drivers)

* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
  and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
  sysmon_power(9) and powerd(8), that means there is no 32 bytes event
  size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.

Tested by:

blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 08:29:48 +00:00
tsutsui 19c950bfd5 Fix a typo in RFACT of the second 3.3Vcc of W83627EHF. From OpenBSD. 2007-05-26 04:19:29 +00:00
xtraeme d5f3ba6a73 Fix a debug printf. 2007-04-19 20:24:47 +00:00
xtraeme 7b1f83bdfc Add more debugging printfs, to see the raw data returned by
the registers.
2007-04-19 20:18:39 +00:00
xtraeme 4b9be68be9 Use C99 struct initializers. 2007-03-13 18:32:35 +00:00
christos 31b5ea99cb fix missing initializers. 2007-03-11 22:25:48 +00:00
xtraeme f8fabb9a9e Explicitly initialize lm_sensor->rfact for every sensor's chip. 2007-03-11 21:23:22 +00:00
xtraeme 0562751ee3 Update for the nslm7x driver:
* For each supported chip, there's a struct lm_sensor array
  that specifies the sensor data, like reg, bank, descr, rfact.

* Rather than having 3 functions to setup the voltage, temp and fan
  sensors, just have one that will do all the three steps looking at
  its struct lm_sensor members, simplifying a lot the code.

and more things that I can remember, our code now is synced with
OpenBSD, IMHO much better to understand and maintain in the future.

Supported chips added with the new code include:

* Winbond: W83627EHF, W83627DHG, W83637HF, W83783S, W83791D, W83791SD,
           W83792D.
* Asus AS9912F.

My new mobo with the Winbond W83627DHG chip correctly reports
the values now:

lm0 at isa0 port 0x290-0x297: Winbond W83627DHG Hardware monitor

[juan@nocturno][~]> envstat -r
      VCore:      1.232 V
       +12V:     12.091 V
      +3.3V:      3.264 V
        +5V:      4.945 V
       VBAT:      3.728 V
System Temp:     36.000 degC
   CPU Temp:     29.500 degC
   Aux Temp:     22.000 degC
    CPU Fan:       1591 RPM
[juan@nocturno][~]>
2007-03-11 15:03:08 +00:00
hubertf eda05c6413 Remove more duplicate headers.
Patch by Slava Semushin <slava.semushin@gmail.com>

Again, this was tested by comparing obj files from a pristine and a patched
source tree against an i386/ALL kernel, and also for src/sbin/fsck_ffs,
src/sbin/fsdb and src/usr.sbin/makefs. Only changes in assert() line numbers
were detected in 'objdump -d' output.
2007-01-29 01:52:43 +00:00
tsutsui 990e13dfb3 Typo. 2007-01-07 12:10:18 +00:00
hannken cbaa71d5f4 Add missing brace to make it compile again. 2006-06-08 10:56:49 +00:00
kardel de4337ab21 merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
2006-06-07 22:33:33 +00:00
xtraeme 3b291301d4 Remove code for the IT87xxF chipsets, it was included on its own
driver (it(4)).
2006-05-13 09:03:21 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
xtraeme b0a4f3e4be Added support for Winbond 83627THF, from OpenBSD. 2005-10-15 00:41:48 +00:00
xtraeme 53eca961c3 Identify correctly ITE Super I/O chipsets by checking the core ID
register (only available in the model 8712F), if that fails we check
the vendor ID register as before.
2005-04-29 02:02:52 +00:00
perry f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
perry 18db93c7f6 de-__P 2005-02-04 02:10:35 +00:00
christos a3a9698bfd PR/26420: Thilo Manske: lm(4): Add support vor environment controller
built into iTE 8705f
Also: change some memcpy's to strlcpy's and some (0)'s to 0's
2004-07-24 18:59:16 +00:00
itojun aca4c091d3 sprintf -> snprintf 2004-04-22 00:17:10 +00:00
ad 5a728ace12 Changes for SMBus/I2C:
- Move lm_readreg/lm_writereg into the front-ends. Add/use function pointers
  in the softc.
- Add a bank select function pointer to the softc and provide a generic
  version. WinBond chips accessed over serial bus present three addresses,
  two of which are used to access bank 1/2 registers.
- Mark TSENS2/3 sensor data as invalid if the the corresponding bank select
  fails.
2002-11-15 14:55:41 +00:00
thorpej 1cba452d86 Fix signed/unsigned comparison warnings. 2002-11-07 08:02:09 +00:00
bouyer f6ef011e7e Properly identify LM81. From Sergey Svishchev in PR kern/13420. 2002-04-05 16:11:47 +00:00
tron 92ca7a2bc8 Apply changes provided by Thilo Manske in PR kern/16118:
1. Fix setting of nominal fan speeds with ENVSYS_STREINFO.
2. Treat Winbond 83781D specially because it has a programmable divisor for
   FAN3 unlike generic devices.
3. Set nominal RPMs.
4. Fix a typo in the code for setting FAN3's divisor for W83782 type
   hardware monitors.
2002-03-30 13:37:41 +00:00
lukem a4bae8b066 add/cleanup RCSID 2001-11-13 13:14:31 +00:00
wiz 456dff6cb8 Spell 'occurred' with two 'r's. 2001-09-16 16:34:23 +00:00
veego 232ac6b3d1 Print the vendor and chip id in the DPRINTF with 0x%x and not just %d. 2000-11-04 18:28:19 +00:00
bouyer a8421d4787 Some W83781 have ID 0x11 instead of 0x10; handle these too.
Restore printing sdata for each sensors if DEBUG.
2000-08-03 09:27:01 +00:00
bouyer de378db998 W83781D: Explicitely reselect bank0 before using "value RAM" registers.
Hopefully this will make the W83781D works.
Also use common functions to set up fan & temp info[] & sensors[] for
the W83781D.
2000-08-02 22:20:41 +00:00
bouyer e445e43ddc Add support for the W83697HF - basically a W83627HF with only 2 temp sensors. 2000-08-02 21:50:37 +00:00
bouyer 100a4a6b22 Add support for the W83781D and W83782D hardware monitors. 2000-07-30 22:23:53 +00:00