Commit Graph

733 Commits

Author SHA1 Message Date
jruoho
5d978521d4 Cleanup:
* Semantics.
  * Remove ACPI_LID_DEBUG.
  * Reduce the amount of error reporting.
  * As the status of the lid (open/closed) is known upon suspend, move the
    state variable to the softc, and avoid one object evaluation this way.
2010-02-28 09:23:30 +00:00
dyoung
c1b390d493 A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
2010-02-24 22:37:54 +00:00
pgoyette
fe9cd1c415 Print correct temperature value, and properly display negative temperatures.
Resolves PR kern/36615
2010-02-18 14:10:15 +00:00
pgoyette
fedb8afd44 Enhance DPRINTF to use AcpiFormatException as suggested in PR kern/40130 2010-02-18 13:52:33 +00:00
pgoyette
52af77f5e8 Adapt to changes in sysmon's limit structure. 2010-02-14 23:06:58 +00:00
cnst
e9089f1372 remove unnecessary AIBS_MONLIMITS ifdefs, no binary change; ok pgoyette 2010-02-11 06:54:57 +00:00
cnst
4f3a148428 * s/misformed/malformed/;
* don't change .status to anything other than SVALID and SINVALID in refresh();

suggested by <pgoyette>
2010-02-09 03:32:57 +00:00
cnst
8ea42bc9e8 use ACPI_INTEGER and PRIx64, and check success of sensor_attach; suggested by jruoho (Jukka Ruohonen) 2010-02-09 03:26:44 +00:00
cnst
1c23afa3cb New aibs(4) driver for ASUSTeK AI Booster (ACPI ATK0110) hardware monitor
with limit support.

        http://thread.gmane.org/gmane.os.netbsd.devel.kernel/35654

Reviewed by <pgoyette>, <jruoho> and <tech-kern>.
2010-02-09 03:19:50 +00:00
pgoyette
a0a7ab3ea8 Import my experimental ACPI SMBus Control Method Interface driver
XXX Should not be enabled in any configuration file until you have
XXX disabled corresponding "native" i2c driver!  Read the acpismbus(4)
XXX man page!
2010-02-06 20:10:18 +00:00
jruoho
4d0db25236 Fix incorrect notify handler type (ACPI_SYSTEM_NOTIFY -> ACPI_DEVICE_NOTIFY). 2010-02-01 09:45:04 +00:00
jruoho
b00d9a31ae Verify the object type before using variables from it.
In addition, use CTASSERT(9) instead of KASSERT(9).
2010-01-31 20:38:11 +00:00
jruoho
d9203cb513 Add a detachment routine. 2010-01-31 19:49:29 +00:00
jruoho
166db9da2a Also remove the ACPI notify handler upon detach. 2010-01-31 18:51:33 +00:00
jruoho
2554187b97 Add a detachment routine. While here, clarify the initialization of sensors. 2010-01-31 17:53:31 +00:00
jruoho
4cd0ccf8ab Add dynamic debug options for ACPI_DEBUG kernels.
ok jmcneill@, pooka@, pgoyette@
2010-01-31 11:26:20 +00:00
jruoho
d9ca089d6e Simplify and clean:
* Semantics.
        * Remove ACPI_ACAD_DEBUG.
        * Reduce the amount of error reporting.
        * Remove the internal bookkeeping flags and variables;
          instead operate only with a single state variable.
        * Trust that the notify handler is doing its job;
          remove the refresh routine from the sensor.
        * Queue a status check upon resume; we want to know
          if the status has changed when in suspend (and it
          is unclear if a notify is sent to us).
2010-01-31 11:16:18 +00:00
jruoho
6c41d7d7a2 Add detachment routine. 2010-01-31 07:34:10 +00:00
jruoho
baf97f9356 Allocate the sensor structures dynamically. 2010-01-31 06:45:09 +00:00
jruoho
1aca5372db Add detachment routines. 2010-01-31 06:10:53 +00:00
jruoho
a86a868599 Add the _COMPONENT definition for ACPI_DEBUG. 2010-01-30 18:35:48 +00:00
jruoho
d569343003 Add the _COMPONENT definition for ACPI_DEBUG. 2010-01-30 18:07:06 +00:00
jruoho
b875c5c314 If we failed to obtain the brightness level during suspend, do not try to
restore it with a possible garbage value during resume.
2010-01-29 12:22:00 +00:00
jruoho
ab77a1af1f Replace all AcpiEvaluateObject() calls with acpi_eval_set_integer().
(As the return buffers are not used for anything, no need to make
unnecessary temporary allocations.)

Compile tested only.

ok jmcneill@
2010-01-29 11:57:37 +00:00
jruoho
545590ff33 Fix a memory leak in the resume handler. 2010-01-29 11:23:25 +00:00
drochner
30d27f4f07 the "Battery Present Rate" is only required to be valid if the battery
is discharging; it might make sense when charging, but it doesn't
make sense if neither is the case -- remove a wrong assertion and
arrange the code to make this obvious
(actually, the ACPI spec says that the requirement is only for
rechargeable batteries)
2010-01-27 22:17:28 +00:00
jruoho
e6056a8df3 * Reintroduce a state variable. From njoly@.
* Always mark the charge state sensor as valid.
2010-01-24 11:32:13 +00:00
jruoho
3f1f18b1bd Cleanup:
* Remove ACPI_BAT_DEBUG.
  * Reduce the amount of error reporting.
  * Remove the internal bookkeeping flags.
  * Remove the debugging functions used to print status and information
    changes. This information is fully conveyed in the output of envstat(8).
  * Always evaluate _STA. If it fails or the battery is not present, mark
    all remaining sensors as invalid. This will eliminate the convoluted
    update routine.
  * Semantics.

Over 200 LOC was eliminated, but functional change should again be minimal.

ok jmcneill@, pgoyette@
2010-01-23 15:06:47 +00:00
jruoho
2327840926 Correct the type also in the WMI write method. 2010-01-23 13:32:45 +00:00
jruoho
f55e7ab193 * Fix the type of the input buffer in the WMI method call.
* Do not error out if the flags field is is 0x00. Observed by cegger@.
2010-01-23 12:48:19 +00:00
jruoho
791571cbd1 In preparation for upcoming changes:
* Provide proper definitions and use these.
  * Clarify the evaluation of _STA.
  * Mark the state of a sensor according to the return value from _STA.
  * Share the basic object evaluation in _BIF and _BST.
  * Verify the object types before using the objects.
  * Be aware of bogus values from _BIF and _BST, as noted in the
    specification.

Despite of the list, functional change should be minimal. Ok pgoyette@.
2010-01-21 08:57:17 +00:00
jruoho
f4cdb6678e Fix and improve several comments. 2010-01-18 18:49:27 +00:00
jruoho
e5a9d901c0 Use acpi_eval_reference_handle() to simplify code. No functional change.
ok jmcneill@, pgoyette@
2010-01-18 18:36:49 +00:00
jruoho
81e1657ee2 Introduce acpi_eval_reference_handle() --
an utility function to evaluate reference handles from package elements.

ok jmcneill@, pgoyette@
2010-01-18 18:06:31 +00:00
jruoho
8391833e8a Ensure that the return string is NUL-terminated in acpi_eval_string().
ok jmcneill@, pgoyette@
2010-01-18 17:34:37 +00:00
jruoho
91262361ae Add definitions for volume keys.
ok jmcneill@
2010-01-18 17:11:00 +00:00
jruoho
517e16fb9b Fix a minor bug where a reference handle is used for error reporting even
though it may not be present. While here, convert few lines to aprint_*().

ok pgoyette@
2010-01-18 17:09:17 +00:00
jruoho
25608cae55 regen. 2010-01-18 16:50:08 +00:00
jruoho
71c4a74b58 Add some ACPI 4.0 devices.
ok jmcneill@, pgoyette@
2010-01-18 16:34:47 +00:00
jruoho
3708b81bde Properly evaluate the _PRW object in case we have a package inside a
package.

ok jmcneill@
2010-01-12 12:21:04 +00:00
jruoho
ad7b6ed9be Add "ACPI fans" to the list of ignored HIDs, as discussed on port-i386@. 2010-01-09 15:43:12 +00:00
jruoho
6e01648990 Fix the casts in the event handler. 2010-01-09 15:34:59 +00:00
dyoung
cd6e1fbf91 Expand PMF_FN_* macros. 2010-01-08 19:53:10 +00:00
dyoung
e94f23b742 Move all copies of ifattr_match() to sys/kern/subr_autoconf.c. 2010-01-08 00:09:44 +00:00
jruoho
57bb616085 Fix a memory leak/corruption by commenting out the evaluation of the _PSL
control method. If it is needed in the future, the output buffer must be
freed after use.

ok pgoyette@, jmcneill@
2010-01-05 13:47:52 +00:00
jruoho
0398d5ad8e Use acpi_eval_struct() to simplify code.
ok pgoyette@, jmcneill@
2010-01-05 13:39:49 +00:00
jruoho
4979a58f9d Update the copyright. 2010-01-04 10:06:53 +00:00
jruoho
28fec82cc6 Two bug fixes:
- Use ACPI_ALL_NOTIFY instead of ACPI_DEVICE_NOTIFY.

	- Fix the data query method: this fails without input.

ok pgoyette@
2010-01-04 09:43:30 +00:00
jruoho
111b592d55 Cleanup:
- Provide the module declaration and use ACPI_FREE
	  as well as ACPI_ALLOCATE_LOCAL_BUFFER for ACPI_DEBUG.

	- Maintain the calling conventions of existing ACPI utility
	  functions by initializing the output buffer for the caller
	  in all applicable functions.

	- Remove superfluous const correctness. Additional semantics:
	  u_char -> char, u_int16_t -> uint16_t, and u_int64_t -> uint64_t.

	- Collect the validation of input parameters to a single function.

ok pgoyette@
2010-01-04 09:34:47 +00:00
jruoho
4053740fd1 Introduce acpiwmibus, a pseudo-bus to which the child WMI devices attach.
Multiple WMI mapper devices are supported, but each one can have only one
child device.

All exposed functions now require the parent mapper device as a parameter.

ok pgoyette@, jmcneill@
2010-01-03 17:53:15 +00:00