#include <linux/device.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/gpio.h>
#include <linux/module.h>
#include <linux/platform_data/mlxcpld.h>
#include <linux/platform_data/mlxreg.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#define NVSW_SN2201_CPLD_LPC_I2C_BASE_ADRR …
#define NVSW_SN2201_CPLD_LPC_IO_RANGE …
#define NVSW_SN2201_HW_VER_ID_OFFSET …
#define NVSW_SN2201_BOARD_ID_OFFSET …
#define NVSW_SN2201_CPLD_VER_OFFSET …
#define NVSW_SN2201_CPLD_MVER_OFFSET …
#define NVSW_SN2201_CPLD_ID_OFFSET …
#define NVSW_SN2201_CPLD_PN_OFFSET …
#define NVSW_SN2201_CPLD_PN1_OFFSET …
#define NVSW_SN2201_PSU_CTRL_OFFSET …
#define NVSW_SN2201_QSFP28_STATUS_OFFSET …
#define NVSW_SN2201_QSFP28_INT_STATUS_OFFSET …
#define NVSW_SN2201_QSFP28_LP_STATUS_OFFSET …
#define NVSW_SN2201_QSFP28_RST_STATUS_OFFSET …
#define NVSW_SN2201_SYS_STATUS_OFFSET …
#define NVSW_SN2201_FRONT_SYS_LED_CTRL_OFFSET …
#define NVSW_SN2201_FRONT_PSU_LED_CTRL_OFFSET …
#define NVSW_SN2201_FRONT_UID_LED_CTRL_OFFSET …
#define NVSW_SN2201_QSFP28_LED_TEST_STATUS_OFFSET …
#define NVSW_SN2201_SYS_RST_STATUS_OFFSET …
#define NVSW_SN2201_SYS_INT_STATUS_OFFSET …
#define NVSW_SN2201_SYS_INT_MASK_OFFSET …
#define NVSW_SN2201_ASIC_STATUS_OFFSET …
#define NVSW_SN2201_ASIC_EVENT_OFFSET …
#define NVSW_SN2201_ASIC_MAKS_OFFSET …
#define NVSW_SN2201_THML_STATUS_OFFSET …
#define NVSW_SN2201_THML_EVENT_OFFSET …
#define NVSW_SN2201_THML_MASK_OFFSET …
#define NVSW_SN2201_PS_ALT_STATUS_OFFSET …
#define NVSW_SN2201_PS_ALT_EVENT_OFFSET …
#define NVSW_SN2201_PS_ALT_MASK_OFFSET …
#define NVSW_SN2201_PS_PRSNT_STATUS_OFFSET …
#define NVSW_SN2201_PS_PRSNT_EVENT_OFFSET …
#define NVSW_SN2201_PS_PRSNT_MASK_OFFSET …
#define NVSW_SN2201_PS_DC_OK_STATUS_OFFSET …
#define NVSW_SN2201_PS_DC_OK_EVENT_OFFSET …
#define NVSW_SN2201_PS_DC_OK_MASK_OFFSET …
#define NVSW_SN2201_RST_CAUSE1_OFFSET …
#define NVSW_SN2201_RST_CAUSE2_OFFSET …
#define NVSW_SN2201_RST_SW_CTRL_OFFSET …
#define NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET …
#define NVSW_SN2201_FAN_PRSNT_EVENT_OFFSET …
#define NVSW_SN2201_FAN_PRSNT_MASK_OFFSET …
#define NVSW_SN2201_WD_TMR_OFFSET_LSB …
#define NVSW_SN2201_WD_TMR_OFFSET_MSB …
#define NVSW_SN2201_WD_ACT_OFFSET …
#define NVSW_SN2201_FAN_LED1_CTRL_OFFSET …
#define NVSW_SN2201_FAN_LED2_CTRL_OFFSET …
#define NVSW_SN2201_REG_MAX …
#define NVSW_SN2201_PHY_I2C_BUS_NUM …
#define NVSW_SN2201_MAIN_MUX_CHNL_NUM …
#define NVSW_SN2201_MAIN_NR …
#define NVSW_SN2201_MAIN_MUX_NR …
#define NVSW_SN2201_MAIN_MUX_DEFER_NR …
#define NVSW_SN2201_MAIN_MUX_CH0_NR …
#define NVSW_SN2201_MAIN_MUX_CH1_NR …
#define NVSW_SN2201_MAIN_MUX_CH2_NR …
#define NVSW_SN2201_MAIN_MUX_CH3_NR …
#define NVSW_SN2201_MAIN_MUX_CH5_NR …
#define NVSW_SN2201_MAIN_MUX_CH6_NR …
#define NVSW_SN2201_MAIN_MUX_CH7_NR …
#define NVSW_SN2201_2ND_MUX_CH0_NR …
#define NVSW_SN2201_2ND_MUX_CH1_NR …
#define NVSW_SN2201_2ND_MUX_CH2_NR …
#define NVSW_SN2201_2ND_MUX_CH3_NR …
#define NVSW_SN2201_CPLD_NR …
#define NVSW_SN2201_NR_NONE …
#define NVSW_SN2201_CPLD_AGGR_ASIC_MASK_DEF …
#define NVSW_SN2201_CPLD_AGGR_PSU_MASK_DEF …
#define NVSW_SN2201_CPLD_AGGR_PWR_MASK_DEF …
#define NVSW_SN2201_CPLD_AGGR_FAN_MASK_DEF …
#define NVSW_SN2201_CPLD_AGGR_MASK_DEF …
#define NVSW_SN2201_CPLD_ASIC_MASK …
#define NVSW_SN2201_CPLD_PSU_MASK …
#define NVSW_SN2201_CPLD_PWR_MASK …
#define NVSW_SN2201_CPLD_FAN_MASK …
#define NVSW_SN2201_CPLD_SYSIRQ …
#define NVSW_SN2201_LPC_SYSIRQ …
#define NVSW_SN2201_CPLD_I2CADDR …
#define NVSW_SN2201_WD_DFLT_TIMEOUT …
struct nvsw_sn2201 { … };
static bool nvsw_sn2201_writeable_reg(struct device *dev, unsigned int reg)
{ … }
static bool nvsw_sn2201_readable_reg(struct device *dev, unsigned int reg)
{ … }
static bool nvsw_sn2201_volatile_reg(struct device *dev, unsigned int reg)
{ … }
static const struct reg_default nvsw_sn2201_regmap_default[] = …;
static const struct regmap_config nvsw_sn2201_regmap_conf = …;
static const struct resource nvsw_sn2201_lpc_io_resources[] = …;
static struct resource nvsw_sn2201_cpld_res[] = …;
static struct resource nvsw_sn2201_lpc_res[] = …;
static struct mlxreg_core_hotplug_platform_data nvsw_sn2201_i2c_data = …;
static struct i2c_board_info nvsw_sn2201_cpld_devices[] = …;
static struct mlxreg_hotplug_device nvsw_sn2201_cpld_brdinfo[] = …;
static struct i2c_board_info nvsw_sn2201_main_mux_devices[] = …;
static struct mlxreg_hotplug_device nvsw_sn2201_main_mux_brdinfo[] = …;
static struct i2c_board_info nvsw_sn2201_pwr_devices[] = …;
static struct i2c_board_info nvsw_sn2201_fan_devices[] = …;
static struct mlxreg_core_data nvsw_sn2201_psu_items_data[] = …;
static struct mlxreg_core_data nvsw_sn2201_pwr_items_data[] = …;
static struct mlxreg_core_data nvsw_sn2201_fan_items_data[] = …;
static struct mlxreg_core_data nvsw_sn2201_sys_items_data[] = …;
static struct mlxreg_core_item nvsw_sn2201_items[] = …;
static
struct mlxreg_core_hotplug_platform_data nvsw_sn2201_hotplug = …;
static struct i2c_board_info nvsw_sn2201_static_devices[] = …;
static struct mlxreg_hotplug_device nvsw_sn2201_static_brdinfo[] = …;
static struct mlxreg_core_data nvsw_sn2201_led_data[] = …;
static struct mlxreg_core_platform_data nvsw_sn2201_led = …;
static struct mlxreg_core_data nvsw_sn2201_io_data[] = …;
static struct mlxreg_core_platform_data nvsw_sn2201_regs_io = …;
static struct mlxreg_core_data nvsw_sn2201_wd_data[] = …;
static struct mlxreg_core_platform_data nvsw_sn2201_wd = …;
static int
nvsw_sn2201_create_static_devices(struct nvsw_sn2201 *nvsw_sn2201,
struct mlxreg_hotplug_device *devs,
int size)
{ … }
static void nvsw_sn2201_destroy_static_devices(struct nvsw_sn2201 *nvsw_sn2201,
struct mlxreg_hotplug_device *devs, int size)
{ … }
static int nvsw_sn2201_config_post_init(struct nvsw_sn2201 *nvsw_sn2201)
{ … }
static int nvsw_sn2201_config_init(struct nvsw_sn2201 *nvsw_sn2201, void *regmap)
{ … }
static void nvsw_sn2201_config_exit(struct nvsw_sn2201 *nvsw_sn2201)
{ … }
static int nvsw_sn2201_i2c_completion_notify(void *handle, int id)
{ … }
static int nvsw_sn2201_config_pre_init(struct nvsw_sn2201 *nvsw_sn2201)
{ … }
static int nvsw_sn2201_probe(struct platform_device *pdev)
{ … }
static void nvsw_sn2201_remove(struct platform_device *pdev)
{ … }
static const struct acpi_device_id nvsw_sn2201_acpi_ids[] = …;
MODULE_DEVICE_TABLE(acpi, nvsw_sn2201_acpi_ids);
static struct platform_driver nvsw_sn2201_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;