forked from luck/tmp_suning_uos_patched
Merge remote-tracking branches 'asoc/topic/mtk', 'asoc/topic/mxs', 'asoc/topic/nau8825', 'asoc/topic/nuc900' and 'asoc/topic/of-graph' into asoc-next
This commit is contained in:
commit
af4f47717f
|
@ -3,7 +3,8 @@ Mediatek AFE PCM controller for mt2701
|
||||||
Required properties:
|
Required properties:
|
||||||
- compatible = "mediatek,mt2701-audio";
|
- compatible = "mediatek,mt2701-audio";
|
||||||
- reg: register location and size
|
- reg: register location and size
|
||||||
- interrupts: Should contain AFE interrupt
|
- interrupts: should contain AFE and ASYS interrupts
|
||||||
|
- interrupt-names: should be "afe" and "asys"
|
||||||
- power-domains: should define the power domain
|
- power-domains: should define the power domain
|
||||||
- clock-names: should have these clock names:
|
- clock-names: should have these clock names:
|
||||||
"infra_sys_audio_clk",
|
"infra_sys_audio_clk",
|
||||||
|
@ -59,6 +60,7 @@ Example:
|
||||||
<0 0x112A0000 0 0x20000>;
|
<0 0x112A0000 0 0x20000>;
|
||||||
interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_LOW>,
|
interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_LOW>,
|
||||||
<GIC_SPI 132 IRQ_TYPE_LEVEL_LOW>;
|
<GIC_SPI 132 IRQ_TYPE_LEVEL_LOW>;
|
||||||
|
interrupt-names = "afe", "asys";
|
||||||
power-domains = <&scpsys MT2701_POWER_DOMAIN_IFR_MSC>;
|
power-domains = <&scpsys MT2701_POWER_DOMAIN_IFR_MSC>;
|
||||||
clocks = <&infracfg CLK_INFRA_AUDIO>,
|
clocks = <&infracfg CLK_INFRA_AUDIO>,
|
||||||
<&topckgen CLK_TOP_AUD_MUX1_SEL>,
|
<&topckgen CLK_TOP_AUD_MUX1_SEL>,
|
||||||
|
|
|
@ -260,11 +260,11 @@ static int nau8825_sema_acquire(struct nau8825 *nau8825, long timeout)
|
||||||
if (timeout) {
|
if (timeout) {
|
||||||
ret = down_timeout(&nau8825->xtalk_sem, timeout);
|
ret = down_timeout(&nau8825->xtalk_sem, timeout);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
dev_warn(nau8825->dev, "Acquire semaphone timeout\n");
|
dev_warn(nau8825->dev, "Acquire semaphore timeout\n");
|
||||||
} else {
|
} else {
|
||||||
ret = down_interruptible(&nau8825->xtalk_sem);
|
ret = down_interruptible(&nau8825->xtalk_sem);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
dev_warn(nau8825->dev, "Acquire semaphone fail\n");
|
dev_warn(nau8825->dev, "Acquire semaphore fail\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1299,7 +1299,7 @@ static int nau8825_hw_params(struct snd_pcm_substream *substream,
|
||||||
regmap_update_bits(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL1,
|
regmap_update_bits(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL1,
|
||||||
NAU8825_I2S_DL_MASK, val_len);
|
NAU8825_I2S_DL_MASK, val_len);
|
||||||
|
|
||||||
/* Release the semaphone. */
|
/* Release the semaphore. */
|
||||||
nau8825_sema_release(nau8825);
|
nau8825_sema_release(nau8825);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1361,7 +1361,7 @@ static int nau8825_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
|
||||||
regmap_update_bits(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL2,
|
regmap_update_bits(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL2,
|
||||||
NAU8825_I2S_MS_MASK, ctrl2_val);
|
NAU8825_I2S_MS_MASK, ctrl2_val);
|
||||||
|
|
||||||
/* Release the semaphone. */
|
/* Release the semaphore. */
|
||||||
nau8825_sema_release(nau8825);
|
nau8825_sema_release(nau8825);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2140,7 +2140,7 @@ static int nau8825_configure_sysclk(struct nau8825 *nau8825, int clk_id,
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case NAU8825_CLK_MCLK:
|
case NAU8825_CLK_MCLK:
|
||||||
/* Acquire the semaphone to synchronize the playback and
|
/* Acquire the semaphore to synchronize the playback and
|
||||||
* interrupt handler. In order to avoid the playback inter-
|
* interrupt handler. In order to avoid the playback inter-
|
||||||
* fered by cross talk process, the driver make the playback
|
* fered by cross talk process, the driver make the playback
|
||||||
* preparation halted until cross talk process finish.
|
* preparation halted until cross talk process finish.
|
||||||
|
@ -2150,7 +2150,7 @@ static int nau8825_configure_sysclk(struct nau8825 *nau8825, int clk_id,
|
||||||
/* MCLK not changed by clock tree */
|
/* MCLK not changed by clock tree */
|
||||||
regmap_update_bits(regmap, NAU8825_REG_CLK_DIVIDER,
|
regmap_update_bits(regmap, NAU8825_REG_CLK_DIVIDER,
|
||||||
NAU8825_CLK_MCLK_SRC_MASK, 0);
|
NAU8825_CLK_MCLK_SRC_MASK, 0);
|
||||||
/* Release the semaphone. */
|
/* Release the semaphore. */
|
||||||
nau8825_sema_release(nau8825);
|
nau8825_sema_release(nau8825);
|
||||||
|
|
||||||
ret = nau8825_mclk_prepare(nau8825, freq);
|
ret = nau8825_mclk_prepare(nau8825, freq);
|
||||||
|
@ -2188,7 +2188,7 @@ static int nau8825_configure_sysclk(struct nau8825 *nau8825, int clk_id,
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case NAU8825_CLK_FLL_MCLK:
|
case NAU8825_CLK_FLL_MCLK:
|
||||||
/* Acquire the semaphone to synchronize the playback and
|
/* Acquire the semaphore to synchronize the playback and
|
||||||
* interrupt handler. In order to avoid the playback inter-
|
* interrupt handler. In order to avoid the playback inter-
|
||||||
* fered by cross talk process, the driver make the playback
|
* fered by cross talk process, the driver make the playback
|
||||||
* preparation halted until cross talk process finish.
|
* preparation halted until cross talk process finish.
|
||||||
|
@ -2201,7 +2201,7 @@ static int nau8825_configure_sysclk(struct nau8825 *nau8825, int clk_id,
|
||||||
regmap_update_bits(regmap, NAU8825_REG_FLL3,
|
regmap_update_bits(regmap, NAU8825_REG_FLL3,
|
||||||
NAU8825_FLL_CLK_SRC_MASK | NAU8825_GAIN_ERR_MASK,
|
NAU8825_FLL_CLK_SRC_MASK | NAU8825_GAIN_ERR_MASK,
|
||||||
NAU8825_FLL_CLK_SRC_MCLK | 0);
|
NAU8825_FLL_CLK_SRC_MCLK | 0);
|
||||||
/* Release the semaphone. */
|
/* Release the semaphore. */
|
||||||
nau8825_sema_release(nau8825);
|
nau8825_sema_release(nau8825);
|
||||||
|
|
||||||
ret = nau8825_mclk_prepare(nau8825, freq);
|
ret = nau8825_mclk_prepare(nau8825, freq);
|
||||||
|
@ -2210,7 +2210,7 @@ static int nau8825_configure_sysclk(struct nau8825 *nau8825, int clk_id,
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case NAU8825_CLK_FLL_BLK:
|
case NAU8825_CLK_FLL_BLK:
|
||||||
/* Acquire the semaphone to synchronize the playback and
|
/* Acquire the semaphore to synchronize the playback and
|
||||||
* interrupt handler. In order to avoid the playback inter-
|
* interrupt handler. In order to avoid the playback inter-
|
||||||
* fered by cross talk process, the driver make the playback
|
* fered by cross talk process, the driver make the playback
|
||||||
* preparation halted until cross talk process finish.
|
* preparation halted until cross talk process finish.
|
||||||
|
@ -2226,7 +2226,7 @@ static int nau8825_configure_sysclk(struct nau8825 *nau8825, int clk_id,
|
||||||
NAU8825_FLL_CLK_SRC_MASK | NAU8825_GAIN_ERR_MASK,
|
NAU8825_FLL_CLK_SRC_MASK | NAU8825_GAIN_ERR_MASK,
|
||||||
NAU8825_FLL_CLK_SRC_BLK |
|
NAU8825_FLL_CLK_SRC_BLK |
|
||||||
(0xf << NAU8825_GAIN_ERR_SFT));
|
(0xf << NAU8825_GAIN_ERR_SFT));
|
||||||
/* Release the semaphone. */
|
/* Release the semaphore. */
|
||||||
nau8825_sema_release(nau8825);
|
nau8825_sema_release(nau8825);
|
||||||
|
|
||||||
if (nau8825->mclk_freq) {
|
if (nau8825->mclk_freq) {
|
||||||
|
@ -2236,7 +2236,7 @@ static int nau8825_configure_sysclk(struct nau8825 *nau8825, int clk_id,
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case NAU8825_CLK_FLL_FS:
|
case NAU8825_CLK_FLL_FS:
|
||||||
/* Acquire the semaphone to synchronize the playback and
|
/* Acquire the semaphore to synchronize the playback and
|
||||||
* interrupt handler. In order to avoid the playback inter-
|
* interrupt handler. In order to avoid the playback inter-
|
||||||
* fered by cross talk process, the driver make the playback
|
* fered by cross talk process, the driver make the playback
|
||||||
* preparation halted until cross talk process finish.
|
* preparation halted until cross talk process finish.
|
||||||
|
@ -2252,7 +2252,7 @@ static int nau8825_configure_sysclk(struct nau8825 *nau8825, int clk_id,
|
||||||
NAU8825_FLL_CLK_SRC_MASK | NAU8825_GAIN_ERR_MASK,
|
NAU8825_FLL_CLK_SRC_MASK | NAU8825_GAIN_ERR_MASK,
|
||||||
NAU8825_FLL_CLK_SRC_FS |
|
NAU8825_FLL_CLK_SRC_FS |
|
||||||
(0xf << NAU8825_GAIN_ERR_SFT));
|
(0xf << NAU8825_GAIN_ERR_SFT));
|
||||||
/* Release the semaphone. */
|
/* Release the semaphore. */
|
||||||
nau8825_sema_release(nau8825);
|
nau8825_sema_release(nau8825);
|
||||||
|
|
||||||
if (nau8825->mclk_freq) {
|
if (nau8825->mclk_freq) {
|
||||||
|
@ -2563,7 +2563,7 @@ static int nau8825_i2c_probe(struct i2c_client *i2c,
|
||||||
return PTR_ERR(nau8825->regmap);
|
return PTR_ERR(nau8825->regmap);
|
||||||
nau8825->dev = dev;
|
nau8825->dev = dev;
|
||||||
nau8825->irq = i2c->irq;
|
nau8825->irq = i2c->irq;
|
||||||
/* Initiate parameters, semaphone and work queue which are needed in
|
/* Initiate parameters, semaphore and work queue which are needed in
|
||||||
* cross talk suppression measurment function.
|
* cross talk suppression measurment function.
|
||||||
*/
|
*/
|
||||||
nau8825->xtalk_state = NAU8825_XTALK_DONE;
|
nau8825->xtalk_state = NAU8825_XTALK_DONE;
|
||||||
|
|
|
@ -95,7 +95,7 @@ static void asoc_graph_card_shutdown(struct snd_pcm_substream *substream)
|
||||||
asoc_simple_card_clk_disable(&dai_props->codec_dai);
|
asoc_simple_card_clk_disable(&dai_props->codec_dai);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct snd_soc_ops asoc_graph_card_ops = {
|
static const struct snd_soc_ops asoc_graph_card_ops = {
|
||||||
.startup = asoc_graph_card_startup,
|
.startup = asoc_graph_card_startup,
|
||||||
.shutdown = asoc_graph_card_shutdown,
|
.shutdown = asoc_graph_card_shutdown,
|
||||||
};
|
};
|
||||||
|
|
|
@ -56,7 +56,7 @@ static void asoc_graph_card_shutdown(struct snd_pcm_substream *substream)
|
||||||
asoc_simple_card_clk_disable(dai_props);
|
asoc_simple_card_clk_disable(dai_props);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct snd_soc_ops asoc_graph_card_ops = {
|
static const struct snd_soc_ops asoc_graph_card_ops = {
|
||||||
.startup = asoc_graph_card_startup,
|
.startup = asoc_graph_card_startup,
|
||||||
.shutdown = asoc_graph_card_shutdown,
|
.shutdown = asoc_graph_card_shutdown,
|
||||||
};
|
};
|
||||||
|
|
|
@ -595,7 +595,7 @@ static const struct snd_soc_dai_ops mt2701_afe_i2s_ops = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* MRG BE DAIs */
|
/* MRG BE DAIs */
|
||||||
static struct snd_soc_dai_ops mt2701_btmrg_ops = {
|
static const struct snd_soc_dai_ops mt2701_btmrg_ops = {
|
||||||
.startup = mt2701_btmrg_startup,
|
.startup = mt2701_btmrg_startup,
|
||||||
.shutdown = mt2701_btmrg_shutdown,
|
.shutdown = mt2701_btmrg_shutdown,
|
||||||
.hw_params = mt2701_btmrg_hw_params,
|
.hw_params = mt2701_btmrg_hw_params,
|
||||||
|
@ -1496,14 +1496,12 @@ static int mt2701_afe_runtime_resume(struct device *dev)
|
||||||
|
|
||||||
static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev)
|
static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
int ret, i;
|
|
||||||
unsigned int irq_id;
|
|
||||||
struct mtk_base_afe *afe;
|
struct mtk_base_afe *afe;
|
||||||
struct mt2701_afe_private *afe_priv;
|
struct mt2701_afe_private *afe_priv;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
|
int i, irq_id, ret;
|
||||||
|
|
||||||
ret = 0;
|
|
||||||
afe = devm_kzalloc(&pdev->dev, sizeof(*afe), GFP_KERNEL);
|
afe = devm_kzalloc(&pdev->dev, sizeof(*afe), GFP_KERNEL);
|
||||||
if (!afe)
|
if (!afe)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@ -1516,11 +1514,12 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev)
|
||||||
afe->dev = &pdev->dev;
|
afe->dev = &pdev->dev;
|
||||||
dev = afe->dev;
|
dev = afe->dev;
|
||||||
|
|
||||||
irq_id = platform_get_irq(pdev, 0);
|
irq_id = platform_get_irq_byname(pdev, "asys");
|
||||||
if (!irq_id) {
|
if (irq_id < 0) {
|
||||||
dev_err(dev, "%s no irq found\n", dev->of_node->name);
|
dev_err(dev, "unable to get ASYS IRQ\n");
|
||||||
return -ENXIO;
|
return irq_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = devm_request_irq(dev, irq_id, mt2701_asys_isr,
|
ret = devm_request_irq(dev, irq_id, mt2701_asys_isr,
|
||||||
IRQF_TRIGGER_NONE, "asys-isr", (void *)afe);
|
IRQF_TRIGGER_NONE, "asys-isr", (void *)afe);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
|
|
@ -222,7 +222,6 @@ static int mt8173_rt5650_rt5514_dev_probe(struct platform_device *pdev)
|
||||||
mt8173_rt5650_rt5514_codecs[1].of_node;
|
mt8173_rt5650_rt5514_codecs[1].of_node;
|
||||||
|
|
||||||
card->dev = &pdev->dev;
|
card->dev = &pdev->dev;
|
||||||
platform_set_drvdata(pdev, card);
|
|
||||||
|
|
||||||
ret = devm_snd_soc_register_card(&pdev->dev, card);
|
ret = devm_snd_soc_register_card(&pdev->dev, card);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
|
@ -279,7 +279,6 @@ static int mt8173_rt5650_rt5676_dev_probe(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
card->dev = &pdev->dev;
|
card->dev = &pdev->dev;
|
||||||
platform_set_drvdata(pdev, card);
|
|
||||||
|
|
||||||
ret = devm_snd_soc_register_card(&pdev->dev, card);
|
ret = devm_snd_soc_register_card(&pdev->dev, card);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
|
@ -311,7 +311,6 @@ static int mt8173_rt5650_dev_probe(struct platform_device *pdev)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
card->dev = &pdev->dev;
|
card->dev = &pdev->dev;
|
||||||
platform_set_drvdata(pdev, card);
|
|
||||||
|
|
||||||
ret = devm_snd_soc_register_card(&pdev->dev, card);
|
ret = devm_snd_soc_register_card(&pdev->dev, card);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
|
@ -125,7 +125,9 @@ static int mxs_saif_set_clk(struct mxs_saif *saif,
|
||||||
*
|
*
|
||||||
* If MCLK is not used, we just set saif clk to 512*fs.
|
* If MCLK is not used, we just set saif clk to 512*fs.
|
||||||
*/
|
*/
|
||||||
clk_prepare_enable(master_saif->clk);
|
ret = clk_prepare_enable(master_saif->clk);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
if (master_saif->mclk_in_use) {
|
if (master_saif->mclk_in_use) {
|
||||||
switch (mclk / rate) {
|
switch (mclk / rate) {
|
||||||
|
@ -388,6 +390,7 @@ static int mxs_saif_startup(struct snd_pcm_substream *substream,
|
||||||
struct snd_soc_dai *cpu_dai)
|
struct snd_soc_dai *cpu_dai)
|
||||||
{
|
{
|
||||||
struct mxs_saif *saif = snd_soc_dai_get_drvdata(cpu_dai);
|
struct mxs_saif *saif = snd_soc_dai_get_drvdata(cpu_dai);
|
||||||
|
int ret;
|
||||||
|
|
||||||
/* clear error status to 0 for each re-open */
|
/* clear error status to 0 for each re-open */
|
||||||
saif->fifo_underrun = 0;
|
saif->fifo_underrun = 0;
|
||||||
|
@ -401,7 +404,9 @@ static int mxs_saif_startup(struct snd_pcm_substream *substream,
|
||||||
__raw_writel(BM_SAIF_CTRL_CLKGATE,
|
__raw_writel(BM_SAIF_CTRL_CLKGATE,
|
||||||
saif->base + SAIF_CTRL + MXS_CLR_ADDR);
|
saif->base + SAIF_CTRL + MXS_CLR_ADDR);
|
||||||
|
|
||||||
clk_prepare(saif->clk);
|
ret = clk_prepare(saif->clk);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -468,7 +473,9 @@ static int mxs_saif_hw_params(struct snd_pcm_substream *substream,
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
clk_prepare(master_saif->clk);
|
ret = clk_prepare(master_saif->clk);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
scr = __raw_readl(saif->base + SAIF_CTRL);
|
scr = __raw_readl(saif->base + SAIF_CTRL);
|
||||||
|
|
|
@ -271,7 +271,7 @@ static int nuc900_dma_mmap(struct snd_pcm_substream *substream,
|
||||||
runtime->dma_addr, runtime->dma_bytes);
|
runtime->dma_addr, runtime->dma_bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct snd_pcm_ops nuc900_dma_ops = {
|
static const struct snd_pcm_ops nuc900_dma_ops = {
|
||||||
.open = nuc900_dma_open,
|
.open = nuc900_dma_open,
|
||||||
.close = nuc900_dma_close,
|
.close = nuc900_dma_close,
|
||||||
.ioctl = snd_pcm_lib_ioctl,
|
.ioctl = snd_pcm_lib_ioctl,
|
||||||
|
@ -299,7 +299,7 @@ static int nuc900_dma_new(struct snd_soc_pcm_runtime *rtd)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct snd_soc_platform_driver nuc900_soc_platform = {
|
static const struct snd_soc_platform_driver nuc900_soc_platform = {
|
||||||
.ops = &nuc900_dma_ops,
|
.ops = &nuc900_dma_ops,
|
||||||
.pcm_new = nuc900_dma_new,
|
.pcm_new = nuc900_dma_new,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user