[alsa-devel] [PATCH 2/2] ASoC: uda134x: fix bias level setup on initialization and runtime
Mark Brown
broonie at opensource.wolfsonmicro.com
Thu Jun 24 13:34:16 CEST 2010
On 24 Jun 2010, at 12:17, Vladimir Zapolskiy wrote:
> /* ADC, DAC on */
> - reg = uda134x_read_reg_cache(codec, UDA134X_STATUS1);
> - uda134x_write(codec, UDA134X_STATUS1, reg | 0x03);
> + if (pd->model == UDA134X_UDA1341) {
> + reg = uda134x_read_reg_cache(codec, UDA134X_STATUS1);
> + uda134x_write(codec, UDA134X_STATUS1, reg | 0x03);
> + } else {
> + reg = uda134x_read_reg_cache(codec, UDA134X_DATA011);
> + uda134x_write(codec, UDA134X_DATA011, reg | 0x03);
> + }
I'd be more comfortable if these used switch statements. That way any further
device specifics will slot in more easily.
Of course, this should really be using DAPM...
>
> @@ -531,9 +541,7 @@ static int uda134x_soc_probe(struct platform_device *pdev)
> codec->num_dai = 1;
> codec->read = uda134x_read_reg_cache;
> codec->write = uda134x_write;
> -#ifdef POWER_OFF_ON_STANDBY
> - codec->set_bias_level = uda134x_set_bias_level;
> -#endif
> +
These changes for the bias level configuration look to be unrelated to the addition of
the new CODEC and should be split into a separate patch. It'd also be much better to
remove this ifdefery, it should be handled via platform data or just done unconditionally.
More information about the Alsa-devel
mailing list