Commit Graph

456 Commits

Author SHA1 Message Date
cube 8b3327fe73 Print ACPI device name in a way that Jared McNeill and I find prettier.
I like it better because I get to see the name of the device as it appears
in the DSDT, which sometimes makes sense and that way it's easier to locate
the relevant code when debugging.

E.g.:

PIC (PNP0000) [AT Interrupt Controller] at acpipcib0 not configured
DMAD (PNP0200) [AT DMA Controller] at acpipcib0 not configured
attimer0 at acpipcib0 (TMR, PNP0100): AT Timer
RTC0 (PNP0B00) [AT Real-Time Clock] at acpipcib0 not configured
pckbc0 at acpipcib0 (PS2K, PNP0303): kbd port
acpibat0 at acpi0 (BAT0, PNP0C0A-0): ACPI Battery (Control Method)
2007-08-08 08:52:31 +00:00
cube 5f5f6cdbad Fix a few minor envsys2 bugs/oddities in acpi_bat(4).
- mark (DIS)CHARGERATE as invalid when (DIS)CHARGING so that envstat
   doesn't print some weird stats where the system appears to be doing
   both
 - handle the case when it's doing neither by marking *RATE as invalid
   and setting CHARGING to OFF (because we're not charging, even though
   we're not discharging)
 - fix print_stats to print correct values in those cases, and a real
   percentage (i.e., computed against LFCCAPACITY)
2007-08-08 08:36:41 +00:00
xtraeme 415820dd5e Fix up some comments. 2007-07-29 15:44:24 +00:00
xtraeme 912541575c Disable monitoring in the ACPIBAT_TECHNOLOGY sensor, which is just
informative.
2007-07-16 17:54:46 +00:00
xtraeme 5415c24ed1 aiboost_refresh_sensors: if value returned is 0, invalidate the sensor too. 2007-07-16 16:44:26 +00:00
xtraeme a003094a5a If the method returned invalid data mark the sensor as invalid and
return, but if next time data is ok mark the sensor again as valid.
2007-07-12 18:50:40 +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 5310357612 Adapt to the recent changes to the acpiacad(4) and acpibat(4) drivers. 2007-07-05 13:53:21 +00:00
xtraeme 65811978f4 Final round, after more comments from yamt and cube:
For indicators, if sensor is valid but it should report that it is
in disabled state (OFF), just set value_cur to 0 without changing its
state.
2007-07-05 13:47:46 +00:00
xtraeme 615572e484 acpibat_print_stat(): in the 'charging' indicator sensor, check its state
to select the correct string rather than using value_cur.
2007-07-05 12:14:18 +00:00
xtraeme 194be74536 Use only one Indicator sensor when the battery is connected/disconnected
and another one only for charging/discharging.
2007-07-05 12:08:45 +00:00
xtraeme 61142f7829 Use only one sensor to report if the AC Adapter is connected or not,
rather than using two: one when is connected and another one is
disconnected.
2007-07-05 12:07:40 +00:00
xtraeme 937ef5eeb2 Rather than using two AcpiInstallNotifyHandler() with ACPI_DEVICE_NOTIFY
and ACPI_SYSTEM_NOTIFY, use ACPI_ALL_NOTIFY and remove a redundant
call.
2007-07-03 07:44:05 +00:00
xtraeme ecb89ffa1a aiboost_refresh_sensors: initialize j before using it, to make this
build with AIBOOST_DEBUG.
2007-07-02 10:27:12 +00:00
xtraeme d0f8b29da6 aiboost_refresh_sensors:
- use the edata pointer rather than using the softc's edata array.
- if aiboost_get_value() couldn't get a proper value, invalidate the sensor.
2007-07-02 10:06:58 +00:00
xtraeme 20ba8844f6 aiboost_refresh_sensors: when refreshing a fan sensor, use the sum
of aitemp->num + aivolt->num sensors as index.

Closes PR kern/36589.
2007-07-01 20:45:10 +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
jmcneill f4e11163b6 Sony firmware strikes again!
The Sony VAIO VGN-N250E (and probably others) sends BatteryInformationChanged
on AC adapter state change. Handle that here.
2007-06-27 19:44:50 +00:00
jmcneill 7d42ba2288 Don't be quite so aggressive in EcWaitEvent; makes acpiec work on the
Sony VAIO VGN-N250E, and possibly others.
2007-06-26 22:36:16 +00:00
jmcneill c0ea19f984 Don't complain if we can't evaluate _ALn. 2007-06-23 20:01:31 +00:00
xtraeme 59000b719e Missing __KERNEL_RCSID(). 2007-05-08 17:17:14 +00:00
xtraeme ff1c414804 Split the ug(4) driver in three components:
* dev/ic/ug.c (main code shared by the attachments)
	* dev/isa/ug_isa.c (isa attachment)
	* dev/acpi/ug_acpi.c (acpi attachment)

That means that ug(4) can now be attached via ACPI.

Thanks to Mihai Chelaru for the good work.
2007-05-08 16:48:37 +00:00
christos d713bb3c1e PR/36273: Ryo ONODERA: com_acpi.c lacks a entry for Fujitsu Serial Pen Tablet 2007-05-04 14:18:36 +00:00
xtraeme 49eb062014 Cosmetics: remove useless comments, unneded headers, wrap a long line. 2007-04-19 14:51:47 +00:00
xtraeme 6fac3c8e51 Fix a typo getting the fan values, it was using incorrect uid. 2007-03-26 07:27:36 +00:00
xtraeme 1af43bae06 aiboost_getcomp: fix memcpy and use the length provided by the ACPI Object.
aiboost_refresh_sensors: fix a debugging printf.
2007-03-26 04:22:28 +00:00
xtraeme 0d40da510d typo. 2007-03-18 22:36:11 +00:00
xtraeme d57d6adf9b Rename acpi_aiboost to aiboost, suggested by cube. 2007-03-14 00:43:04 +00:00
xtraeme 9c83a552f8 ASUS AI Booster ACPI driver, ported from FreeBSD.
This driver will report values from the Super I/O chip via ACPI.
It should be possible to overclock the system with this driver, but
it's not implemented yet.

All newer ASUS motherboards probably will work with this driver
(device ATK0110).

[juan@nocturno][~]> envstat -r
CPU Temperature:     30.000 degC
 MB Temperature:     38.000 degC
  Vcore Voltage:      1.240 V
   +3.3 Voltage:      3.264 V
     +5 Voltage:      4.992 V
    +12 Voltage:     12.091 V
  CPU FAN Speed:       1454 RPM
[juan@nocturno][~]>
2007-03-13 04:01:51 +00:00
christos 88b6b36440 open and close envsys; from Cherry. 2007-03-11 01:24:12 +00:00
njoly 90b3c9e789 High Precision Event Timer driver, following Intel specifications.
Allow attachement at both ACPI (hpet@acpi) and AMD8111 LPC Controller
(hpet@amdpcib).

Requested by xtraeme, and tested by a few users.
2007-03-08 14:26:26 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
ad a030fa3a9b The ACPI locks need to run at IPL_VM, since they can be taken from
interrupt handlers.
2007-02-19 22:32:52 +00:00
ad 1d4a085a4a Initialize acpi_interrupt_list_mtx in acpi_probe(). 2007-02-19 22:31:05 +00:00
xtraeme c661f78440 AcpiOsDelete{Lock,Semaphore}: don't forget to destroy the mutex,
otherwise mutex_init might be called multiple times.

Discussed with Andrew hours ago.
2007-02-19 12:29:24 +00:00
xtraeme fe10a8bc01 Forgot to initialize the mutex. 2007-02-19 00:56:05 +00:00
xtraeme 9ece13126c Replace ACPI_INTERRUPT_LIST_{LOCK,UNLOCK} mutex_{enter,exit} 2007-02-19 00:41:48 +00:00
xtraeme 8ef949e8d4 * Provide same description in cv_init as we had before.
* Use cv_timedwait.

Thanks to Andrew for information.
2007-02-19 00:01:23 +00:00
xtraeme 58398d7565 * Replace simple_locks and exclusive locks with adaptive mutexes.
* Replace ltsleep/wakeup pairs with condition variables
  (cv_init/cv_wait/cv_broadcast).

Reviewed by ad@.
2007-02-18 23:41:07 +00:00
xtraeme a50e1fb3a5 Replace simple_locks with mutexes, reviewed by ad@. 2007-02-18 23:40:07 +00:00
xtraeme 039f493e4b Replace a simple_lock with a mutex, reviewed by ad@. 2007-02-18 23:39:20 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
cube 986edc395f Fix typoed function name. I guess not a lot of people use that driver. 2007-01-10 18:55:22 +00:00
cube 8c668f60b4 Add a lint-only value of "/dev/null" for ACPI_DSDT_FILE.
Bump required config(1) version.  Yes, it implies everybody will have to
rebuild config(1).  I can live with people hating me.
2007-01-09 13:41:30 +00:00
cube 35d885e59a Introduce acpi_check() to inform the caller whether the acpi driver is
still enabled, as it could have been disabled through USERCONF.

Use it in amd64 and i386 mainbus code and skip all ACPI processing in case
it is disabled.
2006-11-26 12:30:05 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
xtraeme 4a09170d84 Use __unused in function arguments where appropiate. (hi christos) 2006-10-12 06:56:47 +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
gdt ac02696458 Aggregate discharge rate over all batteries. Makes time remaining
reasonable when battery 0 is in use and battery 1 is fully discharged.
2006-10-11 19:14:29 +00:00
gdt cf2f8187a8 Aggregate current charge level and lastcap over all batteries, rather
than taking values from the last battery checked.  Solves problem of
apm showing status of 2nd battery in a 2-battery system.
2006-10-11 19:00:12 +00:00