Deleted Added
sdiff udiff text old ( 152818 ) new ( 157774 )
full compact
1/*-
2 * Copyright (c) 2005 Nate Lawson
3 * Copyright (c) 2000 Munehiro Matsuda
4 * Copyright (c) 2000 Takanori Watanabe
5 * Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@FreeBSD.org>
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_cmbat.c 152818 2005-11-26 07:36:53Z njl $");
32
33#include "opt_acpi.h"
34#include <sys/param.h>
35#include <sys/kernel.h>
36#include <sys/module.h>
37#include <sys/bus.h>
38#include <sys/ioccom.h>
39

--- 114 unchanged lines hidden (view full) ---

154 return (0);
155}
156
157static int
158acpi_cmbat_detach(device_t dev)
159{
160
161 acpi_battery_remove(dev);
162 return (0);
163}
164
165static int
166acpi_cmbat_resume(device_t dev)
167{
168
169 AcpiOsQueueForExecution(OSD_PRIORITY_LO, acpi_cmbat_init_battery, dev);

--- 260 unchanged lines hidden (view full) ---

430 "battery initialization start\n");
431
432 /*
433 * Try repeatedly to get valid data from the battery. Since the
434 * embedded controller isn't always ready just after boot, we may have
435 * to wait a while.
436 */
437 for (retry = 0; retry < ACPI_CMBAT_RETRY_MAX; retry++, AcpiOsSleep(10000)) {
438 if (!acpi_BatteryIsPresent(dev))
439 continue;
440
441 /*
442 * Only query the battery if this is the first try or the specific
443 * type of info is still invalid.
444 */
445 ACPI_SERIAL_BEGIN(cmbat);

--- 23 unchanged lines hidden ---