linux/drivers/i3c/master/mipi-i3c-hci/xfer_mode_rate.h

/* SPDX-License-Identifier: BSD-3-Clause */
/*
 * Copyright (c) 2020, MIPI Alliance, Inc.
 *
 * Author: Nicolas Pitre <[email protected]>
 *
 * Transfer Mode/Rate Table definitions as found in extended capability
 * sections 0x04 and 0x08.
 * This applies starting from I3C HCI v2.0.
 */

#ifndef XFER_MODE_RATE_H
#define XFER_MODE_RATE_H

/*
 * Master Transfer Mode Table Fixed Indexes.
 *
 * Indexes 0x0 and 0x8 are mandatory. Availability for the rest must be
 * obtained from the mode table in the extended capability area.
 * Presence and definitions for indexes beyond these ones may vary.
 */
#define XFERMODE_IDX_I3C_SDR
#define XFERMODE_IDX_I3C_HDR_DDR
#define XFERMODE_IDX_I3C_HDR_T
#define XFERMODE_IDX_I3C_HDR_BT
#define XFERMODE_IDX_I2C

/*
 * Transfer Mode Table Entry Bits Definitions
 */
#define XFERMODE_VALID_XFER_ADD_FUNC
#define XFERMODE_ML_DATA_XFER_CODING
#define XFERMODE_ML_ADDL_LANES
#define XFERMODE_SUPPORTED
#define XFERMODE_MODE

/*
 * Master Data Transfer Rate Selector Values.
 *
 * These are the values to be used in the command descriptor XFER_RATE field
 * and found in the RATE_ID field below.
 * The I3C_SDR0, I3C_SDR1, I3C_SDR2, I3C_SDR3, I3C_SDR4 and I2C_FM rates
 * are required, everything else is optional and discoverable in the
 * Data Transfer Rate Table. Indicated are typical rates. The actual
 * rates may vary slightly and are also specified in the Data Transfer
 * Rate Table.
 */
#define XFERRATE_I3C_SDR0
#define XFERRATE_I3C_SDR1
#define XFERRATE_I3C_SDR2
#define XFERRATE_I3C_SDR3
#define XFERRATE_I3C_SDR4
#define XFERRATE_I3C_SDR_FM_FMP
#define XFERRATE_I3C_SDR_USER6
#define XFERRATE_I3C_SDR_USER7

#define XFERRATE_I2C_FM
#define XFERRATE_I2C_FMP
#define XFERRATE_I2C_USER2
#define XFERRATE_I2C_USER3
#define XFERRATE_I2C_USER4
#define XFERRATE_I2C_USER5
#define XFERRATE_I2C_USER6
#define XFERRATE_I2C_USER7

/*
 * Master Data Transfer Rate Table Mode ID values.
 */
#define XFERRATE_MODE_I3C
#define XFERRATE_MODE_I2C

/*
 * Master Data Transfer Rate Table Entry Bits Definitions
 */
#define XFERRATE_MODE_ID
#define XFERRATE_RATE_ID
#define XFERRATE_ACTUAL_RATE_KHZ

#endif