#include <linux/netdevice.h>
#include <linux/can.h>
#include <linux/can/dev.h>
#include <linux/can/error.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/ethtool.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/reset.h>
#define DRV_NAME …
#define SUN4I_REG_MSEL_ADDR …
#define SUN4I_REG_CMD_ADDR …
#define SUN4I_REG_STA_ADDR …
#define SUN4I_REG_INT_ADDR …
#define SUN4I_REG_INTEN_ADDR …
#define SUN4I_REG_BTIME_ADDR …
#define SUN4I_REG_TEWL_ADDR …
#define SUN4I_REG_ERRC_ADDR …
#define SUN4I_REG_RMCNT_ADDR …
#define SUN4I_REG_RBUFSA_ADDR …
#define SUN4I_REG_BUF0_ADDR …
#define SUN4I_REG_BUF1_ADDR …
#define SUN4I_REG_BUF2_ADDR …
#define SUN4I_REG_BUF3_ADDR …
#define SUN4I_REG_BUF4_ADDR …
#define SUN4I_REG_BUF5_ADDR …
#define SUN4I_REG_BUF6_ADDR …
#define SUN4I_REG_BUF7_ADDR …
#define SUN4I_REG_BUF8_ADDR …
#define SUN4I_REG_BUF9_ADDR …
#define SUN4I_REG_BUF10_ADDR …
#define SUN4I_REG_BUF11_ADDR …
#define SUN4I_REG_BUF12_ADDR …
#define SUN4I_REG_ACPC_ADDR …
#define SUN4I_REG_ACPM_ADDR …
#define SUN4I_REG_ACPC_ADDR_D1 …
#define SUN4I_REG_ACPM_ADDR_D1 …
#define SUN4I_REG_RBUF_RBACK_START_ADDR …
#define SUN4I_REG_RBUF_RBACK_END_ADDR …
#define SUN4I_MSEL_SLEEP_MODE …
#define SUN4I_MSEL_WAKE_UP …
#define SUN4I_MSEL_SINGLE_FILTER …
#define SUN4I_MSEL_DUAL_FILTERS …
#define SUN4I_MSEL_LOOPBACK_MODE …
#define SUN4I_MSEL_LISTEN_ONLY_MODE …
#define SUN4I_MSEL_RESET_MODE …
#define SUN4I_CMD_BUS_OFF_REQ …
#define SUN4I_CMD_SELF_RCV_REQ …
#define SUN4I_CMD_CLEAR_OR_FLAG …
#define SUN4I_CMD_RELEASE_RBUF …
#define SUN4I_CMD_ABORT_REQ …
#define SUN4I_CMD_TRANS_REQ …
#define SUN4I_STA_BIT_ERR …
#define SUN4I_STA_FORM_ERR …
#define SUN4I_STA_STUFF_ERR …
#define SUN4I_STA_OTHER_ERR …
#define SUN4I_STA_MASK_ERR …
#define SUN4I_STA_ERR_DIR …
#define SUN4I_STA_ERR_SEG_CODE …
#define SUN4I_STA_START …
#define SUN4I_STA_ID28_21 …
#define SUN4I_STA_ID20_18 …
#define SUN4I_STA_SRTR …
#define SUN4I_STA_IDE …
#define SUN4I_STA_ID17_13 …
#define SUN4I_STA_ID12_5 …
#define SUN4I_STA_ID4_0 …
#define SUN4I_STA_RTR …
#define SUN4I_STA_RB1 …
#define SUN4I_STA_RB0 …
#define SUN4I_STA_DLEN …
#define SUN4I_STA_DATA_FIELD …
#define SUN4I_STA_CRC_SEQUENCE …
#define SUN4I_STA_CRC_DELIMITER …
#define SUN4I_STA_ACK …
#define SUN4I_STA_ACK_DELIMITER …
#define SUN4I_STA_END …
#define SUN4I_STA_INTERMISSION …
#define SUN4I_STA_ACTIVE_ERROR …
#define SUN4I_STA_PASSIVE_ERROR …
#define SUN4I_STA_TOLERATE_DOMINANT_BITS …
#define SUN4I_STA_ERROR_DELIMITER …
#define SUN4I_STA_OVERLOAD …
#define SUN4I_STA_BUS_OFF …
#define SUN4I_STA_ERR_STA …
#define SUN4I_STA_TRANS_BUSY …
#define SUN4I_STA_RCV_BUSY …
#define SUN4I_STA_TRANS_OVER …
#define SUN4I_STA_TBUF_RDY …
#define SUN4I_STA_DATA_ORUN …
#define SUN4I_STA_RBUF_RDY …
#define SUN4I_INT_BUS_ERR …
#define SUN4I_INT_ARB_LOST …
#define SUN4I_INT_ERR_PASSIVE …
#define SUN4I_INT_WAKEUP …
#define SUN4I_INT_DATA_OR …
#define SUN4I_INT_ERR_WRN …
#define SUN4I_INT_TBUF_VLD …
#define SUN4I_INT_RBUF_VLD …
#define SUN4I_INTEN_BERR …
#define SUN4I_INTEN_ARB_LOST …
#define SUN4I_INTEN_ERR_PASSIVE …
#define SUN4I_INTEN_WAKEUP …
#define SUN4I_INTEN_OR …
#define SUN4I_INTEN_ERR_WRN …
#define SUN4I_INTEN_TX …
#define SUN4I_INTEN_RX …
#define SUN4I_ERR_INRCV …
#define SUN4I_ERR_INTRANS …
#define SUN4I_FILTER_CLOSE …
#define SUN4I_SINGLE_FLTER_MODE …
#define SUN4I_DUAL_FILTER_MODE …
#define SUN4I_MSG_EFF_FLAG …
#define SUN4I_MSG_RTR_FLAG …
#define SUN4I_CAN_MAX_IRQ …
#define SUN4I_MODE_MAX_RETRIES …
struct sun4ican_quirks { … };
struct sun4ican_priv { … };
static const struct can_bittiming_const sun4ican_bittiming_const = …;
static void sun4i_can_write_cmdreg(struct sun4ican_priv *priv, u8 val)
{ … }
static int set_normal_mode(struct net_device *dev)
{ … }
static int set_reset_mode(struct net_device *dev)
{ … }
static int sun4ican_set_bittiming(struct net_device *dev)
{ … }
static int sun4ican_get_berr_counter(const struct net_device *dev,
struct can_berr_counter *bec)
{ … }
static int sun4i_can_start(struct net_device *dev)
{ … }
static int sun4i_can_stop(struct net_device *dev)
{ … }
static int sun4ican_set_mode(struct net_device *dev, enum can_mode mode)
{ … }
static netdev_tx_t sun4ican_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ … }
static void sun4i_can_rx(struct net_device *dev)
{ … }
static int sun4i_can_err(struct net_device *dev, u8 isrc, u8 status)
{ … }
static irqreturn_t sun4i_can_interrupt(int irq, void *dev_id)
{ … }
static int sun4ican_open(struct net_device *dev)
{ … }
static int sun4ican_close(struct net_device *dev)
{ … }
static const struct net_device_ops sun4ican_netdev_ops = …;
static const struct ethtool_ops sun4ican_ethtool_ops = …;
static const struct sun4ican_quirks sun4ican_quirks_a10 = …;
static const struct sun4ican_quirks sun4ican_quirks_r40 = …;
static const struct sun4ican_quirks sun4ican_quirks_d1 = …;
static const struct of_device_id sun4ican_of_match[] = …;
MODULE_DEVICE_TABLE(of, sun4ican_of_match);
static void sun4ican_remove(struct platform_device *pdev)
{ … }
static int sun4ican_probe(struct platform_device *pdev)
{ … }
static struct platform_driver sun4i_can_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;