Commit 54b34aa0 authored by Mika Westerberg's avatar Mika Westerberg Committed by Lee Jones
Browse files

platform/x86: intel_scu_ipc: Split out SCU IPC functionality from the SCU driver



The SCU IPC functionality is usable outside of Intel MID devices. For
example modern Intel CPUs include the same thing but now it is called
PMC (Power Management Controller) instead of SCU. To make the IPC
available for those split the driver into core part (intel_scu_ipc.c)
and the SCU PCI driver part (intel_scu_pcidrv.c) which then calls the
former before it goes and creates rest of the SCU devices. The SCU IPC
will also register a new class that gets assigned to the device that is
created under the parent PCI device.

We also split the Kconfig symbols so that INTEL_SCU_IPC enables the SCU
IPC library and INTEL_SCU_PCI the SCU driver and convert the users
accordingly. While there remove default y from the INTEL_SCU_PCI symbol
as it is already selected by X86_INTEL_MID.

Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 8f3d9f35
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -595,7 +595,7 @@ config X86_INTEL_MID
	select I2C
	select DW_APB_TIMER
	select APB_TIMER
	select INTEL_SCU_IPC
	select INTEL_SCU_PCI
	select MFD_INTEL_MSIC
	---help---
	  Select to build a kernel capable of supporting Intel MID (Mobile
+18 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
#ifndef _ASM_X86_INTEL_SCU_IPC_H_
#define  _ASM_X86_INTEL_SCU_IPC_H_

#include <linux/ioport.h>
#include <linux/notifier.h>

#define IPCMSG_INDIRECT_READ	0x02
@@ -19,6 +20,23 @@
	#define IPC_CMD_VRTC_SETTIME      1 /* Set time */
	#define IPC_CMD_VRTC_SETALARM     2 /* Set alarm */

struct device;
struct intel_scu_ipc_dev;

/**
 * struct intel_scu_ipc_data - Data used to configure SCU IPC
 * @mem: Base address of SCU IPC MMIO registers
 * @irq: The IRQ number used for SCU (optional)
 */
struct intel_scu_ipc_data {
	struct resource mem;
	int irq;
};

struct intel_scu_ipc_dev *
intel_scu_ipc_register(struct device *parent,
		       const struct intel_scu_ipc_data *scu_data);

/* Read single register */
int intel_scu_ipc_ioread8(u16 addr, u8 *data);

+2 −2
Original line number Diff line number Diff line
@@ -593,7 +593,7 @@ config INTEL_SOC_PMIC_MRFLD
	tristate "Support for Intel Merrifield Basin Cove PMIC"
	depends on GPIOLIB
	depends on ACPI
	depends on INTEL_SCU_IPC
	depends on INTEL_SCU
	select MFD_CORE
	select REGMAP_IRQ
	help
@@ -625,7 +625,7 @@ config MFD_INTEL_LPSS_PCI

config MFD_INTEL_MSIC
	bool "Intel MSIC"
	depends on INTEL_SCU_IPC
	depends on INTEL_SCU
	select MFD_CORE
	help
	  Select this option to enable access to Intel MSIC (Avatele
+16 −8
Original line number Diff line number Diff line
@@ -1295,7 +1295,7 @@ config INTEL_MFLD_THERMAL

config INTEL_MID_POWER_BUTTON
	tristate "power button driver for Intel MID platforms"
	depends on INTEL_SCU_IPC && INPUT
	depends on INTEL_SCU && INPUT
	help
	  This driver handles the power button on the Intel MID platforms.

@@ -1342,17 +1342,25 @@ config INTEL_PUNIT_IPC
	  which is used to bridge the communications between kernel and P-Unit.

config INTEL_SCU_IPC
	bool "Intel SCU IPC Support"
	bool

config INTEL_SCU
	bool
	select INTEL_SCU_IPC

config INTEL_SCU_PCI
	bool "Intel SCU PCI driver"
	depends on X86_INTEL_MID
	default y
	---help---
	  IPC is used to bridge the communications between kernel and SCU on
	  some embedded Intel x86 platforms. This is not needed for PC-type
	  machines.
	select INTEL_SCU
	help
	  This driver is used to bridge the communications between kernel
	  and SCU on some embedded Intel x86 platforms. It also creates
	  devices that are connected to the SoC through the SCU. This is
	  not needed for PC-type machines.

config INTEL_SCU_IPC_UTIL
	tristate "Intel SCU IPC utility driver"
	depends on INTEL_SCU_IPC
	depends on INTEL_SCU
	---help---
	  The IPC Util driver provides an interface with the SCU enabling
	  low level access for debug work and updating the firmware. Say
+1 −0
Original line number Diff line number Diff line
@@ -141,6 +141,7 @@ obj-$(CONFIG_INTEL_PMC_CORE) += intel_pmc_core.o intel_pmc_core_pltdrv.o
obj-$(CONFIG_INTEL_PMC_IPC)		+= intel_pmc_ipc.o
obj-$(CONFIG_INTEL_PUNIT_IPC)		+= intel_punit_ipc.o
obj-$(CONFIG_INTEL_SCU_IPC)		+= intel_scu_ipc.o
obj-$(CONFIG_INTEL_SCU_PCI)		+= intel_scu_pcidrv.o
obj-$(CONFIG_INTEL_SCU_IPC_UTIL)	+= intel_scu_ipcutil.o
obj-$(CONFIG_INTEL_TELEMETRY)		+= intel_telemetry_core.o \
					   intel_telemetry_pltdrv.o \
Loading