Re: [PATCH 09/27] ASoC: tas2764: Apply Apple quirks

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



> +#define TRANSITION(new, old) ((new) << 8 | (old))
> +	switch (TRANSITION(target, curr)) {
> +	case TRANSITION(TAS2764_PWR_CTRL_SHUTDOWN, TAS2764_PWR_CTRL_MUTE):
> +	case TRANSITION(TAS2764_PWR_CTRL_SHUTDOWN, TAS2764_PWR_CTRL_ACTIVE):
> +		ret = regmap_multi_reg_write(tas2764->regmap, tas2764_pre_shutdown_seq,
> +					     ARRAY_SIZE(tas2764_pre_shutdown_seq));
> +		if (ret < 0)
> +			break;
> +
> +		ret = snd_soc_component_update_bits(tas2764->component,
> +						    TAS2764_PWR_CTRL,
> +						    TAS2764_PWR_CTRL_MASK,
> +						    TAS2764_PWR_CTRL_SHUTDOWN);
> +		if (ret > 0)
> +			break;
> +
> +		ret = regmap_multi_reg_write(tas2764->regmap, tas2764_post_shutdown_seq,
> +					     ARRAY_SIZE(tas2764_post_shutdown_seq));
> +		fallthrough;
> +	default:
> +		ret = snd_soc_component_update_bits(tas2764->component, TAS2764_PWR_CTRL,
> +						    TAS2764_PWR_CTRL_MASK, target);
> +	}
> +#undef TRANSITION

Not a fan of this one-off macro, any reason not to do the obvious
if-else instead?




[Index of Archives]     [Pulseaudio]     [Linux Audio Users]     [ALSA Devel]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux