Commit Graph

164 Commits

Author SHA1 Message Date
xtraeme
74fc6cf06c Split device_t/softc and other related cosmetic changes. 2008-04-04 09:49:49 +00:00
ad
b19c5369ab Make it compile again. 2008-03-27 17:34:54 +00:00
jmcneill
bd7babb259 Split device_t and softc, use cfdata_t 2008-03-27 12:15:16 +00:00
jmcneill
0a866f5754 Use device_t, cfdata_t 2008-03-27 12:14:54 +00:00
jmcneill
9655a911a4 Split device_t and softc, replace malloc with kmem_alloc 2008-03-27 12:08:37 +00:00
perry
b6a2ef7569 Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
2007-12-25 18:33:32 +00:00
njoly
74ac36ac9c Do not try to attach spdmem if i2c adress exceed 0x57.
It must follow the reserved eeprom adresses range.
2007-12-14 13:18:43 +00:00
xtraeme
fcad73742f Check return value of pmf_device_register(), pointed out by joerg.
Looks like the pmf(9) manpage declared it as void and not bool...
2007-12-13 15:36:29 +00:00
lukem
b55306727c use __KERNEL_RCSID() 2007-12-11 12:09:21 +00:00
lukem
3290dbb81a use __KERNEL_RCSID() 2007-12-11 05:38:12 +00:00
xtraeme
747de0248d Register to pmf(9). 2007-12-09 20:59:37 +00:00
jmcneill
4c1d81b2b5 Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
kiyohara
f400953756 Fix lost direction for the check on status, and read/writes. 2007-12-01 06:32:54 +00:00
kefren
7ff1853b95 Initialize sensor's state
on behalf of xtraeme
2007-11-17 08:30:35 +00:00
njoly
20aee1e2a0 Set sensor state to ENVSYS_SVALID for correct values. Otherwise,
envstat(8) will report an unknown state and won't print the sensor
value.

ok by xtraeme.
2007-11-16 22:46:56 +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
joerg
09f732085f From jmcneill-pm: don't probe for I2C device. It has limited usefulness
and hangs a number of machines.
2007-11-12 19:42:44 +00:00
ad
a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
xtraeme
d0ee80aad0 Make this report correct DDR2 speed/type, and round up the
MHz value as suggested by Alan Barret (apb@).

While I'm here make it report the correct type, it should be PC2 not PC
for DDR2.

spdmem0 at iic0 addr 0x50
spdmem0: DDR2 SDRAM memory, no parity or ECC, 1024MB, 800MHz, PC2-6400
spdmem0: 14 rows, 10 cols, 2 ranks, 4 banks/chip, 2.50ns cycle time
spdmem0: voltage SSTL 1.8V, refresh time 7.8us (self-refreshing)
spdmem1 at iic0 addr 0x51
spdmem1: DDR2 SDRAM memory, no parity or ECC, 1024MB, 667MHz, PC2-5300
spdmem1: 14 rows, 10 cols, 2 ranks, 4 banks/chip, 3.00ns cycle time
spdmem1: voltage SSTL 1.8V, refresh time 7.8us (self-refreshing)
2007-09-20 23:09:59 +00:00
xtraeme
b50c672fb3 Add missing SYSCTL_SETUP_PROTO() to make the LKM happy. 2007-09-09 13:48:14 +00:00
macallan
01e17775ae don't include machine/autoconf.h - we don't need it (anymore?) 2007-09-02 01:41:29 +00:00
macallan
20316fb57c defflag DEBUG_SGSMIX 2007-09-02 01:40:46 +00:00
xtraeme
e5db35db44 typo: ENVSYS_FVALID -> ENVSYS_SVALID. 2007-09-02 00:31:23 +00:00
riz
a550eae132 For SMBus, add the ability to enumerate devices on the bus.
This does NOT identify the devices, merely indicates the
presence of devices at certain addresses.  Tested on ichsmb
and nfsmb - other SMBus devices will need to ensure the
proper bus type is set. (I2C_TYPE_SMBUS)

From Nicolas Joly, via Paul Goyette, in PR#36744.
2007-09-01 22:19:25 +00:00
tnn
449902fc06 Add spdmem(4) driver. This decodes technical specifications stored in
the eeprom on common types of memory modules. The specifications are
displayed during boot and can later be queried in the hw.spdmemN sysctl
subtree. Stub driver written by Nicolas Joly and greatly improved upon by
Paul Goyette. From PR 36745, with additional improvements by Paul and me.
2007-08-18 11:26:35 +00:00
njoly
b7a7f31e43 Add missing STOP conditions at the end of I2C operations. 2007-07-25 11:18:15 +00:00
xtraeme
a63e9584d6 Forgot to set the description in the sensor. 2007-07-13 00:27:47 +00:00
njoly
db58331d9d Mark sensor as invalid if no fan is connected.
ok by xtraeme
2007-07-11 21:15:54 +00:00
ad
88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
xtraeme
60ed581de9 There's no need to set the "envsys-description" property in the
driver's dictionary anymore, because with envsys2 you can change
descriptions.
2007-07-04 19:00:43 +00:00
xtraeme
1492e24783 There's no need to get initial sensor data before registering the driver
to the sysmon_envsys(9) framework, because at register time, the
framework will get initial data by itself.
2007-07-04 18:56:16 +00:00
xtraeme
02974d235e pic16lc_update: use the edata pointer rather than using softc's array
index.
2007-07-02 10:36:47 +00:00
xtraeme
7c07c6cee5 adt74673_refresh_{fan,temp,volt}: use the edata pointer rather than
using softc's edata array index.
2007-07-02 10:25:54 +00:00
xtraeme
777c61efe0 There's no need to use another envsys_data_t pointer that points to
sme->sme_sensor_data again, just use the edata pointer passed in
the gtredata function.
2007-07-01 11:28:14 +00:00
xtraeme
da3f163bd2 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 07:37:12 +00:00
christos
33da203dba KNF, from Anon Ymous. Also kill extra unneeded initializers and use size_t
for indexes.
2007-06-15 19:47:59 +00:00
christos
09d8955eab Eliminate unnessary floating point.
XXX: someone should KNF this file.
2007-06-14 18:20:44 +00:00
macallan
a9c87314bd add support for i2c waitstates so we can actually talk to slow slaves
Suggestions and review by simon
2007-04-30 00:07:54 +00:00
njoly
47ae0ac9f2 Fix envsys ranges. 2007-04-15 13:03:20 +00:00
jmcneill
d93606a8fe Missing LIST_INIT. Pointed out by uebayasi@ 2007-02-06 12:39:15 +00:00
jmcneill
042d1598ba Remove debug printf accidentally added in last commit. 2007-02-05 23:56:13 +00:00
jmcneill
02ad924a21 Register an SMBus interrupt handler to trap the reset on eject "feature"
on the Microsoft Xbox. Also print details on other system management type
events while we're here -- they may come in handy in the future.
2007-02-05 23:33:53 +00:00
jmcneill
be9836eac7 Allow i2c child devices to register interrupt handlers to the smbus host
controller. Both interrupt context and process context type handlers are
supported.
2007-02-05 23:31:37 +00:00
macallan
daae1989bc add sgsmix 2007-01-17 23:33:23 +00:00
macallan
5ff56dc685 driver for the SGS 7433 mixer found in some G3 macs 2007-01-17 23:32:10 +00:00
cube
4cdd8aada6 Complete initializers so those files compile. 2007-01-13 18:42:45 +00:00
cube
e37986b806 Add missing initializers in cdevsw structs. 2007-01-12 19:33:21 +00:00
imp
d6b291ee71 Update a few comments based on newer members of the at24xx family.
Add support for the 128kbit, 256kbit and 512kbit parts.  Note issues
with the 1024kbit and larger parts, but don't add support for them at
this time.  I've not updated with the explosion of part numbers in
this family.
2007-01-12 08:47:43 +00:00
cube
eb54877e1f Complete initialiser of the cdevsw structure. 2007-01-10 18:53:31 +00:00
jmcneill
9db92e3203 Rename a few possible avpack values to reflect reality. 2007-01-07 01:08:51 +00:00
jmcneill
a733c906b1 Move register definitions to a separate header. 2007-01-07 01:02:34 +00:00
jmcneill
643b8aef05 Report the version string from the PIC16LC. 2007-01-06 19:11:08 +00:00
jmcneill
33e535f8fd Provide external functions for setting the LED, rebooting, and powering off
the system.
2007-01-06 18:38:28 +00:00
jmcneill
8ea80379e0 Microsoft Xbox serial EEPROM driver. Currently reports the system serial
number as sysctl machdep.xbox_serial.
2007-01-06 18:04:53 +00:00
jmcneill
4a2776e2e1 Fix __KERNEL_RCSID text (missing $) 2007-01-06 16:57:19 +00:00
jmcneill
9247d9813d Driver for the Xbox System Management Controller. Currently reports CPU and
motherboard temperatures, but will eventually be extended to replace
arch/i386/xbox/pic16l.S
2007-01-06 02:44:16 +00:00
jmcneill
a6c2ba7419 Remove include of machine/autoconf.h to make this compile. 2007-01-05 23:09:33 +00:00
christos
168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
christos
4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
gdamore
7020797810 Convert to MI clock_ymdhms versions of todr calls. 2006-09-09 21:10:01 +00:00
gdamore
a37acb1b52 Remove unused todr_setcal/todr_getcal and all the assorted stub
implementations.
2006-09-04 23:45:30 +00:00
bjh21
b223d41e99 gettime and settime functions are meant to return errno values. Make
the pcf8583 ones do so.
2006-08-23 21:21:34 +00:00
gdamore
4c26da3f0e Add support for 10-bit addressing, per i2c specs. This has not been tested
with any actual 10-bit devices (as I don't have any), but it doesn't seem to
impact 7-bit addressing any.  Approved by christos@, briggs@, and thorpej@.
2006-07-14 17:25:17 +00:00
thorpej
55e8bbeb6e Put appropriate prefixes on property names to reduce chances of name
collisions.
2006-07-10 16:28:44 +00:00
drochner
665742bb91 remove the "name" element from the i2cbus attach args, that's what
interface attributes are good for
2006-06-26 18:19:40 +00:00
kiyohara
19d35b3135 It necessary to mask to validate bits. 2006-06-12 16:07:33 +00:00
kiyohara
43911ef4e2 Support LM77 Temperature. 2006-05-17 00:10:54 +00:00
elad
2867b68bc3 integrate kauth. 2006-05-14 21:42:26 +00:00
thorpej
fb44a8574b Remove the devprop API and switch everthing over to the new proplib. Add
a new device_properties() accessor for device_t that returns the device's
property dictionary.
2006-05-05 18:04:41 +00:00
xtraeme
c28f2b42a3 PR kern/32885: adt7463 i2c device does not always unlock i2c bus on error.
Apply patch from Nicolas Joly.
2006-04-30 18:54:20 +00:00
gdamore
5c69d23f28 Oops! ddc.c was accidentally getting included in *all* kernel configs.
Added a new define so it can be included without doing the attach dance.
2006-04-26 06:52:09 +00:00
gdamore
9f862191dc Add basic DDC (VESA Data Display Channel) driver for use by framebuffers.
Reviewed by jmcneill@ and macallan@.
2006-04-25 21:18:16 +00:00
riz
99cd9e5be7 Correct a couple of typos in comments ("Hook info" -> "Hook into",
"prescision"->"precision")
2006-04-04 19:38:38 +00:00
thorpej
8fc3572573 Use device_private(). 2006-03-29 06:41:24 +00:00
thorpej
2be6494fc9 Use device_cfdata(). 2006-03-29 04:16:44 +00:00
jmcneill
913f185f8f Implement a handful of missing smbus protocol functions. Proposed on
tech-kern: http://mail-index.netbsd.org/tech-kern/2006/03/16/0029.html
2006-03-27 23:59:38 +00:00
shige
94274c9331 Add r2025rtc. 2006-03-06 20:29:06 +00:00
shige
2e6c8a97d2 Add a driver for RICOH R2025S/D I2C RTC. 2006-03-06 19:55:08 +00:00
christos
1b2709754a cleanup more SET/CLR/ISSET lossage 2006-03-05 17:33:33 +00:00
xtraeme
80a3ae858b * Add missing $NetBSD$ tag and __KERNEL_RCSID.
* Nuke completely __P().
2006-02-19 08:40:12 +00:00
tls
b69125454c Add support for i2c bus on AMD-8111 used on many Opteron server motherboards,
and ADT 7463c thermal and voltage monitor found on the Tyan S2881 and S2882-D
(and probably other boards as well).  We do not currently support any kind
of detection of the i2c address of the thermal monitor; it appears to be
at 0x2D on the S2881 and 0x2E on the S2882-D (kernel config examples
forthcoming).

From PR kern/32463 submitted by Anil Gopinath, anil_public@yahoo.com.
2006-02-19 02:24:20 +00:00
thorpej
680d9eea68 - Don't expose dev_propdb directly -- provide devprop_*() wrappers instead.
- Rework the ARMADILLO / epe device properties interaction so that it actually
  associates the MAC address property with the epe device instance.
2006-02-18 05:04:11 +00:00
macallan
4d89623450 back out previous commit 2006-02-17 18:45:40 +00:00
macallan
3d6233f0c1 set I2C_OP_WRITE when passing a write buffer to iic_exec() 2006-02-17 17:58:53 +00:00
abs
97ca1ffebb Update some missed _close() and _open() functions from 'struct proc *p'
to 'struct lwp *l'.
2005-12-13 20:55:46 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
nonaka
4fa7623be8 Use I2C_OP_{READ,WRITE}_WITH_STOP instead of I2C_OP_{READ,WRITE}. 2005-10-22 15:12:28 +00:00
macallan
6a34aa32a0 Shuffle thermal sensor numbering so temp0 is always the on-chip sensor and temp1
is always CPU temperature.
2005-09-11 20:26:15 +00:00
drochner
46ed4b50c4 s/locdesc_t/int/g 2005-08-26 12:42:11 +00:00
nonaka
0ec1cb9383 Initialize CONTROL1 registers. 2005-08-16 16:33:50 +00:00
nonaka
f4372b7c37 Added RICOH RS5C372[AB] Real Time Clock. 2005-08-16 11:09:12 +00:00
macallan
d0c6868c13 added drivers for Analog Devices ADT7467 and ADM1030 thermal monitor / fan controller chips found in various Apple laptops and probably other machines. 2005-08-10 14:18:28 +00:00
he
aafdb08c5a Fix the various todr_gettime() and todr_settime() fallouts from
-Wcast-qual differently, by instead changing the signatore of those
"functions" to take a "volatile struct timeval*" instead of a
"struct timeval*".  Many places, these functions are called with
&time, and time is declared as volatile in <sys/kernel.h>.  This
way we can get rid of all the ugly casts which now also triggered
warnings, and caused more code to be added to work around the
problem.

Reviewed by thorpej.
2005-06-04 20:14:24 +00:00
scw
812d004464 Appease -Wshadow 2005-06-03 12:18:46 +00:00
scw
1d6e3e9f5a Check and clear the HT bit in strtc_clock_read(), not just strtc_clock_write()
otherwise we end up reading the date/time of the previous powerfail event.
2004-11-24 14:46:18 +00:00
briggs
1991e35ca9 PR kern/27088 from Jared Momose. The read function should specify the
length of the command buffer (1) instead of 0.  Otherwise, data will
have an implied offset of 0 and reads at non-0 locations will incorrectly
return the data from 0.  Fix as suggested in the report.
2004-09-30 18:57:39 +00:00
drochner
96b589fc18 a round of autoconf cleanup:
-convert submatch() style functions (passed to config_search() or
 config_found_sm()) to the locator passing variants
-pass interface attributes in some cases
-make submatch() functions look uniformly as far as possible
-avoid macros which just hide cfdata members, and reduce dependencies
 on "locators.h"
2004-09-13 12:55:47 +00:00
scw
14cb917552 Support the DS75; a variant of the LM75 but with a slightly different
data format.
2004-08-03 13:40:20 +00:00
wiz
b1ec4ffea9 Fix typo in comment, reported by Alexander Yurchenko grange at rt mipt ru. 2004-05-16 11:42:28 +00:00
christos
29f176cc88 PR/24746: Jared Momose: The _write routine in the at24cxx eeprom driver has
a =/== bug.
2004-03-11 15:11:53 +00:00