uniperif.h (e82a82c19f4272ea5437cc76e5711b98e2ee6223) uniperif.h (5a4326d1c21bc9aa958d5e621e06cd1b13e50711)
1/*
2 * Copyright (C) STMicroelectronics SA 2015
3 * Authors: Arnaud Pouliquen <arnaud.pouliquen@st.com>
4 * for STMicroelectronics.
5 * License terms: GNU General Public License (GPL), version 2
6 */
7
8#ifndef __SND_ST_AUD_UNIPERIF_H

--- 1206 unchanged lines hidden (view full) ---

1215/*
1216 * uniperipheral IP capabilities
1217 */
1218
1219#define UNIPERIF_FIFO_SIZE 70 /* FIFO is 70 cells deep */
1220#define UNIPERIF_FIFO_FRAMES 4 /* FDMA trigger limit in frames */
1221
1222#define UNIPERIF_TYPE_IS_HDMI(p) \
1/*
2 * Copyright (C) STMicroelectronics SA 2015
3 * Authors: Arnaud Pouliquen <arnaud.pouliquen@st.com>
4 * for STMicroelectronics.
5 * License terms: GNU General Public License (GPL), version 2
6 */
7
8#ifndef __SND_ST_AUD_UNIPERIF_H

--- 1206 unchanged lines hidden (view full) ---

1215/*
1216 * uniperipheral IP capabilities
1217 */
1218
1219#define UNIPERIF_FIFO_SIZE 70 /* FIFO is 70 cells deep */
1220#define UNIPERIF_FIFO_FRAMES 4 /* FDMA trigger limit in frames */
1221
1222#define UNIPERIF_TYPE_IS_HDMI(p) \
1223 ((p)->info->type == SND_ST_UNIPERIF_TYPE_HDMI)
1223 ((p)->type == SND_ST_UNIPERIF_TYPE_HDMI)
1224#define UNIPERIF_TYPE_IS_PCM(p) \
1224#define UNIPERIF_TYPE_IS_PCM(p) \
1225 ((p)->info->type == SND_ST_UNIPERIF_TYPE_PCM)
1225 ((p)->type == SND_ST_UNIPERIF_TYPE_PCM)
1226#define UNIPERIF_TYPE_IS_SPDIF(p) \
1226#define UNIPERIF_TYPE_IS_SPDIF(p) \
1227 ((p)->info->type == SND_ST_UNIPERIF_TYPE_SPDIF)
1227 ((p)->type == SND_ST_UNIPERIF_TYPE_SPDIF)
1228#define UNIPERIF_TYPE_IS_IEC958(p) \
1229 (UNIPERIF_TYPE_IS_HDMI(p) || \
1230 UNIPERIF_TYPE_IS_SPDIF(p))
1231#define UNIPERIF_TYPE_IS_TDM(p) \
1228#define UNIPERIF_TYPE_IS_IEC958(p) \
1229 (UNIPERIF_TYPE_IS_HDMI(p) || \
1230 UNIPERIF_TYPE_IS_SPDIF(p))
1231#define UNIPERIF_TYPE_IS_TDM(p) \
1232 ((p)->info->type == SND_ST_UNIPERIF_TYPE_TDM)
1232 ((p)->type == SND_ST_UNIPERIF_TYPE_TDM)
1233
1234/*
1235 * Uniperipheral IP revisions
1236 */
1237enum uniperif_version {
1238 SND_ST_UNIPERIF_VERSION_UNKNOWN,
1239 /* SASG1 (Orly), Newman */
1240 SND_ST_UNIPERIF_VERSION_C6AUD0_UNI_1_0,
1241 /* SASC1, SASG2 (Orly2) */
1242 SND_ST_UNIPERIF_VERSION_UNI_PLR_1_0,
1243 /* SASC1, SASG2 (Orly2), TELSS, Cannes */
1244 SND_ST_UNIPERIF_VERSION_UNI_RDR_1_0,
1245 /* TELSS (SASC1) */
1246 SND_ST_UNIPERIF_VERSION_TDM_PLR_1_0,
1247 /* Cannes/Monaco */
1248 SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0
1249};
1250
1251enum uniperif_type {
1233
1234/*
1235 * Uniperipheral IP revisions
1236 */
1237enum uniperif_version {
1238 SND_ST_UNIPERIF_VERSION_UNKNOWN,
1239 /* SASG1 (Orly), Newman */
1240 SND_ST_UNIPERIF_VERSION_C6AUD0_UNI_1_0,
1241 /* SASC1, SASG2 (Orly2) */
1242 SND_ST_UNIPERIF_VERSION_UNI_PLR_1_0,
1243 /* SASC1, SASG2 (Orly2), TELSS, Cannes */
1244 SND_ST_UNIPERIF_VERSION_UNI_RDR_1_0,
1245 /* TELSS (SASC1) */
1246 SND_ST_UNIPERIF_VERSION_TDM_PLR_1_0,
1247 /* Cannes/Monaco */
1248 SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0
1249};
1250
1251enum uniperif_type {
1252 SND_ST_UNIPERIF_TYPE_NONE,
1253 SND_ST_UNIPERIF_TYPE_HDMI,
1254 SND_ST_UNIPERIF_TYPE_PCM,
1255 SND_ST_UNIPERIF_TYPE_SPDIF,
1256 SND_ST_UNIPERIF_TYPE_TDM
1252 SND_ST_UNIPERIF_TYPE_NONE = 0x00,
1253 SND_ST_UNIPERIF_TYPE_HDMI = 0x01,
1254 SND_ST_UNIPERIF_TYPE_PCM = 0x02,
1255 SND_ST_UNIPERIF_TYPE_SPDIF = 0x04,
1256 SND_ST_UNIPERIF_TYPE_TDM = 0x08
1257};
1258
1259enum uniperif_state {
1260 UNIPERIF_STATE_STOPPED,
1261 UNIPERIF_STATE_STARTED,
1262 UNIPERIF_STATE_STANDBY,
1263 UNIPERIF_STATE_UNDERFLOW,
1264 UNIPERIF_STATE_OVERFLOW = UNIPERIF_STATE_UNDERFLOW,

--- 8 unchanged lines hidden (view full) ---

1273enum uniperif_word_pos {
1274 WORD_1_2,
1275 WORD_3_4,
1276 WORD_5_6,
1277 WORD_7_8,
1278 WORD_MAX
1279};
1280
1257};
1258
1259enum uniperif_state {
1260 UNIPERIF_STATE_STOPPED,
1261 UNIPERIF_STATE_STARTED,
1262 UNIPERIF_STATE_STANDBY,
1263 UNIPERIF_STATE_UNDERFLOW,
1264 UNIPERIF_STATE_OVERFLOW = UNIPERIF_STATE_UNDERFLOW,

--- 8 unchanged lines hidden (view full) ---

1273enum uniperif_word_pos {
1274 WORD_1_2,
1275 WORD_3_4,
1276 WORD_5_6,
1277 WORD_7_8,
1278 WORD_MAX
1279};
1280
1281struct uniperif_info {
1282 int id; /* instance value of the uniperipheral IP */
1283 enum uniperif_type type;
1284 int underflow_enabled; /* Underflow recovery mode */
1285};
1286
1287struct uniperif_iec958_settings {
1288 enum uniperif_iec958_encoding_mode encoding_mode;
1289 struct snd_aes_iec958 iec958;
1290};
1291
1292struct dai_tdm_slot {
1293 unsigned int mask;
1294 int slots;
1295 int slot_width;
1296 unsigned int avail_slots;
1297};
1298
1299struct uniperif {
1300 /* System information */
1281struct uniperif_iec958_settings {
1282 enum uniperif_iec958_encoding_mode encoding_mode;
1283 struct snd_aes_iec958 iec958;
1284};
1285
1286struct dai_tdm_slot {
1287 unsigned int mask;
1288 int slots;
1289 int slot_width;
1290 unsigned int avail_slots;
1291};
1292
1293struct uniperif {
1294 /* System information */
1301 struct uniperif_info *info;
1295 enum uniperif_type type;
1296 int underflow_enabled; /* Underflow recovery mode */
1302 struct device *dev;
1297 struct device *dev;
1298 int id; /* instance value of the uniperipheral IP */
1303 int ver; /* IP version, used by register access macros */
1304 struct regmap_field *clk_sel;
1305 struct regmap_field *valid_sel;
1306
1307 /* capabilities */
1308 const struct snd_pcm_hardware *hw;
1309
1310 /* Resources */

--- 107 unchanged lines hidden ---
1299 int ver; /* IP version, used by register access macros */
1300 struct regmap_field *clk_sel;
1301 struct regmap_field *valid_sel;
1302
1303 /* capabilities */
1304 const struct snd_pcm_hardware *hw;
1305
1306 /* Resources */

--- 107 unchanged lines hidden ---