Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 0900d1e6 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: pcm3168a: cleanup hw_constraint for LEFT_J/I2S



hw constraint for LEFT_J/I2S are same, but had duplicated code.
This code cleanup these.

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 61f18dc7
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -504,6 +504,10 @@ static int pcm3168a_startup(struct snd_pcm_substream *substream,
	unsigned int fmt;
	unsigned int sample_min;
	unsigned int channel_max;
	unsigned int channel_maxs[] = {
		6, /* rx */
		8  /* tx */
	};

	if (tx)
		fmt = pcm3168a->dac_fmt;
@@ -528,18 +532,9 @@ static int pcm3168a_startup(struct snd_pcm_substream *substream,
		channel_max =  2;
		break;
	case PCM3168A_FMT_LEFT_J:
		sample_min  = 24;
		if (tx)
			channel_max = 8;
		else
			channel_max = 6;
		break;
	case PCM3168A_FMT_I2S:
		sample_min  = 24;
		if (tx)
			channel_max = 8;
		else
			channel_max = 6;
		channel_max = channel_maxs[tx];
		break;
	default:
		sample_min  = 24;