Commit ca11abf1 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branches 'acpi-tables', 'acpi-button', 'acpi-ec', 'acpi-doc' and 'acpi-tools'

* acpi-tables:
  ACPI: PPTT: Consistently use unsigned int as parameter type

* acpi-button:
  ACPI: button: Add DMI quirk for Razer Blade Stealth 13 late 2019 lid switch

* acpi-ec:
  ACPI: EC: Reference count query handlers under lock

* acpi-doc:
  docs: firmware-guide: ACPI: Replace dma_request_slave_channel() with dma_request_chan()

* acpi-tools:
  tools/power/acpi: fix compilation error
...@@ -71,8 +71,8 @@ DMA support ...@@ -71,8 +71,8 @@ DMA support
DMA controllers enumerated via ACPI should be registered in the system to DMA controllers enumerated via ACPI should be registered in the system to
provide generic access to their resources. For example, a driver that would provide generic access to their resources. For example, a driver that would
like to be accessible to slave devices via generic API call like to be accessible to slave devices via generic API call
dma_request_slave_channel() must register itself at the end of the probe dma_request_chan() must register itself at the end of the probe function like
function like this:: this::
err = devm_acpi_dma_controller_register(dev, xlate_func, dw); err = devm_acpi_dma_controller_register(dev, xlate_func, dw);
/* Handle the error if it's not a case of !CONFIG_ACPI */ /* Handle the error if it's not a case of !CONFIG_ACPI */
...@@ -112,15 +112,15 @@ could look like:: ...@@ -112,15 +112,15 @@ could look like::
} }
#endif #endif
dma_request_slave_channel() will call xlate_func() for each registered DMA dma_request_chan() will call xlate_func() for each registered DMA controller.
controller. In the xlate function the proper channel must be chosen based on In the xlate function the proper channel must be chosen based on
information in struct acpi_dma_spec and the properties of the controller information in struct acpi_dma_spec and the properties of the controller
provided by struct acpi_dma. provided by struct acpi_dma.
Clients must call dma_request_slave_channel() with the string parameter that Clients must call dma_request_chan() with the string parameter that corresponds
corresponds to a specific FixedDMA resource. By default "tx" means the first to a specific FixedDMA resource. By default "tx" means the first entry of the
entry of the FixedDMA resource array, "rx" means the second entry. The table FixedDMA resource array, "rx" means the second entry. The table below shows a
below shows a layout:: layout::
Device (I2C0) Device (I2C0)
{ {
......
...@@ -122,6 +122,17 @@ static const struct dmi_system_id dmi_lid_quirks[] = { ...@@ -122,6 +122,17 @@ static const struct dmi_system_id dmi_lid_quirks[] = {
}, },
.driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN, .driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN,
}, },
{
/*
* Razer Blade Stealth 13 late 2019, notification of the LID device
* only happens on close, not on open and _LID always returns closed.
*/
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Razer"),
DMI_MATCH(DMI_PRODUCT_NAME, "Razer Blade Stealth 13 Late 2019"),
},
.driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN,
},
{} {}
}; };
......
...@@ -1052,29 +1052,21 @@ void acpi_ec_unblock_transactions(void) ...@@ -1052,29 +1052,21 @@ void acpi_ec_unblock_transactions(void)
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Event Management Event Management
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static struct acpi_ec_query_handler *
acpi_ec_get_query_handler(struct acpi_ec_query_handler *handler)
{
if (handler)
kref_get(&handler->kref);
return handler;
}
static struct acpi_ec_query_handler * static struct acpi_ec_query_handler *
acpi_ec_get_query_handler_by_value(struct acpi_ec *ec, u8 value) acpi_ec_get_query_handler_by_value(struct acpi_ec *ec, u8 value)
{ {
struct acpi_ec_query_handler *handler; struct acpi_ec_query_handler *handler;
bool found = false;
mutex_lock(&ec->mutex); mutex_lock(&ec->mutex);
list_for_each_entry(handler, &ec->list, node) { list_for_each_entry(handler, &ec->list, node) {
if (value == handler->query_bit) { if (value == handler->query_bit) {
found = true; kref_get(&handler->kref);
break; mutex_unlock(&ec->mutex);
return handler;
} }
} }
mutex_unlock(&ec->mutex); mutex_unlock(&ec->mutex);
return found ? acpi_ec_get_query_handler(handler) : NULL; return NULL;
} }
static void acpi_ec_query_handler_release(struct kref *kref) static void acpi_ec_query_handler_release(struct kref *kref)
......
...@@ -98,11 +98,11 @@ static inline bool acpi_pptt_match_type(int table_type, int type) ...@@ -98,11 +98,11 @@ static inline bool acpi_pptt_match_type(int table_type, int type)
* *
* Return: The cache structure and the level we terminated with. * Return: The cache structure and the level we terminated with.
*/ */
static int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr, static unsigned int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr,
int local_level, unsigned int local_level,
struct acpi_subtable_header *res, struct acpi_subtable_header *res,
struct acpi_pptt_cache **found, struct acpi_pptt_cache **found,
int level, int type) unsigned int level, int type)
{ {
struct acpi_pptt_cache *cache; struct acpi_pptt_cache *cache;
...@@ -119,7 +119,7 @@ static int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr, ...@@ -119,7 +119,7 @@ static int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr,
if (*found != NULL && cache != *found) if (*found != NULL && cache != *found)
pr_warn("Found duplicate cache level/type unable to determine uniqueness\n"); pr_warn("Found duplicate cache level/type unable to determine uniqueness\n");
pr_debug("Found cache @ level %d\n", level); pr_debug("Found cache @ level %u\n", level);
*found = cache; *found = cache;
/* /*
* continue looking at this node's resource list * continue looking at this node's resource list
...@@ -132,16 +132,17 @@ static int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr, ...@@ -132,16 +132,17 @@ static int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr,
return local_level; return local_level;
} }
static struct acpi_pptt_cache *acpi_find_cache_level(struct acpi_table_header *table_hdr, static struct acpi_pptt_cache *
acpi_find_cache_level(struct acpi_table_header *table_hdr,
struct acpi_pptt_processor *cpu_node, struct acpi_pptt_processor *cpu_node,
int *starting_level, int level, unsigned int *starting_level, unsigned int level,
int type) int type)
{ {
struct acpi_subtable_header *res; struct acpi_subtable_header *res;
int number_of_levels = *starting_level; unsigned int number_of_levels = *starting_level;
int resource = 0; int resource = 0;
struct acpi_pptt_cache *ret = NULL; struct acpi_pptt_cache *ret = NULL;
int local_level; unsigned int local_level;
/* walk down from processor node */ /* walk down from processor node */
while ((res = acpi_get_pptt_resource(table_hdr, cpu_node, resource))) { while ((res = acpi_get_pptt_resource(table_hdr, cpu_node, resource))) {
...@@ -321,12 +322,12 @@ static struct acpi_pptt_cache *acpi_find_cache_node(struct acpi_table_header *ta ...@@ -321,12 +322,12 @@ static struct acpi_pptt_cache *acpi_find_cache_node(struct acpi_table_header *ta
unsigned int level, unsigned int level,
struct acpi_pptt_processor **node) struct acpi_pptt_processor **node)
{ {
int total_levels = 0; unsigned int total_levels = 0;
struct acpi_pptt_cache *found = NULL; struct acpi_pptt_cache *found = NULL;
struct acpi_pptt_processor *cpu_node; struct acpi_pptt_processor *cpu_node;
u8 acpi_type = acpi_cache_type(type); u8 acpi_type = acpi_cache_type(type);
pr_debug("Looking for CPU %d's level %d cache type %d\n", pr_debug("Looking for CPU %d's level %u cache type %d\n",
acpi_cpu_id, level, acpi_type); acpi_cpu_id, level, acpi_type);
cpu_node = acpi_find_processor_node(table_hdr, acpi_cpu_id); cpu_node = acpi_find_processor_node(table_hdr, acpi_cpu_id);
......
...@@ -15,7 +15,7 @@ include $(srctree)/../../scripts/Makefile.include ...@@ -15,7 +15,7 @@ include $(srctree)/../../scripts/Makefile.include
OUTPUT=$(srctree)/ OUTPUT=$(srctree)/
ifeq ("$(origin O)", "command line") ifeq ("$(origin O)", "command line")
OUTPUT := $(O)/power/acpi/ OUTPUT := $(O)/tools/power/acpi/
endif endif
#$(info Determined 'OUTPUT' to be $(OUTPUT)) #$(info Determined 'OUTPUT' to be $(OUTPUT))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment