linux/drivers/net/dsa/sja1105/sja1105_spi.c

// SPDX-License-Identifier: BSD-3-Clause
/* Copyright 2016-2018 NXP
 * Copyright (c) 2018, Sensor-Technik Wiedemann GmbH
 * Copyright (c) 2018-2019, Vladimir Oltean <[email protected]>
 */
#include <linux/spi/spi.h>
#include <linux/packing.h>
#include "sja1105.h"

struct sja1105_chunk {};

static void
sja1105_spi_message_pack(void *buf, const struct sja1105_spi_message *msg)
{}

/* If @rw is:
 * - SPI_WRITE: creates and sends an SPI write message at absolute
 *		address reg_addr, taking @len bytes from *buf
 * - SPI_READ:  creates and sends an SPI read message from absolute
 *		address reg_addr, writing @len bytes into *buf
 */
static int sja1105_xfer(const struct sja1105_private *priv,
			sja1105_spi_rw_mode_t rw, u64 reg_addr, u8 *buf,
			size_t len, struct ptp_system_timestamp *ptp_sts)
{}

int sja1105_xfer_buf(const struct sja1105_private *priv,
		     sja1105_spi_rw_mode_t rw, u64 reg_addr,
		     u8 *buf, size_t len)
{}

/* If @rw is:
 * - SPI_WRITE: creates and sends an SPI write message at absolute
 *		address reg_addr
 * - SPI_READ:  creates and sends an SPI read message from absolute
 *		address reg_addr
 *
 * The u64 *value is unpacked, meaning that it's stored in the native
 * CPU endianness and directly usable by software running on the core.
 */
int sja1105_xfer_u64(const struct sja1105_private *priv,
		     sja1105_spi_rw_mode_t rw, u64 reg_addr, u64 *value,
		     struct ptp_system_timestamp *ptp_sts)
{}

/* Same as above, but transfers only a 4 byte word */
int sja1105_xfer_u32(const struct sja1105_private *priv,
		     sja1105_spi_rw_mode_t rw, u64 reg_addr, u32 *value,
		     struct ptp_system_timestamp *ptp_sts)
{}

static int sja1105et_reset_cmd(struct dsa_switch *ds)
{}

static int sja1105pqrs_reset_cmd(struct dsa_switch *ds)
{}

static int sja1110_reset_cmd(struct dsa_switch *ds)
{}

int sja1105_inhibit_tx(const struct sja1105_private *priv,
		       unsigned long port_bitmap, bool tx_inhibited)
{}

struct sja1105_status {};

/* This is not reading the entire General Status area, which is also
 * divergent between E/T and P/Q/R/S, but only the relevant bits for
 * ensuring that the static config upload procedure was successful.
 */
static void sja1105_status_unpack(void *buf, struct sja1105_status *status)
{}

static int sja1105_status_get(struct sja1105_private *priv,
			      struct sja1105_status *status)
{}

/* Not const because unpacking priv->static_config into buffers and preparing
 * for upload requires the recalculation of table CRCs and updating the
 * structures with these.
 */
int static_config_buf_prepare_for_upload(struct sja1105_private *priv,
					 void *config_buf, int buf_len)
{}

#define RETRIES

int sja1105_static_config_upload(struct sja1105_private *priv)
{}

static const struct sja1105_regs sja1105et_regs =;

static const struct sja1105_regs sja1105pqrs_regs =;

static const struct sja1105_regs sja1110_regs =;

const struct sja1105_info sja1105e_info =;

const struct sja1105_info sja1105t_info =;

const struct sja1105_info sja1105p_info =;

const struct sja1105_info sja1105q_info =;

const struct sja1105_info sja1105r_info =;

const struct sja1105_info sja1105s_info =;

const struct sja1105_info sja1110a_info =;

const struct sja1105_info sja1110b_info =;

const struct sja1105_info sja1110c_info =;

const struct sja1105_info sja1110d_info =;