linux/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c

// SPDX-License-Identifier: GPL-2.0
//
// mcp251xfd - Microchip MCP251xFD Family CAN controller driver
//
// Copyright (c) 2019, 2020, 2021, 2023 Pengutronix,
//               Marc Kleine-Budde <[email protected]>
//
// Based on:
//
// CAN bus driver for Microchip 25XXFD CAN Controller with SPI Interface
//
// Copyright (c) 2019 Martin Sperl <[email protected]>
//

#include <asm/unaligned.h>
#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/property.h>

#include "mcp251xfd.h"

#define DEVICE_NAME

static const struct mcp251xfd_devtype_data mcp251xfd_devtype_data_mcp2517fd =;

static const struct mcp251xfd_devtype_data mcp251xfd_devtype_data_mcp2518fd =;

static const struct mcp251xfd_devtype_data mcp251xfd_devtype_data_mcp251863 =;

/* Autodetect model, start with CRC enabled. */
static const struct mcp251xfd_devtype_data mcp251xfd_devtype_data_mcp251xfd =;

static const struct can_bittiming_const mcp251xfd_bittiming_const =;

static const struct can_bittiming_const mcp251xfd_data_bittiming_const =;

static const char *__mcp251xfd_get_model_str(enum mcp251xfd_model model)
{}

static inline const char *
mcp251xfd_get_model_str(const struct mcp251xfd_priv *priv)
{}

static const char *mcp251xfd_get_mode_str(const u8 mode)
{}

static const char *
mcp251xfd_get_osc_str(const u32 osc, const u32 osc_reference)
{}

static inline int mcp251xfd_vdd_enable(const struct mcp251xfd_priv *priv)
{}

static inline int mcp251xfd_vdd_disable(const struct mcp251xfd_priv *priv)
{}

static inline int
mcp251xfd_transceiver_enable(const struct mcp251xfd_priv *priv)
{}

static inline int
mcp251xfd_transceiver_disable(const struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_clks_and_vdd_enable(const struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_clks_and_vdd_disable(const struct mcp251xfd_priv *priv)
{}

static inline bool mcp251xfd_reg_invalid(u32 reg)
{}

static inline int
mcp251xfd_chip_get_mode(const struct mcp251xfd_priv *priv, u8 *mode)
{}

static int
__mcp251xfd_chip_set_mode(const struct mcp251xfd_priv *priv,
			  const u8 mode_req, bool nowait)
{}

static inline int
mcp251xfd_chip_set_mode(const struct mcp251xfd_priv *priv,
			const u8 mode_req)
{}

static inline int __maybe_unused
mcp251xfd_chip_set_mode_nowait(const struct mcp251xfd_priv *priv,
			       const u8 mode_req)
{}

static int
mcp251xfd_chip_wait_for_osc_ready(const struct mcp251xfd_priv *priv,
				  u32 osc_reference, u32 osc_mask)
{}

static int mcp251xfd_chip_wake(const struct mcp251xfd_priv *priv)
{}

static inline int mcp251xfd_chip_sleep(const struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_chip_softreset_do(const struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_chip_softreset_check(const struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_chip_softreset(const struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_chip_clock_init(const struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_chip_timestamp_init(const struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_set_bittiming(const struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_chip_rx_int_enable(const struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_chip_rx_int_disable(const struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_chip_ecc_init(struct mcp251xfd_priv *priv)
{}

static u8 mcp251xfd_get_normal_mode(const struct mcp251xfd_priv *priv)
{}

static int
__mcp251xfd_chip_set_normal_mode(const struct mcp251xfd_priv *priv,
				 bool nowait)
{}

static inline int
mcp251xfd_chip_set_normal_mode(const struct mcp251xfd_priv *priv)
{}

static inline int
mcp251xfd_chip_set_normal_mode_nowait(const struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_chip_interrupts_enable(const struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_chip_interrupts_disable(const struct mcp251xfd_priv *priv)
{}

static void mcp251xfd_chip_stop(struct mcp251xfd_priv *priv,
				const enum can_state state)
{}

static int mcp251xfd_chip_start(struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_set_mode(struct net_device *ndev, enum can_mode mode)
{}

static int __mcp251xfd_get_berr_counter(const struct net_device *ndev,
					struct can_berr_counter *bec)
{}

static int mcp251xfd_get_berr_counter(const struct net_device *ndev,
				      struct can_berr_counter *bec)
{}

static struct sk_buff *
mcp251xfd_alloc_can_err_skb(struct mcp251xfd_priv *priv,
			    struct can_frame **cf, u32 *ts_raw)
{}

static int mcp251xfd_handle_rxovif(struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_handle_txatif(struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_handle_ivmif(struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_handle_cerrif(struct mcp251xfd_priv *priv)
{}

static int
mcp251xfd_handle_modif(const struct mcp251xfd_priv *priv, bool *set_normal_mode)
{}

static int mcp251xfd_handle_serrif(struct mcp251xfd_priv *priv)
{}

static int
mcp251xfd_handle_eccif_recover(struct mcp251xfd_priv *priv, u8 nr)
{}

static int
mcp251xfd_handle_eccif(struct mcp251xfd_priv *priv, bool set_normal_mode)
{}

static int mcp251xfd_handle_spicrcif(struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_read_regs_status(struct mcp251xfd_priv *priv)
{}

#define mcp251xfd_handle(priv, irq, ...)

static irqreturn_t mcp251xfd_irq(int irq, void *dev_id)
{}

static int mcp251xfd_open(struct net_device *ndev)
{}

static int mcp251xfd_stop(struct net_device *ndev)
{}

static const struct net_device_ops mcp251xfd_netdev_ops =;

static void
mcp251xfd_register_quirks(struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_register_chip_detect(struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_register_check_rx_int(struct mcp251xfd_priv *priv)
{}

static int
mcp251xfd_register_get_dev_id(const struct mcp251xfd_priv *priv, u32 *dev_id,
			      u32 *effective_speed_hz_slow,
			      u32 *effective_speed_hz_fast)
{}

#define MCP251XFD_QUIRK_ACTIVE(quirk)

static int
mcp251xfd_register_done(const struct mcp251xfd_priv *priv)
{}

static int mcp251xfd_register(struct mcp251xfd_priv *priv)
{}

static inline void mcp251xfd_unregister(struct mcp251xfd_priv *priv)
{}

static const struct of_device_id mcp251xfd_of_match[] =;
MODULE_DEVICE_TABLE(of, mcp251xfd_of_match);

static const struct spi_device_id mcp251xfd_id_table[] =;
MODULE_DEVICE_TABLE(spi, mcp251xfd_id_table);

static int mcp251xfd_probe(struct spi_device *spi)
{}

static void mcp251xfd_remove(struct spi_device *spi)
{}

static int __maybe_unused mcp251xfd_runtime_suspend(struct device *device)
{}

static int __maybe_unused mcp251xfd_runtime_resume(struct device *device)
{}

static const struct dev_pm_ops mcp251xfd_pm_ops =;

static struct spi_driver mcp251xfd_driver =;
module_spi_driver();

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