Skip to content

Commit

Permalink
Merge branches 'acpi-misc' and 'acpi-doc'
Browse files Browse the repository at this point in the history
* acpi-misc:
  ACPI: thermal: Remove redundant acpi_has_method() calls
  ACPI: SBS: remove unused const variable 'SMBUS_PEC'

* acpi-doc:
  Documentation: ACPI: DSD: Convert LED documentation to ReST
  • Loading branch information
Rafael J. Wysocki committed Sep 17, 2019
3 parents a781f39 + e88c740 + 2b2d424 commit 0b3e797
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
.. SPDX-License-Identifier: GPL-2.0
.. include:: <isonum.txt>

========================================
Describing and referring to LEDs in ACPI
========================================

Individual LEDs are described by hierarchical data extension [6] nodes under the
device node, the LED driver chip. The "reg" property in the LED specific nodes
Expand All @@ -25,8 +30,12 @@ entry shall contain the string "led@" followed by the number of the LED,
followed by the referred object name. That object shall be named "LED" followed
by the number of the LED.

An ASL example of a camera sensor device and a LED driver device for two LEDs.
Objects not relevant for LEDs or the references to them have been omitted.
Example
=======

An ASL example of a camera sensor device and a LED driver device for two LEDs is
show below. Objects not relevant for LEDs or the references to them have been
omitted. ::

Device (LED)
{
Expand Down Expand Up @@ -71,12 +80,15 @@ Objects not relevant for LEDs or the references to them have been omitted.
}

where
::

LED LED driver device
LED0 First LED
LED1 Second LED
SEN Camera sensor device (or another device the LED is
related to)
SEN Camera sensor device (or another device the LED is related to)

References
==========

[1] Device tree. <URL:http://www.devicetree.org>, referenced 2019-02-21.

Expand Down
1 change: 1 addition & 0 deletions Documentation/firmware-guide/acpi/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ACPI Support
namespace
dsd/graph
dsd/data-node-references
dsd/leds
enumeration
osi
method-customizing
Expand Down
2 changes: 0 additions & 2 deletions drivers/acpi/sbshc.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ enum acpi_smb_protocol {
SMBUS_BLOCK_PROCESS_CALL = 0xd,
};

static const u8 SMBUS_PEC = 0x80;

enum acpi_sbs_device_addr {
ACPI_SBS_CHARGER = 0x9,
ACPI_SBS_MANAGER = 0xa,
Expand Down
11 changes: 3 additions & 8 deletions drivers/acpi/thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,9 @@ static int acpi_thermal_set_cooling_mode(struct acpi_thermal *tz, int mode)
if (!tz)
return -EINVAL;

if (!acpi_has_method(tz->device->handle, "_SCP")) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "_SCP not present\n"));
if (ACPI_FAILURE(acpi_execute_simple_method(tz->device->handle,
"_SCP", mode)))
return -ENODEV;
} else if (ACPI_FAILURE(acpi_execute_simple_method(tz->device->handle,
"_SCP", mode))) {
return -ENODEV;
}

return 0;
}
Expand Down Expand Up @@ -463,8 +459,7 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
break;
}

if ((flag & ACPI_TRIPS_DEVICES)
&& acpi_has_method(tz->device->handle, "_TZD")) {
if (flag & ACPI_TRIPS_DEVICES) {
memset(&devices, 0, sizeof(devices));
status = acpi_evaluate_reference(tz->device->handle, "_TZD",
NULL, &devices);
Expand Down

0 comments on commit 0b3e797

Please sign in to comment.