linux/drivers/platform/mellanox/mlxreg-lc.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Nvidia line card driver
 *
 * Copyright (C) 2020 Nvidia Technologies Ltd.
 */

#include <linux/device.h>
#include <linux/i2c.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>

/* I2C bus IO offsets */
#define MLXREG_LC_REG_CPLD1_VER_OFFSET
#define MLXREG_LC_REG_FPGA1_VER_OFFSET
#define MLXREG_LC_REG_CPLD1_PN_OFFSET
#define MLXREG_LC_REG_FPGA1_PN_OFFSET
#define MLXREG_LC_REG_RESET_CAUSE_OFFSET
#define MLXREG_LC_REG_LED1_OFFSET
#define MLXREG_LC_REG_GP0_OFFSET
#define MLXREG_LC_REG_FIELD_UPGRADE
#define MLXREG_LC_CHANNEL_I2C_REG
#define MLXREG_LC_REG_CPLD1_MVER_OFFSET
#define MLXREG_LC_REG_FPGA1_MVER_OFFSET
#define MLXREG_LC_REG_MAX_POWER_OFFSET
#define MLXREG_LC_REG_CONFIG_OFFSET
#define MLXREG_LC_REG_MAX

/**
 * enum mlxreg_lc_type - line cards types
 *
 * @MLXREG_LC_SN4800_C16: 100GbE line card with 16 QSFP28 ports;
 */
enum mlxreg_lc_type {};

/**
 * enum mlxreg_lc_state - line cards state
 *
 * @MLXREG_LC_INITIALIZED: line card is initialized;
 * @MLXREG_LC_POWERED: line card is powered;
 * @MLXREG_LC_SYNCED: line card is synchronized between hardware and firmware;
 */
enum mlxreg_lc_state {};

#define MLXREG_LC_CONFIGURED

/* mlxreg_lc - device private data
 * @dev: platform device;
 * @lock: line card lock;
 * @par_regmap: parent device regmap handle;
 * @data: pltaform core data;
 * @io_data: register access platform data;
 * @led_data: LED platform data ;
 * @mux_data: MUX platform data;
 * @led: LED device;
 * @io_regs: register access device;
 * @mux_brdinfo: mux configuration;
 * @mux: mux devices;
 * @aux_devs: I2C devices feeding by auxiliary power;
 * @aux_devs_num: number of I2C devices feeding by auxiliary power;
 * @main_devs: I2C devices feeding by main power;
 * @main_devs_num: number of I2C devices feeding by main power;
 * @state: line card state;
 */
struct mlxreg_lc {};

static bool mlxreg_lc_writeable_reg(struct device *dev, unsigned int reg)
{}

static bool mlxreg_lc_readable_reg(struct device *dev, unsigned int reg)
{}

static bool mlxreg_lc_volatile_reg(struct device *dev, unsigned int reg)
{}

static const struct reg_default mlxreg_lc_regmap_default[] =;

/* Configuration for the register map of a device with 2 bytes address space. */
static const struct regmap_config mlxreg_lc_regmap_conf =;

/* Default channels vector.
 * It contains only the channels, which physically connected to the devices,
 * empty channels are skipped.
 */
static int mlxreg_lc_chan[] =;

/* Defaul mux configuration. */
static struct mlxcpld_mux_plat_data mlxreg_lc_mux_data[] =;

/* Defaul mux board info. */
static struct i2c_board_info mlxreg_lc_mux_brdinfo =;

/* Line card default auxiliary power static devices. */
static struct i2c_board_info mlxreg_lc_aux_pwr_devices[] =;

/* Line card default auxiliary power board info. */
static struct mlxreg_hotplug_device mlxreg_lc_aux_pwr_brdinfo[] =;

/* Line card default main power static devices. */
static struct i2c_board_info mlxreg_lc_main_pwr_devices[] =;

/* Line card default main power board info. */
static struct mlxreg_hotplug_device mlxreg_lc_main_pwr_brdinfo[] =;

/* LED default data. */
static struct mlxreg_core_data mlxreg_lc_led_data[] =;

static struct mlxreg_core_platform_data mlxreg_lc_led =;

/* Default register access data. */
static struct mlxreg_core_data mlxreg_lc_io_data[] =;

static struct mlxreg_core_platform_data mlxreg_lc_regs_io =;

static int
mlxreg_lc_create_static_devices(struct mlxreg_lc *mlxreg_lc, struct mlxreg_hotplug_device *devs,
				int size)
{}

static void
mlxreg_lc_destroy_static_devices(struct mlxreg_lc *mlxreg_lc, struct mlxreg_hotplug_device *devs,
				 int size)
{}

static int mlxreg_lc_power_on_off(struct mlxreg_lc *mlxreg_lc, u8 action)
{}

static int mlxreg_lc_enable_disable(struct mlxreg_lc *mlxreg_lc, bool action)
{}

static int
mlxreg_lc_sn4800_c16_config_init(struct mlxreg_lc *mlxreg_lc, void *regmap,
				 struct mlxreg_core_data *data)
{}

static void
mlxreg_lc_state_update(struct mlxreg_lc *mlxreg_lc, enum mlxreg_lc_state state, u8 action)
{}

static void
mlxreg_lc_state_update_locked(struct mlxreg_lc *mlxreg_lc, enum mlxreg_lc_state state, u8 action)
{}

/*
 * Callback is to be called from mlxreg-hotplug driver to notify about line card about received
 * event.
 */
static int mlxreg_lc_event_handler(void *handle, enum mlxreg_hotplug_kind kind, u8 action)
{}

/*
 * Callback is to be called from i2c-mux-mlxcpld driver to indicate that all adapter devices has
 * been created.
 */
static int mlxreg_lc_completion_notify(void *handle, struct i2c_adapter *parent,
				       struct i2c_adapter *adapters[])
{}

static int
mlxreg_lc_config_init(struct mlxreg_lc *mlxreg_lc, void *regmap,
		      struct mlxreg_core_data *data)
{}

static void mlxreg_lc_config_exit(struct mlxreg_lc *mlxreg_lc)
{}

static int mlxreg_lc_probe(struct platform_device *pdev)
{}

static void mlxreg_lc_remove(struct platform_device *pdev)
{}

static struct platform_driver mlxreg_lc_driver =;

module_platform_driver();

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