#include <linux/bitfield.h>
#include <linux/delay.h>
#include <linux/firmware.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pse-pd/pse.h>
#define TPS23881_MAX_CHANS …
#define TPS23881_REG_PW_STATUS …
#define TPS23881_REG_OP_MODE …
#define TPS23881_OP_MODE_SEMIAUTO …
#define TPS23881_REG_DIS_EN …
#define TPS23881_REG_DET_CLA_EN …
#define TPS23881_REG_GEN_MASK …
#define TPS23881_REG_NBITACC …
#define TPS23881_REG_PW_EN …
#define TPS23881_REG_PORT_MAP …
#define TPS23881_REG_PORT_POWER …
#define TPS23881_REG_POEPLUS …
#define TPS23881_REG_TPON …
#define TPS23881_REG_FWREV …
#define TPS23881_REG_DEVID …
#define TPS23881_REG_DEVID_MASK …
#define TPS23881_DEVICE_ID …
#define TPS23881_REG_SRAM_CTRL …
#define TPS23881_REG_SRAM_DATA …
struct tps23881_port_desc { … };
struct tps23881_priv { … };
static struct tps23881_priv *to_tps23881_priv(struct pse_controller_dev *pcdev)
{ … }
static int tps23881_pi_enable(struct pse_controller_dev *pcdev, int id)
{ … }
static int tps23881_pi_disable(struct pse_controller_dev *pcdev, int id)
{ … }
static int tps23881_pi_is_enabled(struct pse_controller_dev *pcdev, int id)
{ … }
static int tps23881_ethtool_get_status(struct pse_controller_dev *pcdev,
unsigned long id,
struct netlink_ext_ack *extack,
struct pse_control_status *status)
{ … }
static int
tps23881_get_of_channels(struct tps23881_priv *priv,
struct device_node *chan_node[TPS23881_MAX_CHANS])
{ … }
struct tps23881_port_matrix { … };
static int
tps23881_match_channel(const struct pse_pi_pairset *pairset,
struct device_node *chan_node[TPS23881_MAX_CHANS])
{ … }
static bool
tps23881_is_chan_free(struct tps23881_port_matrix port_matrix[TPS23881_MAX_CHANS],
int chan)
{ … }
static int
tps23881_match_port_matrix(struct pse_pi *pi, int pi_id,
struct device_node *chan_node[TPS23881_MAX_CHANS],
struct tps23881_port_matrix port_matrix[TPS23881_MAX_CHANS])
{ … }
static int
tps23881_get_unused_chan(struct tps23881_port_matrix port_matrix[TPS23881_MAX_CHANS],
int port_cnt)
{ … }
static int
tps23881_sort_port_matrix(struct tps23881_port_matrix port_matrix[TPS23881_MAX_CHANS])
{ … }
static int
tps23881_write_port_matrix(struct tps23881_priv *priv,
struct tps23881_port_matrix port_matrix[TPS23881_MAX_CHANS],
int port_cnt)
{ … }
static int
tps23881_set_ports_conf(struct tps23881_priv *priv,
struct tps23881_port_matrix port_matrix[TPS23881_MAX_CHANS])
{ … }
static int
tps23881_set_ports_matrix(struct tps23881_priv *priv,
struct device_node *chan_node[TPS23881_MAX_CHANS])
{ … }
static int tps23881_setup_pi_matrix(struct pse_controller_dev *pcdev)
{ … }
static const struct pse_controller_ops tps23881_ops = …;
static const char fw_parity_name[] = …;
static const char fw_sram_name[] = …;
struct tps23881_fw_conf { … };
static const struct tps23881_fw_conf tps23881_fw_parity_conf[] = …;
static const struct tps23881_fw_conf tps23881_fw_sram_conf[] = …;
static int tps23881_flash_sram_fw_part(struct i2c_client *client,
const char *fw_name,
const struct tps23881_fw_conf *fw_conf)
{ … }
static int tps23881_flash_sram_fw(struct i2c_client *client)
{ … }
static int tps23881_i2c_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id tps23881_id[] = …;
MODULE_DEVICE_TABLE(i2c, tps23881_id);
static const struct of_device_id tps23881_of_match[] = …;
MODULE_DEVICE_TABLE(of, tps23881_of_match);
static struct i2c_driver tps23881_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;