summaryrefslogtreecommitdiff
path: root/sound/soc/ux500
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/ux500')
-rw-r--r--sound/soc/ux500/ux500_ab5500.c2
-rw-r--r--sound/soc/ux500/ux500_ab8500.c11
-rw-r--r--sound/soc/ux500/ux500_av8100.c6
-rw-r--r--sound/soc/ux500/ux500_cg29xx.c10
-rw-r--r--sound/soc/ux500/ux500_msp_dai.c30
5 files changed, 25 insertions, 34 deletions
diff --git a/sound/soc/ux500/ux500_ab5500.c b/sound/soc/ux500/ux500_ab5500.c
index 5b4e5576cf0..6dbf72e9153 100644
--- a/sound/soc/ux500/ux500_ab5500.c
+++ b/sound/soc/ux500/ux500_ab5500.c
@@ -53,7 +53,7 @@ int ux500_ab5500_hw_params(struct snd_pcm_substream *substream,
ret = snd_soc_dai_set_fmt(cpu_dai,
SND_SOC_DAIFMT_I2S |
SND_SOC_DAIFMT_CBM_CFM |
- SND_SOC_DAIFMT_IB_IF);
+ SND_SOC_DAIFMT_NB_NF);
if (ret < 0)
return ret;
ux500_msp_dai_set_data_delay(cpu_dai, MSP_DELAY_1);
diff --git a/sound/soc/ux500/ux500_ab8500.c b/sound/soc/ux500/ux500_ab8500.c
index 2eef499d22e..5860e05a1dd 100644
--- a/sound/soc/ux500/ux500_ab8500.c
+++ b/sound/soc/ux500/ux500_ab8500.c
@@ -525,17 +525,18 @@ int ux500_ab8500_hw_params(struct snd_pcm_substream *substream,
pr_debug("%s: Driver-mode: %s.\n",
__func__,
(driver_mode == DRIVERMODE_NORMAL) ? "NORMAL" : "CODEC_ONLY");
+
+ ab8500_audio_set_bit_delay(codec_dai, 1);
+
if (driver_mode == DRIVERMODE_NORMAL) {
- ab8500_audio_set_bit_delay(codec_dai, 0);
ab8500_audio_set_word_length(codec_dai, 16);
- fmt = SND_SOC_DAIFMT_DSP_B |
+ fmt = SND_SOC_DAIFMT_DSP_A |
SND_SOC_DAIFMT_CBM_CFM |
SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_CONT;
} else {
- ab8500_audio_set_bit_delay(codec_dai, 1);
ab8500_audio_set_word_length(codec_dai, 20);
- fmt = SND_SOC_DAIFMT_DSP_B |
+ fmt = SND_SOC_DAIFMT_DSP_A |
SND_SOC_DAIFMT_CBM_CFM |
SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_GATED;
@@ -557,6 +558,8 @@ int ux500_ab8500_hw_params(struct snd_pcm_substream *substream,
return ret;
}
+ ux500_msp_dai_set_data_delay(cpu_dai, MSP_DELAY_1);
+
/* Setup TDM-slots */
streamIsPlayback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK);
diff --git a/sound/soc/ux500/ux500_av8100.c b/sound/soc/ux500/ux500_av8100.c
index a1be8d15c72..becf81a07e0 100644
--- a/sound/soc/ux500/ux500_av8100.c
+++ b/sound/soc/ux500/ux500_av8100.c
@@ -112,7 +112,7 @@ static int ux500_av8100_hw_params(struct snd_pcm_substream *substream,
}
/* Set format for codec-DAI */
- fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBM_CFM;
+ fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_CBM_CFM;
pr_debug("%s: Setting format for codec-DAI (fmt = %d).\n",
__func__,
fmt);
@@ -139,7 +139,7 @@ static int ux500_av8100_hw_params(struct snd_pcm_substream *substream,
}
/* Set format for CPU-DAI */
- fmt = SND_SOC_DAIFMT_DSP_B |
+ fmt = SND_SOC_DAIFMT_DSP_A |
SND_SOC_DAIFMT_CBM_CFM |
SND_SOC_DAIFMT_NB_IF;
pr_debug("%s: Setting DAI-format for Ux500-platform (fmt = %d).\n",
@@ -154,8 +154,6 @@ static int ux500_av8100_hw_params(struct snd_pcm_substream *substream,
return ret;
}
- ux500_msp_dai_set_data_delay(cpu_dai, MSP_DELAY_1);
-
return ret;
}
diff --git a/sound/soc/ux500/ux500_cg29xx.c b/sound/soc/ux500/ux500_cg29xx.c
index 8301a80f54d..bb95bc2c306 100644
--- a/sound/soc/ux500/ux500_cg29xx.c
+++ b/sound/soc/ux500/ux500_cg29xx.c
@@ -19,7 +19,7 @@
#define UX500_CG29XX_MSP_CLOCK_FREQ 18900000
#define UX500_CG29XX_DAI_SLOT_WIDTH 16
#define UX500_CG29XX_DAI_SLOTS 2
-#define UX500_CG29XX_DAI_ACTIVE_SLOTS 0x01
+#define UX500_CG29XX_DAI_ACTIVE_SLOTS 0x02
int ux500_cg29xx_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
@@ -40,7 +40,7 @@ int ux500_cg29xx_hw_params(struct snd_pcm_substream *substream,
pr_debug("%s: DAI-index (Platform): %d\n", __func__, cpu_dai->id);
err = snd_soc_dai_set_fmt(codec_dai,
- SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_CBS_CFS);
+ SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBS_CFS);
if (err) {
pr_err("%s: snd_soc_dai_set_fmt(codec) failed with %d.\n",
@@ -63,7 +63,7 @@ int ux500_cg29xx_hw_params(struct snd_pcm_substream *substream,
}
err = snd_soc_dai_set_fmt(cpu_dai,
- SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_CBS_CFS |
+ SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBS_CFS |
SND_SOC_DAIFMT_NB_NF);
if (err) {
@@ -148,7 +148,7 @@ int u5500_cg29xx_hw_params(struct snd_pcm_substream *substream,
}
} else {
err = snd_soc_dai_set_fmt(codec_dai,
- SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_CBS_CFS);
+ SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBS_CFS);
if (err) {
pr_err("%s: snd_soc_dai_set_fmt(codec) failed with %d.\n",
__func__,
@@ -170,7 +170,7 @@ int u5500_cg29xx_hw_params(struct snd_pcm_substream *substream,
}
err = snd_soc_dai_set_fmt(cpu_dai,
- SND_SOC_DAIFMT_DSP_A |
+ SND_SOC_DAIFMT_DSP_B |
SND_SOC_DAIFMT_CBS_CFS |
SND_SOC_DAIFMT_NB_NF);
diff --git a/sound/soc/ux500/ux500_msp_dai.c b/sound/soc/ux500/ux500_msp_dai.c
index 1eb8cf88323..6cdc96734ed 100644
--- a/sound/soc/ux500/ux500_msp_dai.c
+++ b/sound/soc/ux500/ux500_msp_dai.c
@@ -339,32 +339,18 @@ static void ux500_msp_dai_setup_clocking(unsigned int fmt,
switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
default:
case SND_SOC_DAIFMT_NB_NF:
- msp_config->tx_frame_sync_pol =
- MSP_FRAME_SYNC_POL(MSP_FRAME_SYNC_POL_ACTIVE_HIGH);
- msp_config->rx_frame_sync_pol =
- MSP_FRAME_SYNC_POL_ACTIVE_HIGH << RFSPOL_SHIFT;
break;
case SND_SOC_DAIFMT_NB_IF:
- msp_config->tx_frame_sync_pol =
- MSP_FRAME_SYNC_POL(MSP_FRAME_SYNC_POL_ACTIVE_LOW);
- msp_config->rx_frame_sync_pol =
- MSP_FRAME_SYNC_POL_ACTIVE_LOW << RFSPOL_SHIFT;
- break;
-
- case SND_SOC_DAIFMT_IB_IF:
- msp_config->iodelay = 0x20;
- msp_config->protocol_desc.tx_clock_pol = 1;
- msp_config->tx_frame_sync_pol = 1 << TFSPOL_SHIFT;
- msp_config->protocol_desc.rx_clock_pol = 1;
- msp_config->rx_frame_sync_pol = 1 << RFSPOL_SHIFT;
+ msp_config->tx_frame_sync_pol ^= 1 << TFSPOL_SHIFT;
+ msp_config->rx_frame_sync_pol ^= 1 << RFSPOL_SHIFT;
break;
}
if ((fmt & SND_SOC_DAIFMT_MASTER_MASK) == SND_SOC_DAIFMT_CBM_CFM) {
pr_debug("%s: Codec is MASTER.\n",
__func__);
-
+ msp_config->iodelay = 0x20;
msp_config->rx_frame_sync_sel = 0;
msp_config->tx_frame_sync_sel = 1 << TFSSEL_SHIFT;
msp_config->tx_clock_sel = 0;
@@ -392,17 +378,19 @@ static void ux500_msp_dai_compile_prot_desc_pcm(unsigned int fmt,
prot_desc->tx_phase2_start_mode = MSP_PHASE2_START_MODE_IMEDIATE;
prot_desc->rx_bit_transfer_format = MSP_BTF_MS_BIT_FIRST;
prot_desc->tx_bit_transfer_format = MSP_BTF_MS_BIT_FIRST;
+ prot_desc->tx_frame_sync_pol = MSP_FRAME_SYNC_POL(MSP_FRAME_SYNC_POL_ACTIVE_HIGH);
+ prot_desc->rx_frame_sync_pol = MSP_FRAME_SYNC_POL_ACTIVE_HIGH << RFSPOL_SHIFT;
if ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_DSP_A) {
pr_debug("%s: DSP_A.\n",
__func__);
+ prot_desc->rx_clock_pol = MSP_RISING_EDGE;
prot_desc->tx_clock_pol = MSP_FALLING_EDGE;
- prot_desc->rx_clock_pol = MSP_FALLING_EDGE;
} else {
pr_debug("%s: DSP_B.\n",
__func__);
+ prot_desc->rx_clock_pol = MSP_FALLING_EDGE;
prot_desc->tx_clock_pol = MSP_RISING_EDGE;
- prot_desc->rx_clock_pol = MSP_RISING_EDGE;
}
prot_desc->rx_half_word_swap = MSP_HWS_NO_SWAP;
@@ -424,6 +412,8 @@ static void ux500_msp_dai_compile_prot_desc_i2s(struct msp_protocol_desc *prot_d
MSP_PHASE2_START_MODE_FRAME_SYNC;
prot_desc->rx_bit_transfer_format = MSP_BTF_MS_BIT_FIRST;
prot_desc->tx_bit_transfer_format = MSP_BTF_MS_BIT_FIRST;
+ prot_desc->tx_frame_sync_pol = MSP_FRAME_SYNC_POL(MSP_FRAME_SYNC_POL_ACTIVE_LOW);
+ prot_desc->rx_frame_sync_pol = MSP_FRAME_SYNC_POL_ACTIVE_LOW << RFSPOL_SHIFT;
prot_desc->rx_frame_length_1 = MSP_FRAME_LENGTH_1;
prot_desc->rx_frame_length_2 = MSP_FRAME_LENGTH_1;
@@ -435,7 +425,7 @@ static void ux500_msp_dai_compile_prot_desc_i2s(struct msp_protocol_desc *prot_d
prot_desc->tx_element_length_2 = MSP_ELEM_LENGTH_16;
prot_desc->rx_clock_pol = MSP_RISING_EDGE;
- prot_desc->tx_clock_pol = MSP_RISING_EDGE;
+ prot_desc->tx_clock_pol = MSP_FALLING_EDGE;
prot_desc->tx_half_word_swap = MSP_HWS_NO_SWAP;
prot_desc->rx_half_word_swap = MSP_HWS_NO_SWAP;