linux/drivers/i3c/master/mipi-i3c-hci/pio.c

// SPDX-License-Identifier: BSD-3-Clause
/*
 * Copyright (c) 2020, MIPI Alliance, Inc.
 *
 * Author: Nicolas Pitre <[email protected]>
 */

#include <linux/bitfield.h>
#include <linux/device.h>
#include <linux/errno.h>
#include <linux/i3c/master.h>
#include <linux/io.h>

#include "hci.h"
#include "cmd.h"
#include "ibi.h"


/*
 * PIO Access Area
 */

#define pio_reg_read(r)
#define pio_reg_write(r, v)

#define PIO_COMMAND_QUEUE_PORT
#define PIO_RESPONSE_QUEUE_PORT
#define PIO_XFER_DATA_PORT
#define PIO_IBI_PORT

#define PIO_QUEUE_THLD_CTRL
#define QUEUE_IBI_STATUS_THLD
#define QUEUE_IBI_DATA_THLD
#define QUEUE_RESP_BUF_THLD
#define QUEUE_CMD_EMPTY_BUF_THLD

#define PIO_DATA_BUFFER_THLD_CTRL
#define DATA_RX_START_THLD
#define DATA_TX_START_THLD
#define DATA_RX_BUF_THLD
#define DATA_TX_BUF_THLD

#define PIO_QUEUE_SIZE
#define TX_DATA_BUFFER_SIZE
#define RX_DATA_BUFFER_SIZE
#define IBI_STATUS_SIZE
#define CR_QUEUE_SIZE

#define PIO_INTR_STATUS
#define PIO_INTR_STATUS_ENABLE
#define PIO_INTR_SIGNAL_ENABLE
#define PIO_INTR_FORCE
#define STAT_TRANSFER_BLOCKED
#define STAT_PERR_RESP_UFLOW
#define STAT_PERR_CMD_OFLOW
#define STAT_PERR_IBI_UFLOW
#define STAT_PERR_RX_UFLOW
#define STAT_PERR_TX_OFLOW
#define STAT_ERR_RESP_QUEUE_FULL
#define STAT_WARN_RESP_QUEUE_FULL
#define STAT_ERR_IBI_QUEUE_FULL
#define STAT_WARN_IBI_QUEUE_FULL
#define STAT_ERR_RX_DATA_FULL
#define STAT_WARN_RX_DATA_FULL
#define STAT_ERR_TX_DATA_EMPTY
#define STAT_WARN_TX_DATA_EMPTY
#define STAT_TRANSFER_ERR
#define STAT_WARN_INS_STOP_MODE
#define STAT_TRANSFER_ABORT
#define STAT_RESP_READY
#define STAT_CMD_QUEUE_READY
#define STAT_IBI_STATUS_THLD
#define STAT_RX_THLD
#define STAT_TX_THLD

#define PIO_QUEUE_CUR_STATUS
#define CUR_IBI_Q_LEVEL
#define CUR_RESP_Q_LEVEL
#define CUR_CMD_Q_EMPTY_LEVEL

#define PIO_DATA_BUFFER_CUR_STATUS
#define CUR_RX_BUF_LVL
#define CUR_TX_BUF_LVL

/*
 * Handy status bit combinations
 */

#define STAT_LATENCY_WARNINGS

#define STAT_LATENCY_ERRORS

#define STAT_PROG_ERRORS

#define STAT_ALL_ERRORS

struct hci_pio_dev_ibi_data {};

struct hci_pio_ibi_data {};

struct hci_pio_data {};

static int hci_pio_init(struct i3c_hci *hci)
{}

static void hci_pio_cleanup(struct i3c_hci *hci)
{}

static void hci_pio_write_cmd(struct i3c_hci *hci, struct hci_xfer *xfer)
{}

static bool hci_pio_do_rx(struct i3c_hci *hci, struct hci_pio_data *pio)
{}

static void hci_pio_do_trailing_rx(struct i3c_hci *hci,
				   struct hci_pio_data *pio, unsigned int count)
{}

static bool hci_pio_do_tx(struct i3c_hci *hci, struct hci_pio_data *pio)
{}

static bool hci_pio_process_rx(struct i3c_hci *hci, struct hci_pio_data *pio)
{}

static bool hci_pio_process_tx(struct i3c_hci *hci, struct hci_pio_data *pio)
{}

static void hci_pio_queue_data(struct i3c_hci *hci, struct hci_pio_data *pio)
{}

static void hci_pio_push_to_next_rx(struct i3c_hci *hci, struct hci_xfer *xfer,
				    unsigned int words_to_keep)
{}

static void hci_pio_err(struct i3c_hci *hci, struct hci_pio_data *pio,
			u32 status);

static bool hci_pio_process_resp(struct i3c_hci *hci, struct hci_pio_data *pio)
{}

static void hci_pio_queue_resp(struct i3c_hci *hci, struct hci_pio_data *pio)
{}

static bool hci_pio_process_cmd(struct i3c_hci *hci, struct hci_pio_data *pio)
{}

static int hci_pio_queue_xfer(struct i3c_hci *hci, struct hci_xfer *xfer, int n)
{}

static bool hci_pio_dequeue_xfer_common(struct i3c_hci *hci,
					struct hci_pio_data *pio,
					struct hci_xfer *xfer, int n)
{}

static bool hci_pio_dequeue_xfer(struct i3c_hci *hci, struct hci_xfer *xfer, int n)
{}

static void hci_pio_err(struct i3c_hci *hci, struct hci_pio_data *pio,
			u32 status)
{}

static void hci_pio_set_ibi_thresh(struct i3c_hci *hci,
				   struct hci_pio_data *pio,
				   unsigned int thresh_val)
{}

static bool hci_pio_get_ibi_segment(struct i3c_hci *hci,
				    struct hci_pio_data *pio)
{}

static bool hci_pio_prep_new_ibi(struct i3c_hci *hci, struct hci_pio_data *pio)
{}

static void hci_pio_free_ibi_slot(struct i3c_hci *hci, struct hci_pio_data *pio)
{}

static bool hci_pio_process_ibi(struct i3c_hci *hci, struct hci_pio_data *pio)
{}

static int hci_pio_request_ibi(struct i3c_hci *hci, struct i3c_dev_desc *dev,
			       const struct i3c_ibi_setup *req)
{}

static void hci_pio_free_ibi(struct i3c_hci *hci, struct i3c_dev_desc *dev)
{}

static void hci_pio_recycle_ibi_slot(struct i3c_hci *hci,
				    struct i3c_dev_desc *dev,
				    struct i3c_ibi_slot *slot)
{}

static bool hci_pio_irq_handler(struct i3c_hci *hci, unsigned int unused)
{}

const struct hci_io_ops mipi_i3c_hci_pio =;