Skip to content

Commit

Permalink
Merge tag 'acpi-extra-4.12-rc1' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/kernel/git/rafael/linux-pm

Pull more ACPI updates from Rafael Wysocki:
 "These update the ACPICA code in the kernel to upstream revision
  20170303 which adds a few minor fixes and improvements, update ACPI
  SoC drivers with new device IDs, platform-related information and
  similar, fix the register information in the xpower PMIC driver,
  introduce a concept of "always present" devices to the ACPI device
  enumeration code and use it to fix a problem with one platform, and
  fix a system resume issue related to power resources.

  Specifics:

   - Update the ACPICA code in the kernel to upstream revision 20170303
     which includes:
      * Minor fixes and improvements in the core code (Bob Moore,
        Seunghun Han).
      * Debugger fixes (Colin Ian King, Lv Zheng).
      * Compiler/disassembler improvements (Bob Moore, David Box, Lv
        Zheng).
      * Build-related update (Lv Zheng).

   - Add new device IDs and platform-related information to the ACPI
     drivers for Intel (LPSS) and AMD (APD) SoCs (Hanjun Guo, Hans de
     Goede).

   - Make it possible to quirk ACPI-enumerated devices as "always
     present" on platforms where they are incorrectly reported as not
     present by the AML and add the INT0002 device ID to the list of
     "always present" devices (Hans de Goede).

   - Fix the register information in the xpower PMIC driver and add
     comments to map the registers to symbols used by AML to it (Hans de
     Goede).

   - Move the code turning off unused ACPI power resources during system
     resume to a point after all devices have been resumed to avoid
     issues with power resources that do not behave as expected (Hans de
     Goede)"

* tag 'acpi-extra-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (22 commits)
  ACPI / power: Delay turning off unused power resources after suspend
  ACPI / PMIC: xpower: Fix power_table addresses
  ACPI / LPSS: Call pwm_add_table() for Bay Trail PWM device
  ACPICA: Update version to 20170303
  ACPICA: iasl: add ASL conversion tool
  ACPICA: Local cache support: Allow small cache objects
  ACPICA: Disassembler: Do not unconditionally remove temporary names
  ACPICA: iasl: Fix IORT SMMU GSI disassembling
  ACPICA: Cleanup AML opcode definitions, no functional change
  ACPICA: Debugger: Add interpreter blocking mark for single-step mode
  ACPICA: debugger: fix memory leak on Pathname
  ACPICA: Update for automatic repair code for objects returned by evaluate_object
  ACPICA: Namespace: fix operand cache leak
  ACPICA: Fix several incorrect invocations of ACPICA return macro
  ACPICA: Fix a module for excessive debug output
  ACPICA: Update some function headers, no funtional change
  ACPICA: Disassembler: Enhance resource descriptor detection
  i2c: designware: Add ACPI HID for Hisilicon Hip07/08 I2C controller
  ACPI / APD: Add clock frequency for Hisilicon Hip07/08 I2C controller
  ACPI / bus: Add INT0002 to list of always-present devices
  ...
  • Loading branch information
torvalds committed May 10, 2017
2 parents 2e4ab93 + 46436eb commit dc9edaa
Show file tree
Hide file tree
Showing 56 changed files with 833 additions and 221 deletions.
1 change: 1 addition & 0 deletions drivers/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ acpi-$(CONFIG_ACPI_REDUCED_HARDWARE_ONLY) += evged.o
acpi-y += sysfs.o
acpi-y += property.o
acpi-$(CONFIG_X86) += acpi_cmos_rtc.o
acpi-$(CONFIG_X86) += x86/utils.o
acpi-$(CONFIG_DEBUG_FS) += debugfs.o
acpi-$(CONFIG_ACPI_NUMA) += numa.o
acpi-$(CONFIG_ACPI_PROCFS_POWER) += cm_sbs.o
Expand Down
12 changes: 12 additions & 0 deletions drivers/acpi/acpi_apd.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ static const struct apd_device_desc vulcan_spi_desc = {
.setup = acpi_apd_setup,
.fixed_clk_rate = 133000000,
};

static const struct apd_device_desc hip07_i2c_desc = {
.setup = acpi_apd_setup,
.fixed_clk_rate = 200000000,
};

static const struct apd_device_desc hip08_i2c_desc = {
.setup = acpi_apd_setup,
.fixed_clk_rate = 250000000,
};
#endif

#else
Expand Down Expand Up @@ -170,6 +180,8 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
{ "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
{ "BRCM900D", APD_ADDR(vulcan_spi_desc) },
{ "CAV900D", APD_ADDR(vulcan_spi_desc) },
{ "HISI0A21", APD_ADDR(hip07_i2c_desc) },
{ "HISI0A22", APD_ADDR(hip08_i2c_desc) },
#endif
{ }
};
Expand Down
17 changes: 17 additions & 0 deletions drivers/acpi/acpi_lpss.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,22 @@ static void lpss_deassert_reset(struct lpss_private_data *pdata)
writel(val, pdata->mmio_base + offset);
}

/*
* BYT PWM used for backlight control by the i915 driver on systems without
* the Crystal Cove PMIC.
*/
static struct pwm_lookup byt_pwm_lookup[] = {
PWM_LOOKUP_WITH_MODULE("80860F09:00", 0, "0000:00:02.0",
"pwm_backlight", 0, PWM_POLARITY_NORMAL,
"pwm-lpss-platform"),
};

static void byt_pwm_setup(struct lpss_private_data *pdata)
{
if (!acpi_dev_present("INT33FD", NULL, -1))
pwm_add_table(byt_pwm_lookup, ARRAY_SIZE(byt_pwm_lookup));
}

#define LPSS_I2C_ENABLE 0x6c

static void byt_i2c_setup(struct lpss_private_data *pdata)
Expand Down Expand Up @@ -200,6 +216,7 @@ static const struct lpss_device_desc lpt_sdio_dev_desc = {

static const struct lpss_device_desc byt_pwm_dev_desc = {
.flags = LPSS_SAVE_CTX,
.setup = byt_pwm_setup,
};

static const struct lpss_device_desc bsw_pwm_dev_desc = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Makefile for ACPICA Core interpreter
#

ccflags-y := -Os -DBUILDING_ACPICA
ccflags-y := -Os -D_LINUX -DBUILDING_ACPICA
ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT

# use acpi.o to put all files here into acpi.o modparam namespace
Expand Down
144 changes: 144 additions & 0 deletions drivers/acpi/acpica/acconvert.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
/******************************************************************************
*
* Module Name: acapps - common include for ACPI applications/tools
*
*****************************************************************************/

/*
* Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/

#ifndef _ACCONVERT
#define _ACCONVERT

/* Definitions for comment state */

#define ASL_COMMENT_STANDARD 1
#define ASLCOMMENT_INLINE 2
#define ASL_COMMENT_OPEN_PAREN 3
#define ASL_COMMENT_CLOSE_PAREN 4
#define ASL_COMMENT_CLOSE_BRACE 5

/* Definitions for comment print function*/

#define AML_COMMENT_STANDARD 1
#define AMLCOMMENT_INLINE 2
#define AML_COMMENT_END_NODE 3
#define AML_NAMECOMMENT 4
#define AML_COMMENT_CLOSE_BRACE 5
#define AML_COMMENT_ENDBLK 6
#define AML_COMMENT_INCLUDE 7

#ifdef ACPI_ASL_COMPILER
/*
* cvcompiler
*/
void
cv_process_comment(struct asl_comment_state current_state,
char *string_buffer, int c1);

void
cv_process_comment_type2(struct asl_comment_state current_state,
char *string_buffer);

u32 cv_calculate_comment_lengths(union acpi_parse_object *op);

void cv_process_comment_state(char input);

char *cv_append_inline_comment(char *inline_comment, char *to_add);

void cv_add_to_comment_list(char *to_add);

void cv_place_comment(u8 type, char *comment_string);

u32 cv_parse_op_block_type(union acpi_parse_object *op);

struct acpi_comment_node *cv_comment_node_calloc(void);

void cg_write_aml_def_block_comment(union acpi_parse_object *op);

void
cg_write_one_aml_comment(union acpi_parse_object *op,
char *comment_to_print, u8 input_option);

void cg_write_aml_comment(union acpi_parse_object *op);

/*
* cvparser
*/
void
cv_init_file_tree(struct acpi_table_header *table,
u8 *aml_start, u32 aml_length);

void cv_clear_op_comments(union acpi_parse_object *op);

struct acpi_file_node *cv_filename_exists(char *filename,
struct acpi_file_node *head);

void cv_label_file_node(union acpi_parse_object *op);

void
cv_capture_list_comments(struct acpi_parse_state *parser_state,
struct acpi_comment_node *list_head,
struct acpi_comment_node *list_tail);

void cv_capture_comments_only(struct acpi_parse_state *parser_state);

void cv_capture_comments(struct acpi_walk_state *walk_state);

void cv_transfer_comments(union acpi_parse_object *op);

/*
* cvdisasm
*/
void cv_switch_files(u32 level, union acpi_parse_object *op);

u8 cv_file_has_switched(union acpi_parse_object *op);

void cv_close_paren_write_comment(union acpi_parse_object *op, u32 level);

void cv_close_brace_write_comment(union acpi_parse_object *op, u32 level);

void
cv_print_one_comment_list(struct acpi_comment_node *comment_list, u32 level);

void
cv_print_one_comment_type(union acpi_parse_object *op,
u8 comment_type, char *end_str, u32 level);

#endif

#endif /* _ACCONVERT */
53 changes: 53 additions & 0 deletions drivers/acpi/acpica/acglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,59 @@ ACPI_GLOBAL(const char, *acpi_gbl_pld_shape_list[]);

#endif

/*
* Meant for the -ca option.
*/
ACPI_INIT_GLOBAL(char *, acpi_gbl_current_inline_comment, NULL);
ACPI_INIT_GLOBAL(char *, acpi_gbl_current_end_node_comment, NULL);
ACPI_INIT_GLOBAL(char *, acpi_gbl_current_open_brace_comment, NULL);
ACPI_INIT_GLOBAL(char *, acpi_gbl_current_close_brace_comment, NULL);

ACPI_INIT_GLOBAL(char *, acpi_gbl_root_filename, NULL);
ACPI_INIT_GLOBAL(char *, acpi_gbl_current_filename, NULL);
ACPI_INIT_GLOBAL(char *, acpi_gbl_current_parent_filename, NULL);
ACPI_INIT_GLOBAL(char *, acpi_gbl_current_include_filename, NULL);

ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_last_list_head, NULL);

ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_def_blk_comment_list_head,
NULL);
ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_def_blk_comment_list_tail,
NULL);

ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_reg_comment_list_head,
NULL);
ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_reg_comment_list_tail,
NULL);

ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_inc_comment_list_head,
NULL);
ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_inc_comment_list_tail,
NULL);

ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_end_blk_comment_list_head,
NULL);
ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_end_blk_comment_list_tail,
NULL);

ACPI_INIT_GLOBAL(struct acpi_comment_addr_node,
*acpi_gbl_comment_addr_list_head, NULL);

ACPI_INIT_GLOBAL(union acpi_parse_object, *acpi_gbl_current_scope, NULL);

ACPI_INIT_GLOBAL(struct acpi_file_node, *acpi_gbl_file_tree_root, NULL);

ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_reg_comment_cache);
ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_comment_addr_cache);
ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_file_cache);

ACPI_INIT_GLOBAL(u8, gbl_capture_comments, FALSE);

ACPI_INIT_GLOBAL(u8, acpi_gbl_debug_asl_conversion, FALSE);
ACPI_INIT_GLOBAL(ACPI_FILE, acpi_gbl_conv_debug_file, NULL);

ACPI_GLOBAL(char, acpi_gbl_table_sig[4]);

/*****************************************************************************
*
* Application globals
Expand Down
Loading

0 comments on commit dc9edaa

Please sign in to comment.