Re: [PATCH 01/19] ASoC: hdmi-codec: merge .digital_mute() into .mute_stream()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




-static int sii902x_audio_digital_mute(struct device *dev,
-				      void *data, bool enable)
+static int sii902x_audio_mute(struct device *dev, void *data,
+			      bool enable, int direction)
  {
  	struct sii902x *sii902x = dev_get_drvdata(dev);
+ if (direction != SNDRV_PCM_STREAM_PLAYBACK)
+		return 0;
+

Thanks for this clean-up Morimoto-san.

One question: in all the codec changes the return is now 0.

But in the previous implementation based on digital_mute, when the wrong direction was used it would have been -ENOTSUPP.

int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute,
			     int direction)
{
	int ret = -ENOTSUPP;

	if (dai->driver->ops &&
	    dai->driver->ops->mute_stream)
		ret = dai->driver->ops->mute_stream(dai, mute, direction);
	else if (direction == SNDRV_PCM_STREAM_PLAYBACK &&
		 dai->driver->ops &&
		 dai->driver->ops->digital_mute)
		ret = dai->driver->ops->digital_mute(dai, mute);

<<< none of the branches taken for capture + digital_mute supported, so return -ENOTSUPP.

	return soc_dai_ret(dai, ret);
}

Was this change intentional?

We also want to check why this return value is only tested in soc-dapm.c, if this digital_mute can fail then we are missing tests left and right - maybe that's a follow-up change?




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux