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]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux