From 5f155515d37351f90dbb1c8a5a5cae13190c8564 Mon Sep 17 00:00:00 2001 From: Wang Qing Date: Thu, 13 Aug 2020 10:49:10 +0800 Subject: [PATCH 01/10] ACPI: NFIT: Use kobj_to_dev() instead Use kobj_to_dev() instead of container_of() Signed-off-by: Wang Qing Acked-by: Vishal Verma [ rjw: Subject edits ] Signed-off-by: Rafael J. Wysocki --- drivers/acpi/nfit/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 26dd208a0d63..1904ae88a11c 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -1389,7 +1389,7 @@ static bool ars_supported(struct nvdimm_bus *nvdimm_bus) static umode_t nfit_visible(struct kobject *kobj, struct attribute *a, int n) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct nvdimm_bus *nvdimm_bus = to_nvdimm_bus(dev); if (a == &dev_attr_scrub.attr) @@ -1679,7 +1679,7 @@ static struct attribute *acpi_nfit_dimm_attributes[] = { static umode_t acpi_nfit_dimm_attr_visible(struct kobject *kobj, struct attribute *a, int n) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct nvdimm *nvdimm = to_nvdimm(dev); struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); From fa870509d9ecd408714d8888568ccc9f2c52af2a Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Fri, 14 Aug 2020 16:27:25 +0300 Subject: [PATCH 02/10] ACPI / PMIC: Split out Kconfig and Makefile specific for ACPI PMIC It's a bit better to maintain and allows to avoid mistakes in the future with PMIC OpRegion drivers, if we split out Kconfig and Makefile for ACPI PMIC to its own folder. Signed-off-by: Andy Shevchenko Reviewed-by: Mika Westerberg Signed-off-by: Rafael J. Wysocki --- drivers/acpi/Kconfig | 51 ++------------------------------------ drivers/acpi/Makefile | 9 +------ drivers/acpi/pmic/Kconfig | 51 ++++++++++++++++++++++++++++++++++++++ drivers/acpi/pmic/Makefile | 9 +++++++ 4 files changed, 63 insertions(+), 57 deletions(-) create mode 100644 drivers/acpi/pmic/Kconfig create mode 100644 drivers/acpi/pmic/Makefile diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 7540a5179a47..6fb9453396dc 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -504,55 +504,6 @@ config ACPI_EXTLOG config ACPI_ADXL bool -menuconfig PMIC_OPREGION - bool "PMIC (Power Management Integrated Circuit) operation region support" - help - Select this option to enable support for ACPI operation - region of the PMIC chip. The operation region can be used - to control power rails and sensor reading/writing on the - PMIC chip. - -if PMIC_OPREGION -config BYTCRC_PMIC_OPREGION - bool "ACPI operation region support for Bay Trail Crystal Cove PMIC" - depends on INTEL_SOC_PMIC - help - This config adds ACPI operation region support for the Bay Trail - version of the Crystal Cove PMIC. - -config CHTCRC_PMIC_OPREGION - bool "ACPI operation region support for Cherry Trail Crystal Cove PMIC" - depends on INTEL_SOC_PMIC - help - This config adds ACPI operation region support for the Cherry Trail - version of the Crystal Cove PMIC. - -config XPOWER_PMIC_OPREGION - bool "ACPI operation region support for XPower AXP288 PMIC" - depends on MFD_AXP20X_I2C && IOSF_MBI=y - help - This config adds ACPI operation region support for XPower AXP288 PMIC. - -config BXT_WC_PMIC_OPREGION - bool "ACPI operation region support for BXT WhiskeyCove PMIC" - depends on INTEL_SOC_PMIC_BXTWC - help - This config adds ACPI operation region support for BXT WhiskeyCove PMIC. - -config CHT_WC_PMIC_OPREGION - bool "ACPI operation region support for CHT Whiskey Cove PMIC" - depends on INTEL_SOC_PMIC_CHTWC - help - This config adds ACPI operation region support for CHT Whiskey Cove PMIC. - -config CHT_DC_TI_PMIC_OPREGION - bool "ACPI operation region support for Dollar Cove TI PMIC" - depends on INTEL_SOC_PMIC_CHTDC_TI - help - This config adds ACPI operation region support for Dollar Cove TI PMIC. - -endif - config ACPI_CONFIGFS tristate "ACPI configfs support" select CONFIGFS_FS @@ -568,6 +519,8 @@ config ACPI_PPTT bool endif +source "drivers/acpi/pmic/Kconfig" + config TPS68470_PMIC_OPREGION bool "ACPI operation region support for TPS68470 PMIC" depends on MFD_TPS68470 diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 9a957544e357..44929d248bfa 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -107,16 +107,9 @@ obj-$(CONFIG_ACPI_APEI) += apei/ obj-$(CONFIG_ACPI_EXTLOG) += acpi_extlog.o -obj-$(CONFIG_PMIC_OPREGION) += pmic/intel_pmic.o -obj-$(CONFIG_BYTCRC_PMIC_OPREGION) += pmic/intel_pmic_bytcrc.o -obj-$(CONFIG_CHTCRC_PMIC_OPREGION) += pmic/intel_pmic_chtcrc.o -obj-$(CONFIG_XPOWER_PMIC_OPREGION) += pmic/intel_pmic_xpower.o -obj-$(CONFIG_BXT_WC_PMIC_OPREGION) += pmic/intel_pmic_bxtwc.o -obj-$(CONFIG_CHT_WC_PMIC_OPREGION) += pmic/intel_pmic_chtwc.o -obj-$(CONFIG_CHT_DC_TI_PMIC_OPREGION) += pmic/intel_pmic_chtdc_ti.o - obj-$(CONFIG_ACPI_CONFIGFS) += acpi_configfs.o +obj-y += pmic/ obj-$(CONFIG_TPS68470_PMIC_OPREGION) += pmic/tps68470_pmic.o video-objs += acpi_video.o video_detect.o diff --git a/drivers/acpi/pmic/Kconfig b/drivers/acpi/pmic/Kconfig new file mode 100644 index 000000000000..357d1a846e68 --- /dev/null +++ b/drivers/acpi/pmic/Kconfig @@ -0,0 +1,51 @@ +# SPDX-License-Identifier: GPL-2.0 + +menuconfig PMIC_OPREGION + bool "PMIC (Power Management Integrated Circuit) operation region support" + help + Select this option to enable support for ACPI operation + region of the PMIC chip. The operation region can be used + to control power rails and sensor reading/writing on the + PMIC chip. + +if PMIC_OPREGION + +config BYTCRC_PMIC_OPREGION + bool "ACPI operation region support for Bay Trail Crystal Cove PMIC" + depends on INTEL_SOC_PMIC + help + This config adds ACPI operation region support for the Bay Trail + version of the Crystal Cove PMIC. + +config CHTCRC_PMIC_OPREGION + bool "ACPI operation region support for Cherry Trail Crystal Cove PMIC" + depends on INTEL_SOC_PMIC + help + This config adds ACPI operation region support for the Cherry Trail + version of the Crystal Cove PMIC. + +config XPOWER_PMIC_OPREGION + bool "ACPI operation region support for XPower AXP288 PMIC" + depends on MFD_AXP20X_I2C && IOSF_MBI=y + help + This config adds ACPI operation region support for XPower AXP288 PMIC. + +config BXT_WC_PMIC_OPREGION + bool "ACPI operation region support for BXT WhiskeyCove PMIC" + depends on INTEL_SOC_PMIC_BXTWC + help + This config adds ACPI operation region support for BXT WhiskeyCove PMIC. + +config CHT_WC_PMIC_OPREGION + bool "ACPI operation region support for CHT Whiskey Cove PMIC" + depends on INTEL_SOC_PMIC_CHTWC + help + This config adds ACPI operation region support for CHT Whiskey Cove PMIC. + +config CHT_DC_TI_PMIC_OPREGION + bool "ACPI operation region support for Dollar Cove TI PMIC" + depends on INTEL_SOC_PMIC_CHTDC_TI + help + This config adds ACPI operation region support for Dollar Cove TI PMIC. + +endif # PMIC_OPREGION diff --git a/drivers/acpi/pmic/Makefile b/drivers/acpi/pmic/Makefile new file mode 100644 index 000000000000..773c267420bc --- /dev/null +++ b/drivers/acpi/pmic/Makefile @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-$(CONFIG_PMIC_OPREGION) += intel_pmic.o +obj-$(CONFIG_BYTCRC_PMIC_OPREGION) += intel_pmic_bytcrc.o +obj-$(CONFIG_CHTCRC_PMIC_OPREGION) += intel_pmic_chtcrc.o +obj-$(CONFIG_XPOWER_PMIC_OPREGION) += intel_pmic_xpower.o +obj-$(CONFIG_BXT_WC_PMIC_OPREGION) += intel_pmic_bxtwc.o +obj-$(CONFIG_CHT_WC_PMIC_OPREGION) += intel_pmic_chtwc.o +obj-$(CONFIG_CHT_DC_TI_PMIC_OPREGION) += intel_pmic_chtdc_ti.o From e410c43b66d52dde6a4b8554dc85a9dc06e57937 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Fri, 14 Aug 2020 16:27:26 +0300 Subject: [PATCH 03/10] ACPI / PMIC: Move TPS68470 OpRegion driver to drivers/acpi/pmic/ It is revealed now that TPS68470 OpRegion driver has been added in slightly different scope. Let's move it to the drivers/acpi/pmic/ folder for sake of the unification. Signed-off-by: Andy Shevchenko Reviewed-by: Mika Westerberg Signed-off-by: Rafael J. Wysocki --- drivers/acpi/Kconfig | 16 ---------------- drivers/acpi/Makefile | 1 - drivers/acpi/pmic/Kconfig | 16 ++++++++++++++++ drivers/acpi/pmic/Makefile | 1 + 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 6fb9453396dc..edf1558c1105 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -521,22 +521,6 @@ endif source "drivers/acpi/pmic/Kconfig" -config TPS68470_PMIC_OPREGION - bool "ACPI operation region support for TPS68470 PMIC" - depends on MFD_TPS68470 - help - This config adds ACPI operation region support for TI TPS68470 PMIC. - TPS68470 device is an advanced power management unit that powers - a Compact Camera Module (CCM), generates clocks for image sensors, - drives a dual LED for flash and incorporates two LED drivers for - general purpose indicators. - This driver enables ACPI operation region support control voltage - regulators and clocks. - - This option is a bool as it provides an ACPI operation - region, which must be available before any of the devices - using this, are probed. - endif # ACPI config X86_PM_TIMER diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 44929d248bfa..44e412506317 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -110,7 +110,6 @@ obj-$(CONFIG_ACPI_EXTLOG) += acpi_extlog.o obj-$(CONFIG_ACPI_CONFIGFS) += acpi_configfs.o obj-y += pmic/ -obj-$(CONFIG_TPS68470_PMIC_OPREGION) += pmic/tps68470_pmic.o video-objs += acpi_video.o video_detect.o obj-y += dptf/ diff --git a/drivers/acpi/pmic/Kconfig b/drivers/acpi/pmic/Kconfig index 357d1a846e68..56bbcb2ce61b 100644 --- a/drivers/acpi/pmic/Kconfig +++ b/drivers/acpi/pmic/Kconfig @@ -49,3 +49,19 @@ config CHT_DC_TI_PMIC_OPREGION This config adds ACPI operation region support for Dollar Cove TI PMIC. endif # PMIC_OPREGION + +config TPS68470_PMIC_OPREGION + bool "ACPI operation region support for TPS68470 PMIC" + depends on MFD_TPS68470 + help + This config adds ACPI operation region support for TI TPS68470 PMIC. + TPS68470 device is an advanced power management unit that powers + a Compact Camera Module (CCM), generates clocks for image sensors, + drives a dual LED for flash and incorporates two LED drivers for + general purpose indicators. + This driver enables ACPI operation region support control voltage + regulators and clocks. + + This option is a bool as it provides an ACPI operation + region, which must be available before any of the devices + using this, are probed. diff --git a/drivers/acpi/pmic/Makefile b/drivers/acpi/pmic/Makefile index 773c267420bc..cd072c64920c 100644 --- a/drivers/acpi/pmic/Makefile +++ b/drivers/acpi/pmic/Makefile @@ -7,3 +7,4 @@ obj-$(CONFIG_XPOWER_PMIC_OPREGION) += intel_pmic_xpower.o obj-$(CONFIG_BXT_WC_PMIC_OPREGION) += intel_pmic_bxtwc.o obj-$(CONFIG_CHT_WC_PMIC_OPREGION) += intel_pmic_chtwc.o obj-$(CONFIG_CHT_DC_TI_PMIC_OPREGION) += intel_pmic_chtdc_ti.o +obj-$(CONFIG_TPS68470_PMIC_OPREGION) += tps68470_pmic.o From 2ce6324eadb014136a4baaf7a174f47d771364a0 Mon Sep 17 00:00:00 2001 From: Srinivas Pandruvada Date: Tue, 15 Sep 2020 16:18:14 -0700 Subject: [PATCH 04/10] ACPI: DPTF: Add PCH FIVR participant driver This driver adds support for Dynamic Platform and Thermal Framework (DPTF) PCH (Platform Controller Hub) FIVR (Fully Integrated Voltage Regulator) participant support. This participant is responsible for exposing platform telemetry and control for: freq_mhz_high_clock freq_mhz_low_clock These attributes are used to get and set PCH FIVR switching frequency for thermal and radio frequency interference mitigation. Refer to Documentation/ABI/testing/sysfs-platform-dptf for ABI details. ACPI methods description used in this driver: RFC0: This ACPI method to set PCH FIVR switching frequency when FIVR clock is 19.2MHz or 24MHz. The ACPI method takes a DWORD value. GFC0: This ACPI method to get PCH FIVR switching frequency when FIVR clock is 19.2MHz or 24MHz. RFC1: This ACPI method to set PCH FIVR switching frequency when FIVR clock is 38.4MHz. The ACPI method takes a DWORD value. GFC1: This ACPI method to get PCH FIVR switching frequency when FIVR clock is 38.4MHz. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki --- Documentation/ABI/testing/sysfs-platform-dptf | 16 +++ drivers/acpi/dptf/Kconfig | 14 ++ drivers/acpi/dptf/Makefile | 1 + drivers/acpi/dptf/dptf_pch_fivr.c | 126 ++++++++++++++++++ drivers/acpi/dptf/int340x_thermal.c | 1 + 5 files changed, 158 insertions(+) create mode 100644 drivers/acpi/dptf/dptf_pch_fivr.c diff --git a/Documentation/ABI/testing/sysfs-platform-dptf b/Documentation/ABI/testing/sysfs-platform-dptf index eeed81ca6949..2cbc660d163b 100644 --- a/Documentation/ABI/testing/sysfs-platform-dptf +++ b/Documentation/ABI/testing/sysfs-platform-dptf @@ -92,3 +92,19 @@ Contact: linux-acpi@vger.kernel.org Description: (RO) The battery discharge current capability obtained from battery fuel gauge in milli Amps. + +What: /sys/bus/platform/devices/INTC1045:00/pch_fivr_switch_frequency/freq_mhz_low_clock +Date: November, 2020 +KernelVersion: v5.10 +Contact: linux-acpi@vger.kernel.org +Description: + (RW) The PCH FIVR (Fully Integrated Voltage Regulator) switching frequency in MHz, + when FIVR clock is 19.2MHz or 24MHz. + +What: /sys/bus/platform/devices/INTC1045:00/pch_fivr_switch_frequency/freq_mhz_high_clock +Date: November, 2020 +KernelVersion: v5.10 +Contact: linux-acpi@vger.kernel.org +Description: + (RW) The PCH FIVR (Fully Integrated Voltage Regulator) switching frequency in MHz, + when FIVR clock is 38.4MHz. diff --git a/drivers/acpi/dptf/Kconfig b/drivers/acpi/dptf/Kconfig index 90a2fd979282..51f06f36cafa 100644 --- a/drivers/acpi/dptf/Kconfig +++ b/drivers/acpi/dptf/Kconfig @@ -14,3 +14,17 @@ config DPTF_POWER To compile this driver as a module, choose M here: the module will be called dptf_power. + +config DPTF_PCH_FIVR + tristate "DPTF PCH FIVR Participant" + depends on X86 + help + This driver adds support for Dynamic Platform and Thermal Framework + (DPTF) PCH FIVR Participant device support. This driver allows to + switch PCH FIVR (Fully Integrated Voltage Regulator) frequency. + This participant is responsible for exposing: + freq_mhz_low_clock + freq_mhz_high_clock + + To compile this driver as a module, choose M here: + the module will be called dptf_pch_fivr. diff --git a/drivers/acpi/dptf/Makefile b/drivers/acpi/dptf/Makefile index 1a9b0a2b25bf..297340682f66 100644 --- a/drivers/acpi/dptf/Makefile +++ b/drivers/acpi/dptf/Makefile @@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only obj-$(CONFIG_ACPI) += int340x_thermal.o obj-$(CONFIG_DPTF_POWER) += dptf_power.o +obj-$(CONFIG_DPTF_PCH_FIVR) += dptf_pch_fivr.o diff --git a/drivers/acpi/dptf/dptf_pch_fivr.c b/drivers/acpi/dptf/dptf_pch_fivr.c new file mode 100644 index 000000000000..4ab288827747 --- /dev/null +++ b/drivers/acpi/dptf/dptf_pch_fivr.c @@ -0,0 +1,126 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * dptf_pch_fivr: DPTF PCH FIVR Participant driver + * Copyright (c) 2020, Intel Corporation. + */ + +#include +#include +#include +#include + +/* + * Presentation of attributes which are defined for INT1045 + * They are: + * freq_mhz_low_clock : Set PCH FIVR switching freq for + * FIVR clock 19.2MHz and 24MHz + * freq_mhz_high_clock : Set PCH FIVR switching freq for + * FIVR clock 38.4MHz + */ +#define PCH_FIVR_SHOW(name, method) \ +static ssize_t name##_show(struct device *dev,\ + struct device_attribute *attr,\ + char *buf)\ +{\ + struct acpi_device *acpi_dev = dev_get_drvdata(dev);\ + unsigned long long val;\ + acpi_status status;\ +\ + status = acpi_evaluate_integer(acpi_dev->handle, #method,\ + NULL, &val);\ + if (ACPI_SUCCESS(status))\ + return sprintf(buf, "%d\n", (int)val);\ + else\ + return -EINVAL;\ +} + +#define PCH_FIVR_STORE(name, method) \ +static ssize_t name##_store(struct device *dev,\ + struct device_attribute *attr,\ + const char *buf, size_t count)\ +{\ + struct acpi_device *acpi_dev = dev_get_drvdata(dev);\ + acpi_status status;\ + u32 val;\ +\ + if (kstrtouint(buf, 0, &val) < 0)\ + return -EINVAL;\ +\ + status = acpi_execute_simple_method(acpi_dev->handle, #method, val);\ + if (ACPI_SUCCESS(status))\ + return count;\ +\ + return -EINVAL;\ +} + +PCH_FIVR_SHOW(freq_mhz_low_clock, GFC0) +PCH_FIVR_SHOW(freq_mhz_high_clock, GFC1) +PCH_FIVR_STORE(freq_mhz_low_clock, RFC0) +PCH_FIVR_STORE(freq_mhz_high_clock, RFC1) + +static DEVICE_ATTR_RW(freq_mhz_low_clock); +static DEVICE_ATTR_RW(freq_mhz_high_clock); + +static struct attribute *fivr_attrs[] = { + &dev_attr_freq_mhz_low_clock.attr, + &dev_attr_freq_mhz_high_clock.attr, + NULL +}; + +static const struct attribute_group pch_fivr_attribute_group = { + .attrs = fivr_attrs, + .name = "pch_fivr_switch_frequency" +}; + +static int pch_fivr_add(struct platform_device *pdev) +{ + struct acpi_device *acpi_dev; + unsigned long long ptype; + acpi_status status; + int result; + + acpi_dev = ACPI_COMPANION(&(pdev->dev)); + if (!acpi_dev) + return -ENODEV; + + status = acpi_evaluate_integer(acpi_dev->handle, "PTYP", NULL, &ptype); + if (ACPI_FAILURE(status) || ptype != 0x05) + return -ENODEV; + + result = sysfs_create_group(&pdev->dev.kobj, + &pch_fivr_attribute_group); + if (result) + return result; + + platform_set_drvdata(pdev, acpi_dev); + + return 0; +} + +static int pch_fivr_remove(struct platform_device *pdev) +{ + sysfs_remove_group(&pdev->dev.kobj, &pch_fivr_attribute_group); + + return 0; +} + +static const struct acpi_device_id pch_fivr_device_ids[] = { + {"INTC1045", 0}, + {"", 0}, +}; +MODULE_DEVICE_TABLE(acpi, pch_fivr_device_ids); + +static struct platform_driver pch_fivr_driver = { + .probe = pch_fivr_add, + .remove = pch_fivr_remove, + .driver = { + .name = "DPTF PCH FIVR", + .acpi_match_table = pch_fivr_device_ids, + }, +}; + +module_platform_driver(pch_fivr_driver); + +MODULE_AUTHOR("Srinivas Pandruvada "); +MODULE_LICENSE("GPL v2"); +MODULE_DESCRIPTION("ACPI DPTF PCH FIVR driver"); diff --git a/drivers/acpi/dptf/int340x_thermal.c b/drivers/acpi/dptf/int340x_thermal.c index bc71a6a60334..8d420c7e7178 100644 --- a/drivers/acpi/dptf/int340x_thermal.c +++ b/drivers/acpi/dptf/int340x_thermal.c @@ -27,6 +27,7 @@ static const struct acpi_device_id int340x_thermal_device_ids[] = { {"INTC1040"}, {"INTC1043"}, {"INTC1044"}, + {"INTC1045"}, {"INTC1047"}, {""}, }; From ad4a0f240882135bcedc207bb52e098029e5fbc7 Mon Sep 17 00:00:00 2001 From: Hanjun Guo Date: Mon, 7 Sep 2020 20:57:29 +0800 Subject: [PATCH 05/10] ACPI: APD: Add kerneldoc for properties in struct apd_device_desc commit 7ff55d174cbf ("ACPI / APD: Provide build-in properties of the UART") added the struct property_entry *properties field to struct apd_device_desc, but didn't add the kernel doc for it, so add it now. Signed-off-by: Hanjun Guo [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpi_apd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c index 806b8ce05624..2a3db9956229 100644 --- a/drivers/acpi/acpi_apd.c +++ b/drivers/acpi/acpi_apd.c @@ -34,6 +34,7 @@ struct apd_private_data; * @flags: device flags like %ACPI_APD_SYSFS, %ACPI_APD_PM * @fixed_clk_rate: fixed rate input clock source for acpi device; * 0 means no fixed rate input clock source + * @properties: build-in properties of the device such as UART * @setup: a hook routine to set device resource during create platform device * * Device description defined as acpi_device_id.driver_data From 62d2234d333a89557cd398472dcf9d00ae624a8d Mon Sep 17 00:00:00 2001 From: Hanjun Guo Date: Mon, 7 Sep 2020 20:57:30 +0800 Subject: [PATCH 06/10] ACPI: APD: Remove flags from struct apd_device_desc The flags field is not used in anywhere, so remove it along with two symbols related to it. Signed-off-by: Hanjun Guo [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpi_apd.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c index 2a3db9956229..b0d17523b628 100644 --- a/drivers/acpi/acpi_apd.c +++ b/drivers/acpi/acpi_apd.c @@ -22,16 +22,8 @@ ACPI_MODULE_NAME("acpi_apd"); struct apd_private_data; -/** - * ACPI_APD_SYSFS : add device attributes in sysfs - * ACPI_APD_PM : attach power domain to device - */ -#define ACPI_APD_SYSFS BIT(0) -#define ACPI_APD_PM BIT(1) - /** * struct apd_device_desc - a descriptor for apd device - * @flags: device flags like %ACPI_APD_SYSFS, %ACPI_APD_PM * @fixed_clk_rate: fixed rate input clock source for acpi device; * 0 means no fixed rate input clock source * @properties: build-in properties of the device such as UART @@ -40,7 +32,6 @@ struct apd_private_data; * Device description defined as acpi_device_id.driver_data */ struct apd_device_desc { - unsigned int flags; unsigned int fixed_clk_rate; struct property_entry *properties; int (*setup)(struct apd_private_data *pdata); From 5df8e5f4f9cec84b72ee2607fdff364903d5d7ee Mon Sep 17 00:00:00 2001 From: Hanjun Guo Date: Mon, 7 Sep 2020 20:57:31 +0800 Subject: [PATCH 07/10] ACPI: APD: Remove ACPI_MODULE_NAME() ACPI_MODULE_NAME() is used for ACPI debug output when using ACPI debug print functions, but ACPI debug print functions are not used in acpi_apd.c, so remove the ACPI_MODULE_NAME() from it. Signed-off-by: Hanjun Guo [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpi_apd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c index b0d17523b628..c985225218d3 100644 --- a/drivers/acpi/acpi_apd.c +++ b/drivers/acpi/acpi_apd.c @@ -19,7 +19,6 @@ #include "internal.h" -ACPI_MODULE_NAME("acpi_apd"); struct apd_private_data; /** From ee2bc5d2c4059622737c0461e60aba6c0be6793c Mon Sep 17 00:00:00 2001 From: Hanjun Guo Date: Mon, 7 Sep 2020 20:57:32 +0800 Subject: [PATCH 08/10] ACPI: APD: Remove unnecessary APD_ADDR() macro stub Since APD_ADDR(desc) is only used when CONFIG_X86_AMD_PLATFORM_DEVICE or CONFIG_ARM64 is set, no need for the stub APD_ADDR(desc) definition covering the other cases, so remove it. Also update the comments for #endif. Signed-off-by: Hanjun Guo [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpi_apd.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c index c985225218d3..44f49c660732 100644 --- a/drivers/acpi/acpi_apd.c +++ b/drivers/acpi/acpi_apd.c @@ -62,7 +62,6 @@ static int acpi_apd_setup(struct apd_private_data *pdata) } #ifdef CONFIG_X86_AMD_PLATFORM_DEVICE - static int misc_check_res(struct acpi_resource *ares, void *data) { struct resource res; @@ -133,7 +132,7 @@ static const struct apd_device_desc cz_uart_desc = { static const struct apd_device_desc fch_misc_desc = { .setup = fch_misc_setup, }; -#endif +#endif /* CONFIG_X86_AMD_PLATFORM_DEVICE */ #ifdef CONFIG_ARM64 static const struct apd_device_desc xgene_i2c_desc = { @@ -175,14 +174,10 @@ static const struct apd_device_desc hip08_spi_desc = { .setup = acpi_apd_setup, .fixed_clk_rate = 250000000, }; +#endif /* CONFIG_ARM64 */ + #endif -#else - -#define APD_ADDR(desc) (0UL) - -#endif /* CONFIG_X86_AMD_PLATFORM_DEVICE */ - /** * Create platform device during acpi scan attach handle. * Return value > 0 on success of creating device. From 32c6f3ffa0182d7f1a8f3e385de3fef74bc27b24 Mon Sep 17 00:00:00 2001 From: Hanjun Guo Date: Mon, 7 Sep 2020 20:57:33 +0800 Subject: [PATCH 09/10] ACPI: APD: Clean up header file include statements Make the included header files appear in the alphabetical order and remove the unnecessary header file inclusions. Signed-off-by: Hanjun Guo [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpi_apd.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c index 44f49c660732..39359ce0eb2c 100644 --- a/drivers/acpi/acpi_apd.c +++ b/drivers/acpi/acpi_apd.c @@ -7,15 +7,13 @@ * Wu, Jeff */ -#include -#include -#include -#include -#include #include +#include +#include #include #include -#include +#include +#include #include "internal.h" From 399e08f1f06693c6734f4a071573674369151ffd Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Fri, 11 Sep 2020 19:46:13 +0300 Subject: [PATCH 10/10] MAINTAINERS: Use my kernel.org address for Intel PMIC work Use my kernel.org address for Intel PMIC work. While here, upgrade status to maintainer of PMIC MFD devices. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki --- MAINTAINERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 0d0862b19ce5..30bee815858e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -405,7 +405,7 @@ F: drivers/platform/x86/i2c-multi-instantiate.c ACPI PMIC DRIVERS M: "Rafael J. Wysocki" M: Len Brown -R: Andy Shevchenko +R: Andy Shevchenko R: Mika Westerberg L: linux-acpi@vger.kernel.org S: Supported @@ -8944,7 +8944,7 @@ F: drivers/gpio/gpio-*cove.c F: drivers/gpio/gpio-msic.c INTEL PMIC MULTIFUNCTION DEVICE DRIVERS -R: Andy Shevchenko +M: Andy Shevchenko S: Maintained F: drivers/mfd/intel_msic.c F: drivers/mfd/intel_soc_pmic*