@@ -378,10 +378,13 @@ static int cs4265_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
return 0;
}
-static int cs4265_digital_mute(struct snd_soc_dai *dai, int mute)
+static int cs4265_mute(struct snd_soc_dai *dai, int mute, int direction)
{
struct snd_soc_component *component = dai->component;
+ if (direction != SNDRV_PCM_STREAM_PLAYBACK)
+ return 0;
+
if (mute) {
snd_soc_component_update_bits(component, CS4265_DAC_CTL,
CS4265_DAC_CTL_MUTE,
@@ -498,7 +501,7 @@ static int cs4265_set_bias_level(struct snd_soc_component *component,
static const struct snd_soc_dai_ops cs4265_ops = {
.hw_params = cs4265_pcm_hw_params,
- .digital_mute = cs4265_digital_mute,
+ .mute_stream = cs4265_mute,
.set_fmt = cs4265_set_fmt,
.set_sysclk = cs4265_set_sysclk,
};
@@ -406,12 +406,15 @@ static int cs4270_hw_params(struct snd_pcm_substream *substream,
* board does not have the MUTEA or MUTEB pins connected to such circuitry,
* then this function will do nothing.
*/
-static int cs4270_dai_mute(struct snd_soc_dai *dai, int mute)
+static int cs4270_dai_mute(struct snd_soc_dai *dai, int mute, int direction)
{
struct snd_soc_component *component = dai->component;
struct cs4270_private *cs4270 = snd_soc_component_get_drvdata(component);
int reg6;
+ if (direction != SNDRV_PCM_STREAM_PLAYBACK)
+ return 0;
+
reg6 = snd_soc_component_read(component, CS4270_MUTE);
if (mute)
@@ -471,7 +474,7 @@ static const struct snd_soc_dai_ops cs4270_dai_ops = {
.hw_params = cs4270_hw_params,
.set_sysclk = cs4270_set_dai_sysclk,
.set_fmt = cs4270_set_dai_fmt,
- .digital_mute = cs4270_dai_mute,
+ .mute_stream = cs4270_dai_mute,
};
static struct snd_soc_dai_driver cs4270_dai = {
@@ -849,12 +849,15 @@ static int cs42l42_set_sysclk(struct snd_soc_dai *dai,
return 0;
}
-static int cs42l42_digital_mute(struct snd_soc_dai *dai, int mute)
+static int cs42l42_mute(struct snd_soc_dai *dai, int mute, int direction)
{
struct snd_soc_component *component = dai->component;
unsigned int regval;
u8 fullScaleVol;
+ if (direction != SNDRV_PCM_STREAM_PLAYBACK)
+ return 0;
+
if (mute) {
/* Mark SCLK as not present to turn on the internal
* oscillator.
@@ -909,7 +912,7 @@ static const struct snd_soc_dai_ops cs42l42_ops = {
.hw_params = cs42l42_pcm_hw_params,
.set_fmt = cs42l42_set_dai_fmt,
.set_sysclk = cs42l42_set_sysclk,
- .digital_mute = cs42l42_digital_mute
+ .mute_stream = cs42l42_mute
};
static struct snd_soc_dai_driver cs42l42_dai = {
@@ -484,12 +484,15 @@ static int cs42l51_hw_params(struct snd_pcm_substream *substream,
return 0;
}
-static int cs42l51_dai_mute(struct snd_soc_dai *dai, int mute)
+static int cs42l51_dai_mute(struct snd_soc_dai *dai, int mute, int direction)
{
struct snd_soc_component *component = dai->component;
int reg;
int mask = CS42L51_DAC_OUT_CTL_DACA_MUTE|CS42L51_DAC_OUT_CTL_DACB_MUTE;
+ if (direction != SNDRV_PCM_STREAM_PLAYBACK)
+ return 0;
+
reg = snd_soc_component_read(component, CS42L51_DAC_OUT_CTL);
if (mute)
@@ -511,7 +514,7 @@ static const struct snd_soc_dai_ops cs42l51_dai_ops = {
.hw_params = cs42l51_hw_params,
.set_sysclk = cs42l51_set_dai_sysclk,
.set_fmt = cs42l51_set_dai_fmt,
- .digital_mute = cs42l51_dai_mute,
+ .mute_stream = cs42l51_dai_mute,
};
static struct snd_soc_dai_driver cs42l51_dai = {
@@ -784,10 +784,13 @@ static int cs42l52_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
return 0;
}
-static int cs42l52_digital_mute(struct snd_soc_dai *dai, int mute)
+static int cs42l52_mute(struct snd_soc_dai *dai, int mute, int direction)
{
struct snd_soc_component *component = dai->component;
+ if (direction != SNDRV_PCM_STREAM_PLAYBACK)
+ return 0;
+
if (mute)
snd_soc_component_update_bits(component, CS42L52_PB_CTL1,
CS42L52_PB_CTL1_MUTE_MASK,
@@ -865,7 +868,7 @@ static int cs42l52_set_bias_level(struct snd_soc_component *component,
static const struct snd_soc_dai_ops cs42l52_ops = {
.hw_params = cs42l52_pcm_hw_params,
- .digital_mute = cs42l52_digital_mute,
+ .mute_stream = cs42l52_mute,
.set_fmt = cs42l52_set_fmt,
.set_sysclk = cs42l52_set_sysclk,
};
@@ -800,10 +800,13 @@ static int cs42l56_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
return 0;
}
-static int cs42l56_digital_mute(struct snd_soc_dai *dai, int mute)
+static int cs42l56_mute(struct snd_soc_dai *dai, int mute, int direction)
{
struct snd_soc_component *component = dai->component;
+ if (direction != SNDRV_PCM_STREAM_PLAYBACK)
+ return 0;
+
if (mute) {
/* Hit the DSP Mixer first */
snd_soc_component_update_bits(component, CS42L56_DSP_MUTE_CTL,
@@ -929,7 +932,7 @@ static int cs42l56_set_bias_level(struct snd_soc_component *component,
static const struct snd_soc_dai_ops cs42l56_ops = {
.hw_params = cs42l56_pcm_hw_params,
- .digital_mute = cs42l56_digital_mute,
+ .mute_stream = cs42l56_mute,
.set_fmt = cs42l56_set_dai_fmt,
.set_sysclk = cs42l56_set_sysclk,
};
@@ -362,13 +362,16 @@ static int cs42xx8_hw_free(struct snd_pcm_substream *substream,
return 0;
}
-static int cs42xx8_digital_mute(struct snd_soc_dai *dai, int mute)
+static int cs42xx8_mute(struct snd_soc_dai *dai, int mute, int direction)
{
struct snd_soc_component *component = dai->component;
struct cs42xx8_priv *cs42xx8 = snd_soc_component_get_drvdata(component);
u8 dac_unmute = cs42xx8->tx_channels ?
~((0x1 << cs42xx8->tx_channels) - 1) : 0;
+ if (direction != SNDRV_PCM_STREAM_PLAYBACK)
+ return 0;
+
regmap_write(cs42xx8->regmap, CS42XX8_DACMUTE,
mute ? CS42XX8_DACMUTE_ALL : dac_unmute);
@@ -380,7 +383,7 @@ static const struct snd_soc_dai_ops cs42xx8_dai_ops = {
.set_sysclk = cs42xx8_set_dai_sysclk,
.hw_params = cs42xx8_hw_params,
.hw_free = cs42xx8_hw_free,
- .digital_mute = cs42xx8_digital_mute,
+ .mute_stream = cs42xx8_mute,
};
static struct snd_soc_dai_driver cs42xx8_dai = {
@@ -116,11 +116,14 @@ static int cs4341_hw_params(struct snd_pcm_substream *substream,
CS4341_MODE2_DIF, mode);
}
-static int cs4341_digital_mute(struct snd_soc_dai *dai, int mute)
+static int cs4341_mute(struct snd_soc_dai *dai, int mute, int direction)
{
struct snd_soc_component *component = dai->component;
int ret;
+ if (direction != SNDRV_PCM_STREAM_PLAYBACK)
+ return 0;
+
ret = snd_soc_component_update_bits(component, CS4341_REG_VOLA,
CS4341_VOLX_MUTE,
mute ? CS4341_VOLX_MUTE : 0);
@@ -174,7 +177,7 @@ static const struct snd_kcontrol_new cs4341_controls[] = {
static const struct snd_soc_dai_ops cs4341_dai_ops = {
.set_fmt = cs4341_set_fmt,
.hw_params = cs4341_hw_params,
- .digital_mute = cs4341_digital_mute,
+ .mute_stream = cs4341_mute,
};
static struct snd_soc_dai_driver cs4341_dai = {
@@ -131,11 +131,14 @@ static int cs4349_pcm_hw_params(struct snd_pcm_substream *substream,
return 0;
}
-static int cs4349_digital_mute(struct snd_soc_dai *dai, int mute)
+static int cs4349_mute(struct snd_soc_dai *dai, int mute, int direction)
{
struct snd_soc_component *component = dai->component;
int reg;
+ if (direction != SNDRV_PCM_STREAM_PLAYBACK)
+ return 0;
+
reg = 0;
if (mute)
reg = MUTE_AB_MASK;
@@ -236,7 +239,7 @@ static const struct snd_soc_dapm_route cs4349_routes[] = {
static const struct snd_soc_dai_ops cs4349_dai_ops = {
.hw_params = cs4349_pcm_hw_params,
.set_fmt = cs4349_set_dai_fmt,
- .digital_mute = cs4349_digital_mute,
+ .mute_stream = cs4349_mute,
};
static struct snd_soc_dai_driver cs4349_dai = {