View | Details | Raw Unified | Return to bug 247306
Collapse All | Expand All

(-)sys/dev/acpi_support/acpi_ibm.c.new (-5 / +15 lines)
Lines 1-6 Link Here
1
/*-
1
/*-
2
 * Copyright (c) 2004 Takanori Watanabe
2
 * Copyright (c) 2004 Takanori Watanabe
3
 * Copyright (c) 2005 Markus Brueffer <markus@FreeBSD.org>
3
 * Copyright (c) 2005 Markus Brueffer <markus@FreeBSD.org>
4
 * Copyright (c) 2020 Ali Abdallah <ali.abdallah@suse.com>
4
 * All rights reserved.
5
 * All rights reserved.
5
 *
6
 *
6
 * Redistribution and use in source and binary forms, with or without
7
 * Redistribution and use in source and binary forms, with or without
Lines 256-262 Link Here
256
	{
257
	{
257
		.name		= "fan_level",
258
		.name		= "fan_level",
258
		.method		= ACPI_IBM_METHOD_FANLEVEL,
259
		.method		= ACPI_IBM_METHOD_FANLEVEL,
259
		.description	= "Fan level",
260
		.description	= "Fan level, 0-7 (recommended max), 8 (disengaged, full-speed)",
260
	},
261
	},
261
	{
262
	{
262
		.name		= "fan",
263
		.name		= "fan",
Lines 800-806 Link Here
800
		 */
801
		 */
801
		if (!sc->fan_handle) {
802
		if (!sc->fan_handle) {
802
			ACPI_EC_READ(sc->ec_dev, IBM_EC_FANSTATUS, &val_ec, 1);
803
			ACPI_EC_READ(sc->ec_dev, IBM_EC_FANSTATUS, &val_ec, 1);
803
			val = val_ec & IBM_EC_MASK_FANLEVEL;
804
			if (val_ec & IBM_EC_MASK_FANDISENGAGED)
805
				val = 8;
806
			else
807
				val = val_ec & IBM_EC_MASK_FANLEVEL;
804
		}
808
		}
805
		break;
809
		break;
806
810
Lines 875-889 Link Here
875
		break;
879
		break;
876
880
877
	case ACPI_IBM_METHOD_FANLEVEL:
881
	case ACPI_IBM_METHOD_FANLEVEL:
878
		if (arg < 0 || arg > 7)
882
		if (arg < 0 || arg > 8)
879
			return (EINVAL);
883
			return (EINVAL);
880
884
881
		if (!sc->fan_handle) {
885
		if (!sc->fan_handle) {
882
			/* Read the current fanstatus */
886
			/* Read the current fanstatus */
883
			ACPI_EC_READ(sc->ec_dev, IBM_EC_FANSTATUS, &val_ec, 1);
887
			ACPI_EC_READ(sc->ec_dev, IBM_EC_FANSTATUS, &val_ec, 1);
884
			val = val_ec & (~IBM_EC_MASK_FANLEVEL);
888
			val = val_ec & (~IBM_EC_MASK_FANLEVEL) & (~IBM_EC_MASK_FANDISENGAGED);
885
889
886
			return ACPI_EC_WRITE(sc->ec_dev, IBM_EC_FANSTATUS, val | arg, 1);
890
			/* Full speed, set the disengaged bit */
891
			if (arg == 8)
892
				val |= 7 | IBM_EC_MASK_FANDISENGAGED;
893
			else
894
				val |= arg;
895
896
			return ACPI_EC_WRITE(sc->ec_dev, IBM_EC_FANSTATUS, val, 1);
887
		}
897
		}
888
		break;
898
		break;
889
899
(-)share/man/man4/acpi_ibm.4.new (-1 / +8 lines)
Lines 1-5 Link Here
1
.\" Copyright (c) 2005 Christian Brueffer
1
.\" Copyright (c) 2005 Christian Brueffer
2
.\" Copyright (c) 2005 Markus Brueffer
2
.\" Copyright (c) 2005 Markus Brueffer
3
.\" Copyright (c) 2020 Ali Abdallah
3
.\" All rights reserved.
4
.\" All rights reserved.
4
.\"
5
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" Redistribution and use in source and binary forms, with or without
Lines 292-298 Link Here
292
is not set accordingly.
293
is not set accordingly.
293
.It Va dev.acpi_ibm.0.fan_level
294
.It Va dev.acpi_ibm.0.fan_level
294
Indicates at what speed the fan should run when being in manual mode.
295
Indicates at what speed the fan should run when being in manual mode.
295
Values are ranging from 0 (off) to 7 (max).
296
Values are ranging from 0 (off) to 7 (max). Level 8 is used by the driver
297
to set the fan in disengaged mode. In this mode, the fan is set to freely spin
298
and it will quickly reach a very high speed. Use this mode only if absolutely
299
necessary, i.e. your system reached its critical temperature and it is about
300
to shutdown.
296
The resulting speed differs from model to model.
301
The resulting speed differs from model to model.
297
On a T41p this is as follows:
302
On a T41p this is as follows:
298
.Pp
303
.Pp
Lines 305-310 Link Here
305
~3600 RPM
310
~3600 RPM
306
.It Li 6, 7
311
.It Li 6, 7
307
~4300 RPM
312
~4300 RPM
313
.It Li 8
314
~6400 RPM (Full-speed, disengaged)
308
.El
315
.El
309
.It Va dev.acpi_ibm.0.fan_speed
316
.It Va dev.acpi_ibm.0.fan_speed
310
(read-only)
317
(read-only)

Return to bug 247306