[alsa-devel] [RFC] Auto setup TDM when needed. Add frame_width and rx/tx masks to set_tdm_slots.

Mark Brown broonie at opensource.wolfsonmicro.com
Tue Jun 9 11:10:45 CEST 2009


On Mon, Jun 08, 2009 at 06:07:24PM -0300, Daniel Ribeiro wrote:

> Untested, RFC only version of patch.
> (plus some minor copynpaste and whitespace fixes)

> Am I on the right direction? :)

Yes, looks sensible.  I've not checked the driver code at all.

> +++ b/sound/soc/soc-core.c
> @@ -2130,17 +2130,20 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_fmt);
>  /**
>   * snd_soc_dai_set_tdm_slot - configure DAI TDM.
>   * @dai: DAI
> - * @mask: DAI specific mask representing used slots.
> + * @tx_mask: DAI specific mask representing TX slots.
> + * @rx_mask: DAI specific mask representing RX slots.

I'd change the wording to be something like "bitmask representing active
slots".

>  {
> -	if (dai->ops->set_sysclk)
> -		return dai->ops->set_tdm_slot(dai, mask, slots);
> +	if (dai->ops->set_tdm_slot)

Should check that there are ops too.

> +		return dai->ops->set_tdm_slot(dai, tx_mask, rx_mask,
> +				slots, frame_width);

It might be nice to provide a default implementation for non-TDM if no
implementation is provided but that could be done later if it makes
sense.  I don't think it'll make much difference, though.

>  int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate)
>  {
> -	if (dai->ops->set_sysclk)
> +	if (dai->ops->set_tristate)

Separate patch, please.  This is fixed already, though.


More information about the Alsa-devel mailing list