linux/drivers/platform/x86/intel/speed_select_if/isst_if_mbox_pci.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Intel Speed Select Interface: Mbox via PCI Interface
 * Copyright (c) 2019, Intel Corporation.
 * All rights reserved.
 *
 * Author: Srinivas Pandruvada <[email protected]>
 */

#include <linux/cpufeature.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/sched/signal.h>
#include <linux/uaccess.h>
#include <uapi/linux/isst_if.h>

#include "isst_if_common.h"

#define PUNIT_MAILBOX_DATA
#define PUNIT_MAILBOX_INTERFACE
#define PUNIT_MAILBOX_BUSY_BIT

/*
 * The average time to complete mailbox commands is less than 40us. Most of
 * the commands complete in few micro seconds. But the same firmware handles
 * requests from all power management features.
 * We can create a scenario where we flood the firmware with requests then
 * the mailbox response can be delayed for 100s of micro seconds. So define
 * two timeouts. One for average case and one for long.
 * If the firmware is taking more than average, just call cond_resched().
 */
#define OS_MAILBOX_TIMEOUT_AVG_US
#define OS_MAILBOX_TIMEOUT_MAX_US

struct isst_if_device {};

static int isst_if_mbox_cmd(struct pci_dev *pdev,
			    struct isst_if_mbox_cmd *mbox_cmd)
{}

static long isst_if_mbox_proc_cmd(u8 *cmd_ptr, int *write_only, int resume)
{}

static const struct pci_device_id isst_if_mbox_ids[] =;
MODULE_DEVICE_TABLE(pci, isst_if_mbox_ids);

static int isst_if_mbox_probe(struct pci_dev *pdev,
			      const struct pci_device_id *ent)
{}

static void isst_if_mbox_remove(struct pci_dev *pdev)
{}

static int __maybe_unused isst_if_resume(struct device *device)
{}

static SIMPLE_DEV_PM_OPS(isst_if_pm_ops, NULL, isst_if_resume);

static struct pci_driver isst_if_pci_driver =;

module_pci_driver();

MODULE_LICENSE();
MODULE_DESCRIPTION();