linux/drivers/platform/x86/intel/punit_ipc.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Driver for the Intel P-Unit Mailbox IPC mechanism
 *
 * (C) Copyright 2015 Intel Corporation
 *
 * The heart of the P-Unit is the Foxton microcontroller and its firmware,
 * which provide mailbox interface for power management usage.
 */

#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>

#include <asm/intel_punit_ipc.h>

/* IPC Mailbox registers */
#define OFFSET_DATA_LOW
#define OFFSET_DATA_HIGH
/* bit field of interface register */
#define CMD_RUN
#define CMD_ERRCODE_MASK
#define CMD_PARA1_SHIFT
#define CMD_PARA2_SHIFT

#define CMD_TIMEOUT_SECONDS

enum {};

IPC_DEV;

static IPC_DEV *punit_ipcdev;

static inline u32 ipc_read_status(IPC_DEV *ipcdev, IPC_TYPE type)
{}

static inline void ipc_write_cmd(IPC_DEV *ipcdev, IPC_TYPE type, u32 cmd)
{}

static inline u32 ipc_read_data_low(IPC_DEV *ipcdev, IPC_TYPE type)
{}

static inline u32 ipc_read_data_high(IPC_DEV *ipcdev, IPC_TYPE type)
{}

static inline void ipc_write_data_low(IPC_DEV *ipcdev, IPC_TYPE type, u32 data)
{}

static inline void ipc_write_data_high(IPC_DEV *ipcdev, IPC_TYPE type, u32 data)
{}

static const char *ipc_err_string(int error)
{}

static int intel_punit_ipc_check_status(IPC_DEV *ipcdev, IPC_TYPE type)
{}

/**
 * intel_punit_ipc_simple_command() - Simple IPC command
 * @cmd:	IPC command code.
 * @para1:	First 8bit parameter, set 0 if not used.
 * @para2:	Second 8bit parameter, set 0 if not used.
 *
 * Send a IPC command to P-Unit when there is no data transaction
 *
 * Return:	IPC error code or 0 on success.
 */
int intel_punit_ipc_simple_command(int cmd, int para1, int para2)
{}
EXPORT_SYMBOL();

/**
 * intel_punit_ipc_command() - IPC command with data and pointers
 * @cmd:	IPC command code.
 * @para1:	First 8bit parameter, set 0 if not used.
 * @para2:	Second 8bit parameter, set 0 if not used.
 * @in:		Input data, 32bit for BIOS cmd, two 32bit for GTD and ISPD.
 * @out:	Output data.
 *
 * Send a IPC command to P-Unit with data transaction
 *
 * Return:	IPC error code or 0 on success.
 */
int intel_punit_ipc_command(u32 cmd, u32 para1, u32 para2, u32 *in, u32 *out)
{}
EXPORT_SYMBOL_GPL();

static irqreturn_t intel_punit_ioc(int irq, void *dev_id)
{}

static int intel_punit_get_bars(struct platform_device *pdev)
{}

static int intel_punit_ipc_probe(struct platform_device *pdev)
{}

static const struct acpi_device_id punit_ipc_acpi_ids[] =;
MODULE_DEVICE_TABLE(acpi, punit_ipc_acpi_ids);

static struct platform_driver intel_punit_ipc_driver =;

static int __init intel_punit_ipc_init(void)
{}

static void __exit intel_punit_ipc_exit(void)
{}

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();

/* Some modules are dependent on this, so init earlier */
fs_initcall(intel_punit_ipc_init);
module_exit(intel_punit_ipc_exit);