linux/drivers/staging/greybus/spilib.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Greybus SPI library
 *
 * Copyright 2014-2016 Google Inc.
 * Copyright 2014-2016 Linaro Ltd.
 */

#include <linux/bitops.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/greybus.h>
#include <linux/spi/spi.h>

#include "spilib.h"

struct gb_spilib {};

#define GB_SPI_STATE_MSG_DONE
#define GB_SPI_STATE_MSG_IDLE
#define GB_SPI_STATE_MSG_RUNNING
#define GB_SPI_STATE_OP_READY
#define GB_SPI_STATE_OP_DONE
#define GB_SPI_STATE_MSG_ERROR

#define XFER_TIMEOUT_TOLERANCE

static struct spi_controller *get_controller_from_spi(struct gb_spilib *spi)
{}

static int tx_header_fit_operation(u32 tx_size, u32 count, size_t data_max)
{}

static size_t calc_rx_xfer_size(u32 rx_size, u32 *tx_xfer_size, u32 len,
				size_t data_max)
{}

static size_t calc_tx_xfer_size(u32 tx_size, u32 count, size_t len,
				size_t data_max)
{}

static void clean_xfer_state(struct gb_spilib *spi)
{}

static bool is_last_xfer_done(struct gb_spilib *spi)
{}

static int setup_next_xfer(struct gb_spilib *spi, struct spi_message *msg)
{}

static struct spi_transfer *get_next_xfer(struct spi_transfer *xfer,
					  struct spi_message *msg)
{}

/* Routines to transfer data */
static struct gb_operation *gb_spi_operation_create(struct gb_spilib *spi,
		struct gb_connection *connection, struct spi_message *msg)
{}

static void gb_spi_decode_response(struct gb_spilib *spi,
				   struct spi_message *msg,
				   struct gb_spi_transfer_response *response)
{}

static int gb_spi_transfer_one_message(struct spi_controller *ctlr,
				       struct spi_message *msg)
{}

static int gb_spi_prepare_transfer_hardware(struct spi_controller *ctlr)
{}

static int gb_spi_unprepare_transfer_hardware(struct spi_controller *ctlr)
{}

static int gb_spi_setup(struct spi_device *spi)
{}

static void gb_spi_cleanup(struct spi_device *spi)
{}

/* Routines to get controller information */

/*
 * Map Greybus spi mode bits/flags/bpw into Linux ones.
 * All bits are same for now and so these macro's return same values.
 */
#define gb_spi_mode_map(mode)
#define gb_spi_flags_map(flags)

static int gb_spi_get_master_config(struct gb_spilib *spi)
{}

static int gb_spi_setup_device(struct gb_spilib *spi, u8 cs)
{}

int gb_spilib_master_init(struct gb_connection *connection, struct device *dev,
			  struct spilib_ops *ops)
{}
EXPORT_SYMBOL_GPL();

void gb_spilib_master_exit(struct gb_connection *connection)
{}
EXPORT_SYMBOL_GPL();

MODULE_DESCRIPTION();
MODULE_LICENSE();