linux/drivers/staging/greybus/audio_apbridgea.h

/* SPDX-License-Identifier: BSD-3-Clause */
/*
 * Copyright (c) 2015-2016 Google Inc.
 */
/*
 * This is a special protocol for configuring communication over the
 * I2S bus between the DSP on the MSM8994 and APBridgeA.  Therefore,
 * we can predefine several low-level attributes of the communication
 * because we know that they are supported.  In particular, the following
 * assumptions are made:
 *	- there are two channels (i.e., stereo)
 *	- the low-level protocol is I2S as defined by Philips/NXP
 *	- the DSP on the MSM8994 is the clock master for MCLK, BCLK, and WCLK
 *	- WCLK changes on the falling edge of BCLK
 *	- WCLK low for left channel; high for right channel
 *	- TX data is sent on the falling edge of BCLK
 *	- RX data is received/latched on the rising edge of BCLK
 */

#ifndef __AUDIO_APBRIDGEA_H
#define __AUDIO_APBRIDGEA_H

#define AUDIO_APBRIDGEA_TYPE_SET_CONFIG
#define AUDIO_APBRIDGEA_TYPE_REGISTER_CPORT
#define AUDIO_APBRIDGEA_TYPE_UNREGISTER_CPORT
#define AUDIO_APBRIDGEA_TYPE_SET_TX_DATA_SIZE
							/* 0x05 unused */
#define AUDIO_APBRIDGEA_TYPE_PREPARE_TX
#define AUDIO_APBRIDGEA_TYPE_START_TX
#define AUDIO_APBRIDGEA_TYPE_STOP_TX
#define AUDIO_APBRIDGEA_TYPE_SHUTDOWN_TX
#define AUDIO_APBRIDGEA_TYPE_SET_RX_DATA_SIZE
							/* 0x0b unused */
#define AUDIO_APBRIDGEA_TYPE_PREPARE_RX
#define AUDIO_APBRIDGEA_TYPE_START_RX
#define AUDIO_APBRIDGEA_TYPE_STOP_RX
#define AUDIO_APBRIDGEA_TYPE_SHUTDOWN_RX

#define AUDIO_APBRIDGEA_PCM_FMT_8
#define AUDIO_APBRIDGEA_PCM_FMT_16
#define AUDIO_APBRIDGEA_PCM_FMT_24
#define AUDIO_APBRIDGEA_PCM_FMT_32
#define AUDIO_APBRIDGEA_PCM_FMT_64

#define AUDIO_APBRIDGEA_PCM_RATE_5512
#define AUDIO_APBRIDGEA_PCM_RATE_8000
#define AUDIO_APBRIDGEA_PCM_RATE_11025
#define AUDIO_APBRIDGEA_PCM_RATE_16000
#define AUDIO_APBRIDGEA_PCM_RATE_22050
#define AUDIO_APBRIDGEA_PCM_RATE_32000
#define AUDIO_APBRIDGEA_PCM_RATE_44100
#define AUDIO_APBRIDGEA_PCM_RATE_48000
#define AUDIO_APBRIDGEA_PCM_RATE_64000
#define AUDIO_APBRIDGEA_PCM_RATE_88200
#define AUDIO_APBRIDGEA_PCM_RATE_96000
#define AUDIO_APBRIDGEA_PCM_RATE_176400
#define AUDIO_APBRIDGEA_PCM_RATE_192000

#define AUDIO_APBRIDGEA_DIRECTION_TX
#define AUDIO_APBRIDGEA_DIRECTION_RX

/* The I2S port is passed in the 'index' parameter of the USB request */
/* The CPort is passed in the 'value' parameter of the USB request */

struct audio_apbridgea_hdr {} __packed;

struct audio_apbridgea_set_config_request {} __packed;

struct audio_apbridgea_register_cport_request {} __packed;

struct audio_apbridgea_unregister_cport_request {} __packed;

struct audio_apbridgea_set_tx_data_size_request {} __packed;

struct audio_apbridgea_prepare_tx_request {} __packed;

struct audio_apbridgea_start_tx_request {} __packed;

struct audio_apbridgea_stop_tx_request {} __packed;

struct audio_apbridgea_shutdown_tx_request {} __packed;

struct audio_apbridgea_set_rx_data_size_request {} __packed;

struct audio_apbridgea_prepare_rx_request {} __packed;

struct audio_apbridgea_start_rx_request {} __packed;

struct audio_apbridgea_stop_rx_request {} __packed;

struct audio_apbridgea_shutdown_rx_request {} __packed;

#endif /*__AUDIO_APBRIDGEA_H */