Commit a391dbe0 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'asoc/topic/atmel', 'asoc/topic/bcm2835' and...

Merge remote-tracking branches 'asoc/topic/atmel', 'asoc/topic/bcm2835' and 'asoc/topic/cs42xx8' into asoc-next
...@@ -34,6 +34,7 @@ struct ssc_device *ssc_request(unsigned int ssc_num) ...@@ -34,6 +34,7 @@ struct ssc_device *ssc_request(unsigned int ssc_num)
if (ssc->pdev->dev.of_node) { if (ssc->pdev->dev.of_node) {
if (of_alias_get_id(ssc->pdev->dev.of_node, "ssc") if (of_alias_get_id(ssc->pdev->dev.of_node, "ssc")
== ssc_num) { == ssc_num) {
ssc->pdev->id = ssc_num;
ssc_valid = 1; ssc_valid = 1;
break; break;
} }
......
...@@ -285,7 +285,8 @@ static int atmel_ssc_hw_rule_rate(struct snd_pcm_hw_params *params, ...@@ -285,7 +285,8 @@ static int atmel_ssc_hw_rule_rate(struct snd_pcm_hw_params *params,
static int atmel_ssc_startup(struct snd_pcm_substream *substream, static int atmel_ssc_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
struct atmel_ssc_info *ssc_p = &ssc_info[dai->id]; struct platform_device *pdev = to_platform_device(dai->dev);
struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
struct atmel_pcm_dma_params *dma_params; struct atmel_pcm_dma_params *dma_params;
int dir, dir_mask; int dir, dir_mask;
int ret; int ret;
...@@ -346,7 +347,8 @@ static int atmel_ssc_startup(struct snd_pcm_substream *substream, ...@@ -346,7 +347,8 @@ static int atmel_ssc_startup(struct snd_pcm_substream *substream,
static void atmel_ssc_shutdown(struct snd_pcm_substream *substream, static void atmel_ssc_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
struct atmel_ssc_info *ssc_p = &ssc_info[dai->id]; struct platform_device *pdev = to_platform_device(dai->dev);
struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
struct atmel_pcm_dma_params *dma_params; struct atmel_pcm_dma_params *dma_params;
int dir, dir_mask; int dir, dir_mask;
...@@ -392,7 +394,8 @@ static void atmel_ssc_shutdown(struct snd_pcm_substream *substream, ...@@ -392,7 +394,8 @@ static void atmel_ssc_shutdown(struct snd_pcm_substream *substream,
static int atmel_ssc_set_dai_fmt(struct snd_soc_dai *cpu_dai, static int atmel_ssc_set_dai_fmt(struct snd_soc_dai *cpu_dai,
unsigned int fmt) unsigned int fmt)
{ {
struct atmel_ssc_info *ssc_p = &ssc_info[cpu_dai->id]; struct platform_device *pdev = to_platform_device(cpu_dai->dev);
struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
ssc_p->daifmt = fmt; ssc_p->daifmt = fmt;
return 0; return 0;
...@@ -404,7 +407,8 @@ static int atmel_ssc_set_dai_fmt(struct snd_soc_dai *cpu_dai, ...@@ -404,7 +407,8 @@ static int atmel_ssc_set_dai_fmt(struct snd_soc_dai *cpu_dai,
static int atmel_ssc_set_dai_clkdiv(struct snd_soc_dai *cpu_dai, static int atmel_ssc_set_dai_clkdiv(struct snd_soc_dai *cpu_dai,
int div_id, int div) int div_id, int div)
{ {
struct atmel_ssc_info *ssc_p = &ssc_info[cpu_dai->id]; struct platform_device *pdev = to_platform_device(cpu_dai->dev);
struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
switch (div_id) { switch (div_id) {
case ATMEL_SSC_CMR_DIV: case ATMEL_SSC_CMR_DIV:
...@@ -445,7 +449,8 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, ...@@ -445,7 +449,8 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
int id = dai->id; struct platform_device *pdev = to_platform_device(dai->dev);
int id = pdev->id;
struct atmel_ssc_info *ssc_p = &ssc_info[id]; struct atmel_ssc_info *ssc_p = &ssc_info[id];
struct ssc_device *ssc = ssc_p->ssc; struct ssc_device *ssc = ssc_p->ssc;
struct atmel_pcm_dma_params *dma_params; struct atmel_pcm_dma_params *dma_params;
...@@ -772,7 +777,8 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, ...@@ -772,7 +777,8 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
static int atmel_ssc_prepare(struct snd_pcm_substream *substream, static int atmel_ssc_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
struct atmel_ssc_info *ssc_p = &ssc_info[dai->id]; struct platform_device *pdev = to_platform_device(dai->dev);
struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
struct atmel_pcm_dma_params *dma_params; struct atmel_pcm_dma_params *dma_params;
int dir; int dir;
...@@ -795,7 +801,8 @@ static int atmel_ssc_prepare(struct snd_pcm_substream *substream, ...@@ -795,7 +801,8 @@ static int atmel_ssc_prepare(struct snd_pcm_substream *substream,
static int atmel_ssc_trigger(struct snd_pcm_substream *substream, static int atmel_ssc_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai) int cmd, struct snd_soc_dai *dai)
{ {
struct atmel_ssc_info *ssc_p = &ssc_info[dai->id]; struct platform_device *pdev = to_platform_device(dai->dev);
struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
struct atmel_pcm_dma_params *dma_params; struct atmel_pcm_dma_params *dma_params;
int dir; int dir;
...@@ -824,11 +831,12 @@ static int atmel_ssc_trigger(struct snd_pcm_substream *substream, ...@@ -824,11 +831,12 @@ static int atmel_ssc_trigger(struct snd_pcm_substream *substream,
static int atmel_ssc_suspend(struct snd_soc_dai *cpu_dai) static int atmel_ssc_suspend(struct snd_soc_dai *cpu_dai)
{ {
struct atmel_ssc_info *ssc_p; struct atmel_ssc_info *ssc_p;
struct platform_device *pdev = to_platform_device(cpu_dai->dev);
if (!cpu_dai->active) if (!cpu_dai->active)
return 0; return 0;
ssc_p = &ssc_info[cpu_dai->id]; ssc_p = &ssc_info[pdev->id];
/* Save the status register before disabling transmit and receive */ /* Save the status register before disabling transmit and receive */
ssc_p->ssc_state.ssc_sr = ssc_readl(ssc_p->ssc->regs, SR); ssc_p->ssc_state.ssc_sr = ssc_readl(ssc_p->ssc->regs, SR);
...@@ -852,12 +860,13 @@ static int atmel_ssc_suspend(struct snd_soc_dai *cpu_dai) ...@@ -852,12 +860,13 @@ static int atmel_ssc_suspend(struct snd_soc_dai *cpu_dai)
static int atmel_ssc_resume(struct snd_soc_dai *cpu_dai) static int atmel_ssc_resume(struct snd_soc_dai *cpu_dai)
{ {
struct atmel_ssc_info *ssc_p; struct atmel_ssc_info *ssc_p;
struct platform_device *pdev = to_platform_device(cpu_dai->dev);
u32 cr; u32 cr;
if (!cpu_dai->active) if (!cpu_dai->active)
return 0; return 0;
ssc_p = &ssc_info[cpu_dai->id]; ssc_p = &ssc_info[pdev->id];
/* restore SSC register settings */ /* restore SSC register settings */
ssc_writel(ssc_p->ssc->regs, TFMR, ssc_p->ssc_state.ssc_tfmr); ssc_writel(ssc_p->ssc->regs, TFMR, ssc_p->ssc_state.ssc_tfmr);
......
This diff is collapsed.
...@@ -44,6 +44,7 @@ struct cs42xx8_priv { ...@@ -44,6 +44,7 @@ struct cs42xx8_priv {
bool slave_mode; bool slave_mode;
unsigned long sysclk; unsigned long sysclk;
u32 tx_channels;
}; };
/* -127.5dB to 0dB with step of 0.5dB */ /* -127.5dB to 0dB with step of 0.5dB */
...@@ -257,6 +258,9 @@ static int cs42xx8_hw_params(struct snd_pcm_substream *substream, ...@@ -257,6 +258,9 @@ static int cs42xx8_hw_params(struct snd_pcm_substream *substream,
u32 ratio = cs42xx8->sysclk / params_rate(params); u32 ratio = cs42xx8->sysclk / params_rate(params);
u32 i, fm, val, mask; u32 i, fm, val, mask;
if (tx)
cs42xx8->tx_channels = params_channels(params);
for (i = 0; i < ARRAY_SIZE(cs42xx8_ratios); i++) { for (i = 0; i < ARRAY_SIZE(cs42xx8_ratios); i++) {
if (cs42xx8_ratios[i].ratio == ratio) if (cs42xx8_ratios[i].ratio == ratio)
break; break;
...@@ -283,9 +287,11 @@ static int cs42xx8_digital_mute(struct snd_soc_dai *dai, int mute) ...@@ -283,9 +287,11 @@ static int cs42xx8_digital_mute(struct snd_soc_dai *dai, int mute)
{ {
struct snd_soc_codec *codec = dai->codec; struct snd_soc_codec *codec = dai->codec;
struct cs42xx8_priv *cs42xx8 = snd_soc_codec_get_drvdata(codec); struct cs42xx8_priv *cs42xx8 = snd_soc_codec_get_drvdata(codec);
u8 dac_unmute = cs42xx8->tx_channels ?
~((0x1 << cs42xx8->tx_channels) - 1) : 0;
regmap_update_bits(cs42xx8->regmap, CS42XX8_DACMUTE, regmap_write(cs42xx8->regmap, CS42XX8_DACMUTE,
CS42XX8_DACMUTE_ALL, mute ? CS42XX8_DACMUTE_ALL : 0); mute ? CS42XX8_DACMUTE_ALL : dac_unmute);
return 0; return 0;
} }
......
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