#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>
#define OFFSET_DATA_LOW …
#define OFFSET_DATA_HIGH …
#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)
{ … }
int intel_punit_ipc_simple_command(int cmd, int para1, int para2)
{ … }
EXPORT_SYMBOL(…);
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(…) …;
fs_initcall(intel_punit_ipc_init);
module_exit(intel_punit_ipc_exit);