acpi_ibm.c (298955) | acpi_ibm.c (300421) |
---|---|
1/*- 2 * Copyright (c) 2004 Takanori Watanabe 3 * Copyright (c) 2005 Markus Brueffer <markus@FreeBSD.org> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2004 Takanori Watanabe 3 * Copyright (c) 2005 Markus Brueffer <markus@FreeBSD.org> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/sys/dev/acpi_support/acpi_ibm.c 298955 2016-05-03 03:41:25Z pfg $"); | 29__FBSDID("$FreeBSD: head/sys/dev/acpi_support/acpi_ibm.c 300421 2016-05-22 13:58:32Z loos $"); |
30 31/* 32 * Driver for extra ACPI-controlled gadgets found on IBM ThinkPad laptops. 33 * Inspired by the ibm-acpi and tpb projects which implement these features 34 * on Linux. 35 * 36 * acpi-ibm: <http://ibm-acpi.sourceforge.net/> 37 * tpb: <http://www.nongnu.org/tpb/> --- 898 unchanged lines hidden (view full) --- 936 * The TMPx methods seem to return +/- 128 or 0 937 * when the respecting sensor is not available 938 */ 939 if (ACPI_FAILURE(acpi_GetInteger(sc->ec_handle, temp_cmd, 940 &temp[i])) || ABS(temp[i]) == 128 || temp[i] == 0) 941 temp[i] = -1; 942 else if (sc->thermal_updt_supported) 943 /* Temperature is reported in tenth of Kelvin */ | 30 31/* 32 * Driver for extra ACPI-controlled gadgets found on IBM ThinkPad laptops. 33 * Inspired by the ibm-acpi and tpb projects which implement these features 34 * on Linux. 35 * 36 * acpi-ibm: <http://ibm-acpi.sourceforge.net/> 37 * tpb: <http://www.nongnu.org/tpb/> --- 898 unchanged lines hidden (view full) --- 936 * The TMPx methods seem to return +/- 128 or 0 937 * when the respecting sensor is not available 938 */ 939 if (ACPI_FAILURE(acpi_GetInteger(sc->ec_handle, temp_cmd, 940 &temp[i])) || ABS(temp[i]) == 128 || temp[i] == 0) 941 temp[i] = -1; 942 else if (sc->thermal_updt_supported) 943 /* Temperature is reported in tenth of Kelvin */ |
944 temp[i] = (temp[i] - 2732 + 5) / 10; | 944 temp[i] = (temp[i] - 2731 + 5) / 10; |
945 } 946 947 error = sysctl_handle_opaque(oidp, &temp, 8*sizeof(int), req); 948 949 ACPI_SERIAL_END(ibm); 950 return (error); 951} 952 --- 363 unchanged lines hidden --- | 945 } 946 947 error = sysctl_handle_opaque(oidp, &temp, 8*sizeof(int), req); 948 949 ACPI_SERIAL_END(ibm); 950 return (error); 951} 952 --- 363 unchanged lines hidden --- |