Skip to content

Commit 25f1ca3

Browse files
westeriLee Jones
authored andcommitted
platform/x86: intel_pmc_ipc: Convert to MFD
This driver only creates a bunch of platform devices sharing resources belonging to the PMC device. This is pretty much what MFD subsystem is for so move the driver there, renaming it to intel_pmc_bxt.c which should be more clear what it is. MFD subsystem provides nice helper APIs for subdevice creation so convert the driver to use those. Unfortunately the ACPI device includes separate resources for most of the subdevices so we cannot simply call mfd_add_devices() to create all of them but instead we need to call it separately for each device. The new MFD driver continues to expose two sysfs attributes that allow userspace to send IPC commands to the PMC/SCU to avoid breaking any existing applications that may use these. Generally this is bad idea so document this in the ABI documentation. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
1 parent 0759a87 commit 25f1ca3

15 files changed

Lines changed: 602 additions & 720 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
These files allow sending arbitrary IPC commands to the PMC/SCU which
2+
may be dangerous. These will be removed eventually and should not be
3+
used in any new applications.
4+
5+
What: /sys/bus/platform/devices/INT34D2:00/simplecmd
6+
Date: Jun 2015
7+
KernelVersion: 4.1
8+
Contact: Mika Westerberg <mika.westerberg@linux.intel.com>
9+
Description: This interface allows userspace to send an arbitrary
10+
IPC command to the PMC/SCU.
11+
12+
Format: %d %d where first number is command and
13+
second number is subcommand.
14+
15+
What: /sys/bus/platform/devices/INT34D2:00/northpeak
16+
Date: Jun 2015
17+
KernelVersion: 4.1
18+
Contact: Mika Westerberg <mika.westerberg@linux.intel.com>
19+
Description: This interface allows userspace to enable and disable
20+
Northpeak through the PMC/SCU.
21+
22+
Format: %u.

‎arch/x86/include/asm/intel_pmc_ipc.h‎

Lines changed: 0 additions & 47 deletions
This file was deleted.

‎arch/x86/include/asm/intel_telemetry.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ struct telemetry_plt_config {
5353
struct telemetry_unit_config ioss_config;
5454
struct mutex telem_trace_lock;
5555
struct mutex telem_lock;
56+
struct intel_pmc_dev *pmc;
5657
struct intel_scu_ipc_dev *scu;
5758
bool telem_in_use;
5859
};

‎drivers/mfd/Kconfig‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ config INTEL_SOC_PMIC
551551

552552
config INTEL_SOC_PMIC_BXTWC
553553
tristate "Support for Intel Broxton Whiskey Cove PMIC"
554-
depends on INTEL_PMC_IPC
554+
depends on MFD_INTEL_PMC_BXT
555555
select MFD_CORE
556556
select REGMAP_IRQ
557557
help
@@ -632,6 +632,20 @@ config MFD_INTEL_MSIC
632632
Passage) chip. This chip embeds audio, battery, GPIO, etc.
633633
devices used in Intel Medfield platforms.
634634

635+
config MFD_INTEL_PMC_BXT
636+
tristate "Intel PMC Driver for Broxton"
637+
depends on X86
638+
depends on X86_PLATFORM_DEVICES
639+
depends on ACPI
640+
select INTEL_SCU_IPC
641+
select MFD_CORE
642+
help
643+
This driver provides support for the PMC (Power Management
644+
Controller) on Intel Broxton and Apollo Lake. The PMC is a
645+
multi-function device that exposes IPC, General Control
646+
Register and P-unit access. In addition this creates devices
647+
for iTCO watchdog and telemetry that are part of the PMC.
648+
635649
config MFD_IPAQ_MICRO
636650
bool "Atmel Micro ASIC (iPAQ h3100/h3600/h3700) Support"
637651
depends on SA1100_H3100 || SA1100_H3600

‎drivers/mfd/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ obj-$(CONFIG_MFD_INTEL_LPSS) += intel-lpss.o
212212
obj-$(CONFIG_MFD_INTEL_LPSS_PCI) += intel-lpss-pci.o
213213
obj-$(CONFIG_MFD_INTEL_LPSS_ACPI) += intel-lpss-acpi.o
214214
obj-$(CONFIG_MFD_INTEL_MSIC) += intel_msic.o
215+
obj-$(CONFIG_MFD_INTEL_PMC_BXT) += intel_pmc_bxt.o
215216
obj-$(CONFIG_MFD_PALMAS) += palmas.o
216217
obj-$(CONFIG_MFD_VIPERBOARD) += viperboard.o
217218
obj-$(CONFIG_MFD_RC5T583) += rc5t583.o rc5t583-irq.o

0 commit comments

Comments
 (0)