#include <linux/err.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/phy.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <dt-bindings/phy/phy-lan966x-serdes.h>
#include "lan966x_serdes_regs.h"
#define PLL_CONF_MASK …
#define PLL_CONF_25MHZ …
#define PLL_CONF_125MHZ …
#define PLL_CONF_SERDES_125MHZ …
#define PLL_CONF_BYPASS …
#define lan_offset_(id, tinst, tcnt, \
gbase, ginst, gcnt, gwidth, \
raddr, rinst, rcnt, rwidth) …
#define lan_offset(...) …
#define lan_rmw(val, mask, reg, off) …
#define SERDES_MUX(_idx, _port, _mode, _submode, _mask, _mux) …
#define SERDES_MUX_GMII(i, p, m, c) …
#define SERDES_MUX_SGMII(i, p, m, c) …
#define SERDES_MUX_QSGMII(i, p, m, c) …
#define SERDES_MUX_RGMII(i, p, m, c) …
static void lan_rmw_(u32 val, u32 mask, void __iomem *mem, u32 offset)
{ … }
struct serdes_mux { … };
static const struct serdes_mux lan966x_serdes_muxes[] = …;
struct serdes_ctrl { … };
struct serdes_macro { … };
enum lan966x_sd6g40_mode { … };
enum lan966x_sd6g40_ltx2rx { … };
struct lan966x_sd6g40_setup_args { … };
struct lan966x_sd6g40_mode_args { … };
struct lan966x_sd6g40_setup { … };
static int lan966x_sd6g40_reg_cfg(struct serdes_macro *macro,
struct lan966x_sd6g40_setup *res_struct,
u32 idx)
{ … }
static int lan966x_sd6g40_get_conf_from_mode(struct serdes_macro *macro,
enum lan966x_sd6g40_mode f_mode,
bool ref125M,
struct lan966x_sd6g40_mode_args *ret_val)
{ … }
static int lan966x_calc_sd6g40_setup_lane(struct serdes_macro *macro,
struct lan966x_sd6g40_setup_args config,
struct lan966x_sd6g40_setup *ret_val)
{ … }
static int lan966x_sd6g40_setup_lane(struct serdes_macro *macro,
struct lan966x_sd6g40_setup_args config,
u32 idx)
{ … }
static int lan966x_sd6g40_setup(struct serdes_macro *macro, u32 idx, int mode)
{ … }
static int lan966x_rgmii_setup(struct serdes_macro *macro, u32 idx, int mode)
{ … }
static int serdes_set_speed(struct phy *phy, int speed)
{ … }
static int serdes_set_mode(struct phy *phy, enum phy_mode mode, int submode)
{ … }
static const struct phy_ops serdes_ops = …;
static struct phy *serdes_simple_xlate(struct device *dev,
const struct of_phandle_args *args)
{ … }
static int serdes_phy_create(struct serdes_ctrl *ctrl, u8 idx, struct phy **phy)
{ … }
static int serdes_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id serdes_ids[] = …;
MODULE_DEVICE_TABLE(of, serdes_ids);
static struct platform_driver mscc_lan966x_serdes = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;