From 2b2d4247e445b97113c5e61df8fbc0d756482ef8 Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Wed, 14 Aug 2019 15:58:58 +0300 Subject: [PATCH 1/3] Documentation: ACPI: DSD: Convert LED documentation to ReST Convert the LED documentation in text format into ReST. Signed-off-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki --- .../acpi/dsd/leds.rst} | 20 +++++++++++++++---- Documentation/firmware-guide/acpi/index.rst | 1 + 2 files changed, 17 insertions(+), 4 deletions(-) rename Documentation/{acpi/dsd/leds.txt => firmware-guide/acpi/dsd/leds.rst} (90%) diff --git a/Documentation/acpi/dsd/leds.txt b/Documentation/firmware-guide/acpi/dsd/leds.rst similarity index 90% rename from Documentation/acpi/dsd/leds.txt rename to Documentation/firmware-guide/acpi/dsd/leds.rst index cc58b1a574c55..946efe2b2936a 100644 --- a/Documentation/acpi/dsd/leds.txt +++ b/Documentation/firmware-guide/acpi/dsd/leds.rst @@ -1,4 +1,9 @@ +.. SPDX-License-Identifier: GPL-2.0 +.. include:: + +======================================== 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 @@ -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) { @@ -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. , referenced 2019-02-21. diff --git a/Documentation/firmware-guide/acpi/index.rst b/Documentation/firmware-guide/acpi/index.rst index 90c90d42d9ad6..ad3b5afdae77e 100644 --- a/Documentation/firmware-guide/acpi/index.rst +++ b/Documentation/firmware-guide/acpi/index.rst @@ -10,6 +10,7 @@ ACPI Support namespace dsd/graph dsd/data-node-references + dsd/leds enumeration osi method-customizing From 85a5f06773c85f8ec5030ed65e5fa3190b3f16bd Mon Sep 17 00:00:00 2001 From: YueHaibing Date: Thu, 22 Aug 2019 22:43:46 +0800 Subject: [PATCH 2/3] ACPI: SBS: remove unused const variable 'SMBUS_PEC' drivers/acpi/sbshc.h:18:17: warning: SMBUS_PEC defined but not used [-Wunused-const-variable=] SMBUS_PEC is never used since introduction in commit 91087dfa51a2 ("ACPI: SBS: Split host controller (ACPI0001) from SBS driver (ACPI0002)"), so just remove it. Reported-by: Hulk Robot Signed-off-by: YueHaibing Signed-off-by: Rafael J. Wysocki --- drivers/acpi/sbshc.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/acpi/sbshc.h b/drivers/acpi/sbshc.h index 06372a37df10f..c3522bb827924 100644 --- a/drivers/acpi/sbshc.h +++ b/drivers/acpi/sbshc.h @@ -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, From e88c7409c983fb611f783918c270cd18c11a6c50 Mon Sep 17 00:00:00 2001 From: Kelsey Skunberg Date: Sun, 21 Jul 2019 20:35:30 -0600 Subject: [PATCH 3/3] ACPI: thermal: Remove redundant acpi_has_method() calls The following acpi_has_method() calls are unnecessary since acpi_execute_simple_method() and acpi_evaluate_reference() will return an error if the given method does not exist. Remove acpi_has_method() calls to avoid additional work. Signed-off-by: Kelsey Skunberg [ rjw: Subject ] Signed-off-by: Rafael J. Wysocki --- drivers/acpi/thermal.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 00f12a86ecbd4..d831a61e0010e 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -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; } @@ -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);