Deleted Added
full compact
acpi_smbat.c (202771) acpi_smbat.c (216503)
1/*-
2 * Copyright (c) 2005 Hans Petter Selasky
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2005 Hans Petter Selasky
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_smbat.c 202771 2010-01-21 21:14:28Z jkim $");
28__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_smbat.c 216503 2010-12-17 16:21:30Z avg $");
29
30#include "opt_acpi.h"
31#include <sys/param.h>
32#include <sys/kernel.h>
33#include <sys/module.h>
34#include <sys/bus.h>
35
36#include <contrib/dev/acpica/include/acpi.h>

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

385 * If the rate is negative, it is discharging. Otherwise,
386 * it is charging.
387 */
388 if (acpi_smbus_read_2(sc, addr, SMBATT_CMD_CURRENT, &val))
389 goto out;
390
391 if (val > 0) {
392 sc->bst.rate = val * factor;
29
30#include "opt_acpi.h"
31#include <sys/param.h>
32#include <sys/kernel.h>
33#include <sys/module.h>
34#include <sys/bus.h>
35
36#include <contrib/dev/acpica/include/acpi.h>

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

385 * If the rate is negative, it is discharging. Otherwise,
386 * it is charging.
387 */
388 if (acpi_smbus_read_2(sc, addr, SMBATT_CMD_CURRENT, &val))
389 goto out;
390
391 if (val > 0) {
392 sc->bst.rate = val * factor;
393 sc->bst.state &= ~SMBATT_BS_DISCHARGING;
393 sc->bst.state |= ACPI_BATT_STAT_CHARGING;
394 } else if (val < 0)
395 sc->bst.rate = (-val) * factor;
396 else
397 sc->bst.rate = 0;
398
399 if (acpi_smbus_read_2(sc, addr, SMBATT_CMD_REMAINING_CAPACITY, &val))
400 goto out;

--- 92 unchanged lines hidden ---
394 sc->bst.state |= ACPI_BATT_STAT_CHARGING;
395 } else if (val < 0)
396 sc->bst.rate = (-val) * factor;
397 else
398 sc->bst.rate = 0;
399
400 if (acpi_smbus_read_2(sc, addr, SMBATT_CMD_REMAINING_CAPACITY, &val))
401 goto out;

--- 92 unchanged lines hidden ---