diff options
-rw-r--r-- | drivers/acpi/acpi_configfs.c | 20 | ||||
-rw-r--r-- | drivers/acpi/acpi_dbg.c | 2 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbdata.c | 4 | ||||
-rw-r--r-- | drivers/acpi/button.c | 2 | ||||
-rw-r--r-- | drivers/acpi/ec.c | 2 | ||||
-rw-r--r-- | drivers/acpi/ioapic.c | 2 | ||||
-rw-r--r-- | drivers/acpi/pmic/intel_pmic_xpower.c | 21 |
7 files changed, 47 insertions, 6 deletions
diff --git a/drivers/acpi/acpi_configfs.c b/drivers/acpi/acpi_configfs.c index 146a77fb762d..853bc7fc673f 100644 --- a/drivers/acpi/acpi_configfs.c +++ b/drivers/acpi/acpi_configfs.c @@ -15,11 +15,15 @@ #include <linux/configfs.h> #include <linux/acpi.h> +#include "acpica/accommon.h" +#include "acpica/actables.h" + static struct config_group *acpi_table_group; struct acpi_table { struct config_item cfg; struct acpi_table_header *header; + u32 index; }; static ssize_t acpi_table_aml_write(struct config_item *cfg, @@ -52,7 +56,11 @@ static ssize_t acpi_table_aml_write(struct config_item *cfg, if (!table->header) return -ENOMEM; - ret = acpi_load_table(table->header); + ACPI_INFO(("Host-directed Dynamic ACPI Table Load:")); + ret = acpi_tb_install_and_load_table( + ACPI_PTR_TO_PHYSADDR(table->header), + ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, FALSE, + &table->index); if (ret) { kfree(table->header); table->header = NULL; @@ -215,8 +223,18 @@ static struct config_item *acpi_table_make_item(struct config_group *group, return &table->cfg; } +static void acpi_table_drop_item(struct config_group *group, + struct config_item *cfg) +{ + struct acpi_table *table = container_of(cfg, struct acpi_table, cfg); + + ACPI_INFO(("Host-directed Dynamic ACPI Table Unload")); + acpi_tb_unload_table(table->index); +} + struct configfs_group_operations acpi_table_group_ops = { .make_item = acpi_table_make_item, + .drop_item = acpi_table_drop_item, }; static struct config_item_type acpi_tables_type = { diff --git a/drivers/acpi/acpi_dbg.c b/drivers/acpi/acpi_dbg.c index dee86925a9a1..3ec05aa1a903 100644 --- a/drivers/acpi/acpi_dbg.c +++ b/drivers/acpi/acpi_dbg.c @@ -10,7 +10,7 @@ */ /* #define DEBUG */ -#define pr_fmt(fmt) "ACPI : AML: " fmt +#define pr_fmt(fmt) "ACPI: AML: " fmt #include <linux/kernel.h> #include <linux/module.h> diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c index 27c5c27d4818..c9d6fa6d7cc6 100644 --- a/drivers/acpi/acpica/tbdata.c +++ b/drivers/acpi/acpica/tbdata.c @@ -867,6 +867,8 @@ exit: return_ACPI_STATUS(status); } +ACPI_EXPORT_SYMBOL(acpi_tb_install_and_load_table) + /******************************************************************************* * * FUNCTION: acpi_tb_unload_table @@ -914,3 +916,5 @@ acpi_status acpi_tb_unload_table(u32 table_index) acpi_tb_set_table_loaded_flag(table_index, FALSE); return_ACPI_STATUS(status); } + +ACPI_EXPORT_SYMBOL(acpi_tb_unload_table) diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index e19f530f1083..34e07d6f65ad 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -19,7 +19,7 @@ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -#define pr_fmt(fmt) "ACPI : button: " fmt +#define pr_fmt(fmt) "ACPI: button: " fmt #include <linux/kernel.h> #include <linux/module.h> diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index c24235d8fb52..01e6e392f2ad 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -27,7 +27,7 @@ /* Uncomment next line to get verbose printout */ /* #define DEBUG */ -#define pr_fmt(fmt) "ACPI : EC: " fmt +#define pr_fmt(fmt) "ACPI: EC: " fmt #include <linux/kernel.h> #include <linux/module.h> diff --git a/drivers/acpi/ioapic.c b/drivers/acpi/ioapic.c index 7e4fbf9a53a3..3595aa9c7c18 100644 --- a/drivers/acpi/ioapic.c +++ b/drivers/acpi/ioapic.c @@ -21,7 +21,7 @@ * registered when we parsed the ACPI MADT. */ -#define pr_fmt(fmt) "ACPI : IOAPIC: " fmt +#define pr_fmt(fmt) "ACPI: IOAPIC: " fmt #include <linux/slab.h> #include <linux/acpi.h> diff --git a/drivers/acpi/pmic/intel_pmic_xpower.c b/drivers/acpi/pmic/intel_pmic_xpower.c index 1a76c784cd4c..3b7d5be5b7ed 100644 --- a/drivers/acpi/pmic/intel_pmic_xpower.c +++ b/drivers/acpi/pmic/intel_pmic_xpower.c @@ -21,6 +21,11 @@ #include "intel_pmic.h" #define XPOWER_GPADC_LOW 0x5b +#define XPOWER_GPI1_CTRL 0x92 + +#define GPI1_LDO_MASK GENMASK(2, 0) +#define GPI1_LDO_ON (3 << 0) +#define GPI1_LDO_OFF (4 << 0) static struct pmic_table power_table[] = { { @@ -118,6 +123,10 @@ static struct pmic_table power_table[] = { .reg = 0x10, .bit = 0x00 }, /* BUC6 */ + { + .address = 0x4c, + .reg = 0x92, + }, /* GPI1 */ }; /* TMP0 - TMP5 are the same, all from GPADC */ @@ -156,7 +165,12 @@ static int intel_xpower_pmic_get_power(struct regmap *regmap, int reg, if (regmap_read(regmap, reg, &data)) return -EIO; - *value = (data & BIT(bit)) ? 1 : 0; + /* GPIO1 LDO regulator needs special handling */ + if (reg == XPOWER_GPI1_CTRL) + *value = ((data & GPI1_LDO_MASK) == GPI1_LDO_ON); + else + *value = (data & BIT(bit)) ? 1 : 0; + return 0; } @@ -165,6 +179,11 @@ static int intel_xpower_pmic_update_power(struct regmap *regmap, int reg, { int data; + /* GPIO1 LDO regulator needs special handling */ + if (reg == XPOWER_GPI1_CTRL) + return regmap_update_bits(regmap, reg, GPI1_LDO_MASK, + on ? GPI1_LDO_ON : GPI1_LDO_OFF); + if (regmap_read(regmap, reg, &data)) return -EIO; |