#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/fs.h>
#include <linux/uaccess.h>
#include <linux/string.h>
#include <linux/pci.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/mutex.h>
#include <linux/if_ether.h>
#include <linux/ctype.h>
#include <linux/dmi.h>
#include <linux/of.h>
#define PHUB_STATUS …
#define PHUB_CONTROL …
#define PHUB_TIMEOUT …
#define PCH_PHUB_ROM_WRITE_ENABLE …
#define PCH_PHUB_ROM_WRITE_DISABLE …
#define PCH_PHUB_MAC_START_ADDR_EG20T …
#define PCH_PHUB_MAC_START_ADDR_ML7223 …
#define PCH_PHUB_ROM_START_ADDR_EG20T …
#define PCH_PHUB_ROM_START_ADDR_ML7213 …
#define PCH_PHUB_ROM_START_ADDR_ML7223 …
#define MAX_NUM_INT_REDUCE_CONTROL_REG …
#define PCI_DEVICE_ID_PCH1_PHUB …
#define PCH_MINOR_NOS …
#define CLKCFG_CAN_50MHZ …
#define CLKCFG_CANCLK_MASK …
#define CLKCFG_UART_MASK …
#define CLKCFG_UART_48MHZ …
#define CLKCFG_UART_25MHZ …
#define CLKCFG_BAUDDIV …
#define CLKCFG_PLL2VCO …
#define CLKCFG_UARTCLKSEL …
#define PCI_DEVICE_ID_ROHM_ML7213_PHUB …
#define PCI_DEVICE_ID_ROHM_ML7223_mPHUB …
#define PCI_DEVICE_ID_ROHM_ML7223_nPHUB …
#define PCI_DEVICE_ID_ROHM_ML7831_PHUB …
#define PCH_WORD_ADDR_MASK …
#define PCH_PHUB_ID_REG …
#define PCH_PHUB_QUEUE_PRI_VAL_REG …
#define PCH_PHUB_RC_QUEUE_MAXSIZE_REG …
#define PCH_PHUB_BRI_QUEUE_MAXSIZE_REG …
#define PCH_PHUB_COMP_RESP_TIMEOUT_REG …
#define PCH_PHUB_BUS_SLAVE_CONTROL_REG …
#define PCH_PHUB_DEADLOCK_AVOID_TYPE_REG …
#define PCH_PHUB_INTPIN_REG_WPERMIT_REG0 …
#define PCH_PHUB_INTPIN_REG_WPERMIT_REG1 …
#define PCH_PHUB_INTPIN_REG_WPERMIT_REG2 …
#define PCH_PHUB_INTPIN_REG_WPERMIT_REG3 …
#define PCH_PHUB_INT_REDUCE_CONTROL_REG_BASE …
#define CLKCFG_REG_OFFSET …
#define FUNCSEL_REG_OFFSET …
#define PCH_PHUB_OROM_SIZE …
struct pch_phub_reg { … };
static const int pch_phub_mac_offset[ETH_ALEN] = …;
static DEFINE_MUTEX(pch_phub_mutex);
static void pch_phub_read_modify_write_reg(struct pch_phub_reg *chip,
unsigned int reg_addr_offset,
unsigned int data, unsigned int mask)
{ … }
static void __maybe_unused pch_phub_save_reg_conf(struct pci_dev *pdev)
{ … }
static void __maybe_unused pch_phub_restore_reg_conf(struct pci_dev *pdev)
{ … }
static void pch_phub_read_serial_rom(struct pch_phub_reg *chip,
unsigned int offset_address, u8 *data)
{ … }
static int pch_phub_write_serial_rom(struct pch_phub_reg *chip,
unsigned int offset_address, u8 data)
{ … }
static void pch_phub_read_serial_rom_val(struct pch_phub_reg *chip,
unsigned int offset_address, u8 *data)
{ … }
static int pch_phub_write_serial_rom_val(struct pch_phub_reg *chip,
unsigned int offset_address, u8 data)
{ … }
static int pch_phub_gbe_serial_rom_conf(struct pch_phub_reg *chip)
{ … }
static int pch_phub_gbe_serial_rom_conf_mp(struct pch_phub_reg *chip)
{ … }
static void pch_phub_read_gbe_mac_addr(struct pch_phub_reg *chip, u8 *data)
{ … }
static int pch_phub_write_gbe_mac_addr(struct pch_phub_reg *chip, u8 *data)
{ … }
static ssize_t pch_phub_bin_read(struct file *filp, struct kobject *kobj,
struct bin_attribute *attr, char *buf,
loff_t off, size_t count)
{ … }
static ssize_t pch_phub_bin_write(struct file *filp, struct kobject *kobj,
struct bin_attribute *attr,
char *buf, loff_t off, size_t count)
{ … }
static ssize_t show_pch_mac(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t store_pch_mac(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(pch_mac, S_IRUGO | S_IWUSR, show_pch_mac, store_pch_mac);
static const struct bin_attribute pch_bin_attr = …;
static int pch_phub_probe(struct pci_dev *pdev,
const struct pci_device_id *id)
{ … }
static void pch_phub_remove(struct pci_dev *pdev)
{ … }
static int __maybe_unused pch_phub_suspend(struct device *dev_d)
{ … }
static int __maybe_unused pch_phub_resume(struct device *dev_d)
{ … }
static const struct pci_device_id pch_phub_pcidev_id[] = …;
MODULE_DEVICE_TABLE(pci, pch_phub_pcidev_id);
static SIMPLE_DEV_PM_OPS(pch_phub_pm_ops, pch_phub_suspend, pch_phub_resume);
static struct pci_driver pch_phub_driver = …;
module_pci_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;