Commit 6fee37df authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'asoc/topic/davinci', 'asoc/topic/fsl-card' and...

Merge remote-tracking branches 'asoc/topic/davinci', 'asoc/topic/fsl-card' and 'asoc/topic/fsl-mpc5200' into asoc-next
...@@ -24,6 +24,9 @@ The compatible list for this generic sound card currently: ...@@ -24,6 +24,9 @@ The compatible list for this generic sound card currently:
"fsl,imx-audio-cs42888" "fsl,imx-audio-cs42888"
"fsl,imx-audio-cs427x"
(compatible with CS4271 and CS4272)
"fsl,imx-audio-wm8962" "fsl,imx-audio-wm8962"
(compatible with Documentation/devicetree/bindings/sound/imx-audio-wm8962.txt) (compatible with Documentation/devicetree/bindings/sound/imx-audio-wm8962.txt)
...@@ -63,6 +66,12 @@ Optional properties: ...@@ -63,6 +66,12 @@ Optional properties:
- audio-asrc : The phandle of ASRC. It can be absent if there's no - audio-asrc : The phandle of ASRC. It can be absent if there's no
need to add ASRC support via DPCM. need to add ASRC support via DPCM.
Optional unless SSI is selected as a CPU DAI:
- mux-int-port : The internal port of the i.MX audio muxer (AUDMUX)
- mux-ext-port : The external port of the i.MX audio muxer
Example: Example:
sound-cs42888 { sound-cs42888 {
compatible = "fsl,imx-audio-cs42888"; compatible = "fsl,imx-audio-cs42888";
......
...@@ -5,7 +5,7 @@ config SND_DAVINCI_SOC ...@@ -5,7 +5,7 @@ config SND_DAVINCI_SOC
config SND_EDMA_SOC config SND_EDMA_SOC
tristate "SoC Audio for Texas Instruments chips using eDMA" tristate "SoC Audio for Texas Instruments chips using eDMA"
depends on SOC_AM33XX || SOC_AM43XX || ARCH_DAVINCI depends on TI_EDMA
select SND_SOC_GENERIC_DMAENGINE_PCM select SND_SOC_GENERIC_DMAENGINE_PCM
help help
Say Y or M here if you want audio support for TI SoC which uses eDMA. Say Y or M here if you want audio support for TI SoC which uses eDMA.
...@@ -13,6 +13,7 @@ config SND_EDMA_SOC ...@@ -13,6 +13,7 @@ config SND_EDMA_SOC
- daVinci devices - daVinci devices
- AM335x - AM335x
- AM437x/AM438x - AM437x/AM438x
- DRA7xx family
config SND_DAVINCI_SOC_I2S config SND_DAVINCI_SOC_I2S
tristate tristate
......
...@@ -77,6 +77,7 @@ struct davinci_mcasp { ...@@ -77,6 +77,7 @@ struct davinci_mcasp {
u32 fifo_base; u32 fifo_base;
struct device *dev; struct device *dev;
struct snd_pcm_substream *substreams[2]; struct snd_pcm_substream *substreams[2];
unsigned int dai_fmt;
/* McASP specific data */ /* McASP specific data */
int tdm_slots; int tdm_slots;
...@@ -398,6 +399,9 @@ static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai, ...@@ -398,6 +399,9 @@ static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai,
bool fs_pol_rising; bool fs_pol_rising;
bool inv_fs = false; bool inv_fs = false;
if (!fmt)
return 0;
pm_runtime_get_sync(mcasp->dev); pm_runtime_get_sync(mcasp->dev);
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_DSP_A: case SND_SOC_DAIFMT_DSP_A:
...@@ -529,6 +533,8 @@ static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai, ...@@ -529,6 +533,8 @@ static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai,
mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXPOL); mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXPOL);
mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, FSRPOL); mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, FSRPOL);
} }
mcasp->dai_fmt = fmt;
out: out:
pm_runtime_put(mcasp->dev); pm_runtime_put(mcasp->dev);
return ret; return ret;
...@@ -1026,6 +1032,10 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream, ...@@ -1026,6 +1032,10 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
int period_size = params_period_size(params); int period_size = params_period_size(params);
int ret; int ret;
ret = davinci_mcasp_set_dai_fmt(cpu_dai, mcasp->dai_fmt);
if (ret)
return ret;
/* /*
* If mcasp is BCLK master, and a BCLK divider was not provided by * If mcasp is BCLK master, and a BCLK divider was not provided by
* the machine driver, we need to calculate the ratio. * the machine driver, we need to calculate the ratio.
...@@ -1517,6 +1527,8 @@ static int mcasp_reparent_fck(struct platform_device *pdev) ...@@ -1517,6 +1527,8 @@ static int mcasp_reparent_fck(struct platform_device *pdev)
if (!parent_name) if (!parent_name)
return 0; return 0;
dev_warn(&pdev->dev, "Update the bindings to use assigned-clocks!\n");
gfclk = clk_get(&pdev->dev, "fck"); gfclk = clk_get(&pdev->dev, "fck");
if (IS_ERR(gfclk)) { if (IS_ERR(gfclk)) {
dev_err(&pdev->dev, "failed to get fck\n"); dev_err(&pdev->dev, "failed to get fck\n");
......
...@@ -292,8 +292,8 @@ config SND_SOC_FSL_ASOC_CARD ...@@ -292,8 +292,8 @@ config SND_SOC_FSL_ASOC_CARD
select SND_SOC_FSL_SSI select SND_SOC_FSL_SSI
help help
ALSA SoC Audio support with ASRC feature for Freescale SoCs that have ALSA SoC Audio support with ASRC feature for Freescale SoCs that have
ESAI/SAI/SSI and connect with external CODECs such as WM8962, CS42888 ESAI/SAI/SSI and connect with external CODECs such as WM8962, CS42888,
and SGTL5000. CS4271, CS4272 and SGTL5000.
Say Y if you want to add support for Freescale Generic ASoC Sound Card. Say Y if you want to add support for Freescale Generic ASoC Sound Card.
endif # SND_IMX_SOC endif # SND_IMX_SOC
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#include "../codecs/wm8962.h" #include "../codecs/wm8962.h"
#include "../codecs/wm8960.h" #include "../codecs/wm8960.h"
#define CS427x_SYSCLK_MCLK 0
#define RX 0 #define RX 0
#define TX 1 #define TX 1
...@@ -99,19 +101,26 @@ struct fsl_asoc_card_priv { ...@@ -99,19 +101,26 @@ struct fsl_asoc_card_priv {
/** /**
* This dapm route map exsits for DPCM link only. * This dapm route map exsits for DPCM link only.
* The other routes shall go through Device Tree. * The other routes shall go through Device Tree.
*
* Note: keep all ASRC routes in the second half
* to drop them easily for non-ASRC cases.
*/ */
static const struct snd_soc_dapm_route audio_map[] = { static const struct snd_soc_dapm_route audio_map[] = {
{"CPU-Playback", NULL, "ASRC-Playback"}, /* 1st half -- Normal DAPM routes */
{"Playback", NULL, "CPU-Playback"}, {"Playback", NULL, "CPU-Playback"},
{"ASRC-Capture", NULL, "CPU-Capture"},
{"CPU-Capture", NULL, "Capture"}, {"CPU-Capture", NULL, "Capture"},
/* 2nd half -- ASRC DAPM routes */
{"CPU-Playback", NULL, "ASRC-Playback"},
{"ASRC-Capture", NULL, "CPU-Capture"},
}; };
static const struct snd_soc_dapm_route audio_map_ac97[] = { static const struct snd_soc_dapm_route audio_map_ac97[] = {
{"AC97 Playback", NULL, "ASRC-Playback"}, /* 1st half -- Normal DAPM routes */
{"Playback", NULL, "AC97 Playback"}, {"Playback", NULL, "AC97 Playback"},
{"ASRC-Capture", NULL, "AC97 Capture"},
{"AC97 Capture", NULL, "Capture"}, {"AC97 Capture", NULL, "Capture"},
/* 2nd half -- ASRC DAPM routes */
{"AC97 Playback", NULL, "ASRC-Playback"},
{"ASRC-Capture", NULL, "AC97 Capture"},
}; };
/* Add all possible widgets into here without being redundant */ /* Add all possible widgets into here without being redundant */
...@@ -528,6 +537,10 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) ...@@ -528,6 +537,10 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
priv->cpu_priv.sysclk_dir[RX] = SND_SOC_CLOCK_OUT; priv->cpu_priv.sysclk_dir[RX] = SND_SOC_CLOCK_OUT;
priv->cpu_priv.slot_width = 32; priv->cpu_priv.slot_width = 32;
priv->dai_fmt |= SND_SOC_DAIFMT_CBS_CFS; priv->dai_fmt |= SND_SOC_DAIFMT_CBS_CFS;
} else if (of_device_is_compatible(np, "fsl,imx-audio-cs427x")) {
codec_dai_name = "cs4271-hifi";
priv->codec_priv.mclk_id = CS427x_SYSCLK_MCLK;
priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM;
} else if (of_device_is_compatible(np, "fsl,imx-audio-sgtl5000")) { } else if (of_device_is_compatible(np, "fsl,imx-audio-sgtl5000")) {
codec_dai_name = "sgtl5000"; codec_dai_name = "sgtl5000";
priv->codec_priv.mclk_id = SGTL5000_SYSCLK; priv->codec_priv.mclk_id = SGTL5000_SYSCLK;
...@@ -593,6 +606,10 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) ...@@ -593,6 +606,10 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
priv->card.dapm_widgets = fsl_asoc_card_dapm_widgets; priv->card.dapm_widgets = fsl_asoc_card_dapm_widgets;
priv->card.num_dapm_widgets = ARRAY_SIZE(fsl_asoc_card_dapm_widgets); priv->card.num_dapm_widgets = ARRAY_SIZE(fsl_asoc_card_dapm_widgets);
/* Drop the second half of DAPM routes -- ASRC */
if (!asrc_pdev)
priv->card.num_dapm_routes /= 2;
memcpy(priv->dai_link, fsl_asoc_card_dai, memcpy(priv->dai_link, fsl_asoc_card_dai,
sizeof(struct snd_soc_dai_link) * ARRAY_SIZE(priv->dai_link)); sizeof(struct snd_soc_dai_link) * ARRAY_SIZE(priv->dai_link));
...@@ -681,6 +698,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) ...@@ -681,6 +698,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
static const struct of_device_id fsl_asoc_card_dt_ids[] = { static const struct of_device_id fsl_asoc_card_dt_ids[] = {
{ .compatible = "fsl,imx-audio-ac97", }, { .compatible = "fsl,imx-audio-ac97", },
{ .compatible = "fsl,imx-audio-cs42888", }, { .compatible = "fsl,imx-audio-cs42888", },
{ .compatible = "fsl,imx-audio-cs427x", },
{ .compatible = "fsl,imx-audio-sgtl5000", }, { .compatible = "fsl,imx-audio-sgtl5000", },
{ .compatible = "fsl,imx-audio-wm8962", }, { .compatible = "fsl,imx-audio-wm8962", },
{ .compatible = "fsl,imx-audio-wm8960", }, { .compatible = "fsl,imx-audio-wm8960", },
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/time.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
...@@ -127,7 +128,7 @@ static void psc_ac97_cold_reset(struct snd_ac97 *ac97) ...@@ -127,7 +128,7 @@ static void psc_ac97_cold_reset(struct snd_ac97 *ac97)
mutex_unlock(&psc_dma->mutex); mutex_unlock(&psc_dma->mutex);
msleep(1); usleep_range(1000, 2000);
psc_ac97_warm_reset(ac97); psc_ac97_warm_reset(ac97);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment