ASoC: sti: rename unip player type into common player & reader type
Signed-off-by: Moise Gergaud <moise.gergaud@st.com> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
38535e8e69
commit
5295a0dc31
@ -1219,6 +1219,15 @@
|
|||||||
#define UNIPERIF_FIFO_SIZE 70 /* FIFO is 70 cells deep */
|
#define UNIPERIF_FIFO_SIZE 70 /* FIFO is 70 cells deep */
|
||||||
#define UNIPERIF_FIFO_FRAMES 4 /* FDMA trigger limit in frames */
|
#define UNIPERIF_FIFO_FRAMES 4 /* FDMA trigger limit in frames */
|
||||||
|
|
||||||
|
#define UNIPERIF_TYPE_IS_HDMI(p) \
|
||||||
|
((p)->info->type == SND_ST_UNIPERIF_TYPE_HDMI)
|
||||||
|
#define UNIPERIF_TYPE_IS_PCM(p) \
|
||||||
|
((p)->info->type == SND_ST_UNIPERIF_TYPE_PCM)
|
||||||
|
#define UNIPERIF_TYPE_IS_SPDIF(p) \
|
||||||
|
((p)->info->type == SND_ST_UNIPERIF_TYPE_SPDIF)
|
||||||
|
#define UNIPERIF_TYPE_IS_IEC958(p) \
|
||||||
|
(UNIPERIF_TYPE_IS_HDMI(p) || \
|
||||||
|
UNIPERIF_TYPE_IS_SPDIF(p))
|
||||||
/*
|
/*
|
||||||
* Uniperipheral IP revisions
|
* Uniperipheral IP revisions
|
||||||
*/
|
*/
|
||||||
@ -1237,10 +1246,10 @@ enum uniperif_version {
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum uniperif_type {
|
enum uniperif_type {
|
||||||
SND_ST_UNIPERIF_PLAYER_TYPE_NONE,
|
SND_ST_UNIPERIF_TYPE_NONE,
|
||||||
SND_ST_UNIPERIF_PLAYER_TYPE_HDMI,
|
SND_ST_UNIPERIF_TYPE_HDMI,
|
||||||
SND_ST_UNIPERIF_PLAYER_TYPE_PCM,
|
SND_ST_UNIPERIF_TYPE_PCM,
|
||||||
SND_ST_UNIPERIF_PLAYER_TYPE_SPDIF
|
SND_ST_UNIPERIF_TYPE_SPDIF
|
||||||
};
|
};
|
||||||
|
|
||||||
enum uniperif_state {
|
enum uniperif_state {
|
||||||
@ -1259,7 +1268,7 @@ enum uniperif_iec958_encoding_mode {
|
|||||||
|
|
||||||
struct uniperif_info {
|
struct uniperif_info {
|
||||||
int id; /* instance value of the uniperipheral IP */
|
int id; /* instance value of the uniperipheral IP */
|
||||||
enum uniperif_type player_type;
|
enum uniperif_type type;
|
||||||
int underflow_enabled; /* Underflow recovery mode */
|
int underflow_enabled; /* Underflow recovery mode */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -26,15 +26,6 @@
|
|||||||
/*
|
/*
|
||||||
* Driver specific types.
|
* Driver specific types.
|
||||||
*/
|
*/
|
||||||
#define UNIPERIF_PLAYER_TYPE_IS_HDMI(p) \
|
|
||||||
((p)->info->player_type == SND_ST_UNIPERIF_PLAYER_TYPE_HDMI)
|
|
||||||
#define UNIPERIF_PLAYER_TYPE_IS_PCM(p) \
|
|
||||||
((p)->info->player_type == SND_ST_UNIPERIF_PLAYER_TYPE_PCM)
|
|
||||||
#define UNIPERIF_PLAYER_TYPE_IS_SPDIF(p) \
|
|
||||||
((p)->info->player_type == SND_ST_UNIPERIF_PLAYER_TYPE_SPDIF)
|
|
||||||
#define UNIPERIF_PLAYER_TYPE_IS_IEC958(p) \
|
|
||||||
(UNIPERIF_PLAYER_TYPE_IS_HDMI(p) || \
|
|
||||||
UNIPERIF_PLAYER_TYPE_IS_SPDIF(p))
|
|
||||||
|
|
||||||
#define UNIPERIF_PLAYER_CLK_ADJ_MIN -999999
|
#define UNIPERIF_PLAYER_CLK_ADJ_MIN -999999
|
||||||
#define UNIPERIF_PLAYER_CLK_ADJ_MAX 1000000
|
#define UNIPERIF_PLAYER_CLK_ADJ_MAX 1000000
|
||||||
@ -738,14 +729,14 @@ static int uni_player_prepare(struct snd_pcm_substream *substream,
|
|||||||
SET_UNIPERIF_CONFIG_DMA_TRIG_LIMIT(player, trigger_limit);
|
SET_UNIPERIF_CONFIG_DMA_TRIG_LIMIT(player, trigger_limit);
|
||||||
|
|
||||||
/* Uniperipheral setup depends on player type */
|
/* Uniperipheral setup depends on player type */
|
||||||
switch (player->info->player_type) {
|
switch (player->info->type) {
|
||||||
case SND_ST_UNIPERIF_PLAYER_TYPE_HDMI:
|
case SND_ST_UNIPERIF_TYPE_HDMI:
|
||||||
ret = uni_player_prepare_iec958(player, runtime);
|
ret = uni_player_prepare_iec958(player, runtime);
|
||||||
break;
|
break;
|
||||||
case SND_ST_UNIPERIF_PLAYER_TYPE_PCM:
|
case SND_ST_UNIPERIF_TYPE_PCM:
|
||||||
ret = uni_player_prepare_pcm(player, runtime);
|
ret = uni_player_prepare_pcm(player, runtime);
|
||||||
break;
|
break;
|
||||||
case SND_ST_UNIPERIF_PLAYER_TYPE_SPDIF:
|
case SND_ST_UNIPERIF_TYPE_SPDIF:
|
||||||
ret = uni_player_prepare_iec958(player, runtime);
|
ret = uni_player_prepare_iec958(player, runtime);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -852,8 +843,8 @@ static int uni_player_start(struct uniperif *player)
|
|||||||
* will not take affect and hang the player.
|
* will not take affect and hang the player.
|
||||||
*/
|
*/
|
||||||
if (player->ver < SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0)
|
if (player->ver < SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0)
|
||||||
if (UNIPERIF_PLAYER_TYPE_IS_IEC958(player))
|
if (UNIPERIF_TYPE_IS_IEC958(player))
|
||||||
SET_UNIPERIF_CTRL_SPDIF_FMT_ON(player);
|
SET_UNIPERIF_CTRL_SPDIF_FMT_ON(player);
|
||||||
|
|
||||||
/* Force channel status update (no update if clk disable) */
|
/* Force channel status update (no update if clk disable) */
|
||||||
if (player->ver < SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0)
|
if (player->ver < SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0)
|
||||||
@ -1012,13 +1003,13 @@ static int uni_player_parse_dt(struct platform_device *pdev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (strcasecmp(mode, "hdmi") == 0)
|
if (strcasecmp(mode, "hdmi") == 0)
|
||||||
info->player_type = SND_ST_UNIPERIF_PLAYER_TYPE_HDMI;
|
info->type = SND_ST_UNIPERIF_TYPE_HDMI;
|
||||||
else if (strcasecmp(mode, "pcm") == 0)
|
else if (strcasecmp(mode, "pcm") == 0)
|
||||||
info->player_type = SND_ST_UNIPERIF_PLAYER_TYPE_PCM;
|
info->type = SND_ST_UNIPERIF_TYPE_PCM;
|
||||||
else if (strcasecmp(mode, "spdif") == 0)
|
else if (strcasecmp(mode, "spdif") == 0)
|
||||||
info->player_type = SND_ST_UNIPERIF_PLAYER_TYPE_SPDIF;
|
info->type = SND_ST_UNIPERIF_TYPE_SPDIF;
|
||||||
else
|
else
|
||||||
info->player_type = SND_ST_UNIPERIF_PLAYER_TYPE_NONE;
|
info->type = SND_ST_UNIPERIF_TYPE_NONE;
|
||||||
|
|
||||||
/* Save the info structure */
|
/* Save the info structure */
|
||||||
player->info = info;
|
player->info = info;
|
||||||
@ -1087,7 +1078,7 @@ int uni_player_init(struct platform_device *pdev,
|
|||||||
SET_UNIPERIF_CTRL_SPDIF_LAT_OFF(player);
|
SET_UNIPERIF_CTRL_SPDIF_LAT_OFF(player);
|
||||||
SET_UNIPERIF_CONFIG_IDLE_MOD_DISABLE(player);
|
SET_UNIPERIF_CONFIG_IDLE_MOD_DISABLE(player);
|
||||||
|
|
||||||
if (UNIPERIF_PLAYER_TYPE_IS_IEC958(player)) {
|
if (UNIPERIF_TYPE_IS_IEC958(player)) {
|
||||||
/* Set default iec958 status bits */
|
/* Set default iec958 status bits */
|
||||||
|
|
||||||
/* Consumer, PCM, copyright, 2ch, mode 0 */
|
/* Consumer, PCM, copyright, 2ch, mode 0 */
|
||||||
|
Loading…
Reference in New Issue
Block a user