Commit Graph

612 Commits

Author SHA1 Message Date
jmcneill
4ec3c2b1cd Add support for the WLAN / Bluetooth switch. 2007-12-21 22:14:03 +00:00
xtraeme
6d771ab8b4 Register a pmf(9) power handler... ok jmcneill@. 2007-12-21 21:52:10 +00:00
jmcneill
aa518c7bc8 Hook Thinkpad temperature sensors into envsys:
$ envstat -d thinkpad0
TMP0:     46.000 degC
TMP1:     39.000 degC
TMP2:     32.000 degC
TMP3:        N/A
TMP4:     50.000 degC
TMP5:        N/A
TMP6:     29.000 degC
TMP7:        N/A
2007-12-21 21:24:45 +00:00
jmcneill
f5210660c0 Add acpiec_bus_{read,write} and acpiec_get_handle, for use in other
device drivers.
2007-12-21 21:22:54 +00:00
jmcneill
c48902ebaf Handle notifications in a separate thread, and ensure that the BIOS doesn't
try to play trick with us when we are trying to manage the brightness
keys.
2007-12-21 18:43:39 +00:00
jmcneill
ef8922785d Convert AcpiOsSleep from using tsleep to cv_timedwait_sig 2007-12-21 18:42:38 +00:00
jmcneill
eedb1a1f01 Typo in previous. 2007-12-21 16:38:59 +00:00
jmcneill
ea50d249d2 Handle key repeat, and only match if MHKV returns an HKEY version we have
a chance of supporting.
2007-12-21 16:38:02 +00:00
jmcneill
5b0f734d51 Add Thinkpad ACPI driver, for controlling hotkeys and display brightness. 2007-12-21 15:15:19 +00:00
joerg
bc8d3e534e It seems like ACPICA can't deal with GPEs being handled before the GPE
handler is called, so clear the GPE bit in the callout as well.
This fixes the EC issues on T42 models.
2007-12-19 20:48:56 +00:00
jmcneill
dd0320ef8b Fix comment before AcpiOsGetTimer, no functional change. 2007-12-17 15:02:31 +00:00
jmcneill
f13c9086d0 acpi_pci_link_route_interrupt: if we're going to return a valid IRQ, we
need to fill in irq, pol, and trig arguments.
2007-12-16 23:11:08 +00:00
jmcneill
a73b778622 Now that ACPI-CA doesn't parse the X/RSDT for us, we need to map it
ourselves.

Before:
  acpi0: X/RSDT: OemId <      ,        ,00000000>, AslId <    ,00000000>
After:
  acpi0: X/RSDT: OemId <LENOVO,TP-7L   ,00001260>, AslId < LTP,00000000>

ACPI can now access the X/RSDT using 'acpi_map_rsdt' and 'acpi_unmap_rsdt'.
2007-12-16 21:10:34 +00:00
joerg
36cdfbe0db Don't retry to post a command if the EC doesn't answer for a second.
It seems to create more issues than it fixes. Try to defend against
lost/late GPEs by using a callout to kick the state machine regulary.
Add some notes about the purpose and working of the driver.
2007-12-15 09:30:59 +00:00
jmcneill
d72049ddbd Restore acpi_quirk functionality, lost in the latest ACPI-CA update. 2007-12-15 02:19:55 +00:00
perry
9b2b412c19 __FUNCTION__ -> __func__ 2007-12-15 00:39:14 +00:00
jmcneill
e692a6c76a Introduce pmf_system_bus_resume. In the ACPI S3 resume path, use this to
separate powering up devices from restoring their state. This is required
on some machines where AcpiLeaveSleepState can fail due to an attempt to
access a powered off device.
2007-12-14 01:29:29 +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
jmcneill
645fe8c342 Try not to pass garbage to pci_make_tag; workaround for odd ACPI DSDTs.
Fixes kern/37527.
2007-12-12 23:33:22 +00:00
jmcneill
faa68cee64 Rename acpiec_gpe_state_maschine -> acpiec_gpe_state_machine 2007-12-12 12:57:48 +00:00
jmcneill
c44d13d630 No longer required after jmcneill-pm merge. 2007-12-11 23:07:30 +00:00
xtraeme
0cd3ab0981 Register to the pmf(9) framework and fix an error path. 2007-12-10 23:25:59 +00:00
reinoud
3a44e8ad9d Add missing \n and remove surplus . 2007-12-10 22:56:29 +00:00
jmcneill
4c1d81b2b5 Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
jmcneill
0273402379 kern/37501: cosmetic error in acpi_tz probe messages 2007-12-08 23:01:30 +00:00
ad
6874e511b7 lockmgr -> mutex 2007-12-05 07:58:29 +00:00
ad
598ab03ad0 Match the docs: MUTEX_DRIVER/SPIN are now only for porting code written
for Solaris.
2007-12-05 07:06:50 +00:00
jmcneill
61d5fb95a4 No need to waste more than one line of output at attach time. 2007-12-02 06:26:40 +00:00
jmcneill
4fbe23fdd0 aprintify 2007-12-01 04:50:50 +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
bedc8f14a0 When assigning an IRQ for classic PIC routing to an ACPI link dev,
make sure to update the PCI Interrupt Register of all PCI devices using
it. This fixes interrupt with ACPI and w/o IOAPIC, when the BIOS didn't
route all interrupts correctly.

Reported by sborill@ and by Mathias De Belder in PR 37001, fix tested
by sborill@.
2007-11-07 15:29:15 +00:00
xtraeme
f4046a2e1c Missed a struct device -> device_t, found by joerg. 2007-11-05 23:57:32 +00:00
joerg
08de5799c0 Use the fallback to ACPI SCI as PCI interrupt only as a last resort
if no other entry could be used.
2007-11-05 10:30:44 +00:00
xtraeme
7cd6e1759b - Allocate the envsys_data_t structures dynamically, removing the
max limit.
- Use kmem(9) to allocate the memory.
2007-11-04 13:59:49 +00:00
xtraeme
64a549146f Follow plunky's changes:
- Use CFATTACH_DECL_NEW and remove struct device from the softc.
- Use aprint_*_dev().
- Use aiboost_refresh_sensors() for sme_gtredata.
2007-11-03 23:33:50 +00:00
xtraeme
4e10a84855 - Rename ENVSYS_BATTERY_STATE units to ENVSYS_BATTERY_CAPACITY and
introduce ENVSYS_BATTERY_CHARGE, which is the same than an Indicator and
  it's used to know if the battery is currently charging or discharging.

- Require two sensors at least for SME_CLASS_BATTERY to make the low-power
  condition work: a ENVSYS_BATTERY_CAPACITY plus ENVSYS_BATTERY_CHARGE.

- Simplify sme_event_check_lowpower() and make it check the required
  sensors in the SME_CLASS_ACADAPTER and SME_CLASS_BATTERY classes.
  If the acadapter is not ready, trust the state returned by the battery
  device.

Based on suggestion from joerg@.
2007-11-03 23:05:21 +00:00
plunky
812fa1c5a1 do not embed acpi device names in the sensor names
fake it in the compat code for the old envsys API
2007-11-02 19:21:29 +00:00
plunky
60822ed9d3 When no estimate of battery minutes_left can be made, apm should
return a value of 0.
2007-10-27 19:51:29 +00:00
joerg
65eda08509 Pass correct argument to callback, botched up in the last commit. 2007-10-24 07:05:35 +00:00
ad
a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
joerg
649a2156ea Convert to device_t/softc split. Use aprint API. 2007-10-18 23:54:54 +00:00
joerg
04e2d29955 Use callout_setfunc/callout_schedule. 2007-10-18 00:10:52 +00:00
joerg
8302c6904b Separate softc and device_t. Convert to aprint API and make the driver
less verbose by default.
2007-10-17 23:30:58 +00:00
xtraeme
112f996fbc Use a mutex(9) rather than a rwlock(9), it's cheaper. 2007-10-13 00:56:16 +00:00
xtraeme
7ade6d03ad Fix the problems described in:
http://mail-index.netbsd.org/current-users/2007/07/16/0012.html

- Introduce sme_class into the sysmon_envsys struct to specify a
  class; currently there are two classes: SME_CLASS_ACADAPTER and
  SME_CLASS_BATTERY.

- Add a new envsys event: PENVSYS_EVENT_LOW_POWER that is reached when
  all SME_CLASS_BATTERY devices are in CRITICAL/LOW state and there's not
  any SME_CLASS_ACADAPTER connected.

- Add the 'low-power' event into the sensor_battery script that will
  shutdown the system gracefully via 'shutdown -p'. If powerd(8) is
  not running, cpu_reboot(9) with RB_POWERDOWN is used.

- Make acpiacad(4) a SME_CLASS_ACADAPTER device and acpibat(4) a
  SME_CLASS_BATTERY device.

Update the documentation accordingly to these changes.
2007-10-10 23:25:39 +00:00
xtraeme
6a0ca41c22 Set the monitor value only once in the acpitz_init_envsys(),
not multiple times in the callout handler.
2007-10-07 23:14:53 +00:00
xtraeme
8b2678bd7e Use a two clause license for all the code I contributed.
The envsys code will be changed later.
2007-10-06 07:21:02 +00:00
jmcneill
02ef36ec48 Sort IO resources before attempting to attach; resolves issues on ACPI
firmware that reports 0x64,0x60 instead of 0x60,0x64. Patch tested by
Greg A. Woods.
2007-10-05 18:31:46 +00:00
njoly
69b70bfe60 Add ACPI address32 resource type support (DWord Address Space
Descriptor), for fixed size io and mem.

Fix hpet@acpi attachement on Dell Poweredge 860.
Tested by Wouter Schoot, thanks.

While here:
- Update some indentation
- Correct function check
- Add missing break
- Update wrong debug message

Reviewed by cube.
2007-09-28 15:16:16 +00:00
ad
9c412e0cbf x86 changes for pcc and LKMs.
- Replace most inline assembly with proper functions. As a side effect
  this reduces the size of amd64 GENERIC by about 120kB, and i386 by a
  smaller amount. Nearly all of the inlines did something slow, or something
  that does not need to be fast.
- Make curcpu() and curlwp functions proper, unless __GNUC__ && _KERNEL.
  In that case make them inlines. Makes curlwp LKM and preemption safe.
- Make bus_space and bus_dma more LKM friendly.
- Share a few more files between the ports.
- Other minor changes.
2007-09-26 19:48:34 +00:00
xtraeme
debeab5278 - Use a ENVSYS_BATTERY_STATE sensor rather than ENVSYS_GSTRING.
- Use ENVSYS_FMONSTCHANGED on the ENVSYS_BATTERY_STATE sensor to monitor
  state changes.
2007-09-04 16:56:30 +00:00
xtraeme
cba98bab30 Add a new sensor of type ENVSYS_GSTRING. This is useful to print
the current battery charge state.

$ envstat -dacpibat0 -s"acpibat0 charge state"
  acpibat0 charge state:     NORMAL
$

It will show WARNING, CRITICAL, LOW or NORMAL depending on the
state it is.
2007-09-02 19:38:32 +00:00
xtraeme
1a5f765979 Use a rwlock(9) to protect access while refreshing data in
aiboost_get_value().
2007-08-30 18:29:11 +00:00
xtraeme
9d55226ba9 Set ENVSYS_FMONNOTSUPP in the last two missing sensors, forgot in previous. 2007-08-26 20:52:15 +00:00
xtraeme
a8995b3790 Only assing the monitoring flags once in acpibat_init_envsys() before
registering the driver.
2007-08-26 20:47:42 +00:00
tnn
ca5c2e9bf5 apm emulation needs envsys. From Jukka Salmi on the current-users list. 2007-08-23 10:04:07 +00:00
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
jmcneill
466af2f141 When resuming from S1 standby, don't try to release a mutex that we hadn't
previously acquired.
2006-09-26 01:50:43 +00:00
dogcow
a3fae2e5b9 blah blah discard pointer qualifier blah. 2006-09-24 06:03:20 +00:00
jmcneill
f135e0d607 Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
2006-09-24 03:53:07 +00:00
fvdl
5f5c640d2e In acpi_pci_link_dump, print out polarity and trigger for the link device
properties.
2006-09-23 17:05:33 +00:00
fvdl
e1d75075c5 Define the "broken IRQ0 override" quirk, and add it for one type of ACPI
BIOS.
2006-09-23 17:04:26 +00:00
christos
ec7d898cf1 Complete the declaration. 2006-08-27 23:13:47 +00:00
christos
7e11d29fc2 Delete unsigned comparison with < 0 2006-08-27 22:33:49 +00:00
christos
9d18036adc PR/34241: Dave Sainty: Bound a memcpy to the sizeof the buffer where we
are trying to save the contents, instead of trying to copy what the lenght
of the acpi resource tells us.
2006-08-20 15:10:59 +00:00
itohy
cdb1835aff ACPI frontend for Yamaha OPL3-SA[23].
Derived from PR kern/33991 by jasper at pointless dot net.
2006-08-14 09:34:43 +00:00
christos
dfb16d34c3 PR/34117: Takuya SHIOZAKI: enhancement for acpiapm(4)
- make sleep state corresponding to standby/suspend changeable by using sysctl,
- make sure to generate APM events appropriately.
- arrange the code for getting power status.
2006-08-06 15:47:51 +00:00
christos
0fe2e6efc3 PR/34116: Takuya SHIOZAKI: acpiapm(4) misuses config(9)
acpiapm(4) always matches the first node of AML, which is unrelated
with acpiapm. Separate acpi(4)'s children into two individual interface
attributes.
2006-08-06 15:46:54 +00:00
xtraeme
911aafad9f Make this build again and fix the bus_space_tag_t member of the softc,
it's defined in the com_regs struct now.
2006-07-14 05:02:00 +00:00
gdamore
34537908ab Add an option COM_REGMAP to allow com(4) to use an array of register indices.
This allows us to convert aucom to just another com attachment, and cleanup
some code in the com_arbus.c.

Additionally, we use a common com_cleanup routine rather than having a
zillion copies of it in the attachment points.

This has been tested on a number architectures, and it has been shown to get
close to comparable performance when COM_REGMAP is defined, and comparable
when it is not defined.

Approved by core@.  Fixes PR port-evbmips/32362.
2006-07-13 22:56:00 +00:00
hira
7c54838d63 Fix typo (discarge -> discharge). 2006-07-12 13:16:36 +00:00
christos
2fbd5d820a Prevent zerodivide (from Kouichirou Hiratsuka) 2006-07-12 11:31:39 +00:00
fvdl
6bde80fce7 Do not try to disable link devices (using _DIS) at startup. This causes
problems on some systems. Leave the code commented out, we might want
to revisit this at some point in the future.
2006-07-10 09:18:36 +00:00
christos
bb97a3d660 url for M$ file changed. 2006-07-09 19:25:18 +00:00
christos
4998e59f23 Add acpi apm attachment based on sysmon hooks. 2006-07-08 20:23:53 +00:00
xtraeme
9c392ba6f4 Repeat after me, use __KERNEL_RCSID. 2006-07-05 18:17:59 +00:00
christos
01158ea892 Apply fvdl's acpi pci interrupt configuration code.
- MPACPI is no more.
- MPACPI_SCANPCI -> ACPI_SCANPCI
2006-07-04 00:30:21 +00:00
bouyer
0692f212b3 Move acpi_timer.h outside of __HAVE_TIMECOUNTER, as we need acpitimer_init()
for the non-timecounter case too.
2006-07-02 18:53:33 +00:00
christos
46e62b977f - use aprint instead of printf.
- centralize all the suspend/resume glue in one function.
2006-07-01 21:44:13 +00:00
xtraeme
8ad8d8401b Add __KERNEL_RCSID(). 2006-06-30 23:21:19 +00:00
xtraeme
1f14228ee9 Remove a debug printf. 2006-06-30 23:19:40 +00:00
drochner
3ce3b9b485 test the PM timer for glitches (using the algorithm from FreeBSD)
and use a single read if the timer looks good,
patch from Juan RP, with minor simplification by me
2006-06-26 12:29:36 +00:00
tsarna
d0e9109021 fix typo: idicator -> indicator 2006-06-24 23:40:50 +00:00
drochner
c14d23ac86 First cut on an implementation of an ACPI power management counter
backend for timecounters.
Due to known bugs in some chipsets, always read until we get 3 successive
samples which are monotonic, as FreeBSD does in its "safe" variant.
This can be refined later, either by chipset quirks or by a test (as
FreeBSD does).
2006-06-21 17:47:23 +00:00
cube
8b8d583b02 When we consume a resource definition from _PRS, advance to the next one.
Otherwise, if there are two resources definitions of the same type in _CRS,
the same one from _PRS will be used twice, which of course leads to errors.

Note:  _PRS is Possible Resources Set
       _CRS is Current Resources Set

XXX acpi_allocate_resources is still very weak, e.g. it completely ignores
    StartDependentFn entries which are kind of a switch.  But at least it's
    slightly better that way.

Tested by jmcneill@.
2006-06-20 12:31:19 +00:00
jmcneill
a3f69214b6 acpi_pci_fixup didn't work as well as I had hoped; don't bother for now. 2006-06-19 10:18:08 +00:00
jmcneill
3aa64055a0 Fixup PCI interrupt routing using ACPI tables on return from S3 sleep.
Requires options PCI_INTR_FIXUP in your kernel.
2006-06-19 02:32:12 +00:00
jmcneill
66bdce4546 EXPERIMENTAL: Add sysctl for triggering ACPI sleep. This interface is not
stable, so do not depend on it!

    To trigger sleep:
        # sysctl -w machdep.sleep_state=<n>
    Where <n> is typically 1 (standby), 3 (suspend), or 4 (hibernate).
2006-06-15 18:05:08 +00:00
elad
2867b68bc3 integrate kauth. 2006-05-14 21:42:26 +00:00
dogcow
12d973491c gcc4: 'Data' may be used uninitialized in this function 2006-05-14 03:02:14 +00:00
rpaulo
5cd433e986 My laptop sends DeviceCheck instead of PowerSourceStatusChanged. 2006-04-30 20:44:35 +00:00
kochi
bde9af0a6f NULL check for a parameter of AcpiOsSignal().
The upper layer (ACPI-CA) might call with NULL pointer.

This should resolve Coverity CID 1114.
2006-04-13 08:27:09 +00:00
kochi
046e0fba2e Change header location in accordance with moving ACPI-CA to sys/dist/acpica 2006-03-23 13:46:13 +00:00
kochi
143b386a80 change header location in accordance with moving ACPI-CA to sys/dist 2006-03-23 13:45:11 +00:00
kochi
31d00d1ca0 Move ACPI-CA to sys/dist/acpica.
also move ACPI-CA OS dependent sources from sys/dev/acpi/acpica/Osd to
sys/dev/acpi/acpica.
2006-03-23 13:44:10 +00:00
kochi
f0c5abbdc8 Move to sys/dev/acpi/acpica. 2006-03-23 13:43:05 +00:00
kochi
f4afd64ab0 Move to sys/dist/acpica.
suggested by cube.
2006-03-23 13:42:25 +00:00
kochi
cf31c67b37 Move from sys/dev/acpi/acpica/Osd. 2006-03-23 13:41:13 +00:00
kochi
90cb0d3a79 Merge ACPI-CA 20060217 2006-03-12 06:48:15 +00:00
cube
20468175d2 Regen. 2006-03-01 09:30:22 +00:00
cube
687f061948 Add INT0800 (Intel FWH RNG). Make tabulation consistent. 2006-03-01 09:29:47 +00:00