[alsa-devel] [RFC 6/7] ASoC: hda: Add support for SSP register settings

Mark Brown broonie at kernel.org
Fri Apr 24 19:55:32 CEST 2015


On Sun, Apr 19, 2015 at 02:27:32AM +0530, Vinod Koul wrote:

> +	req_bclk = fs * slots * s_fmt;

We have a helper for this.

> +	dummy = 0;
> +	/* Find the lowest bit clock possible for particular configuration */
> +	do {
> +		req_bclk = ((s_fmt * fs * slots) + (fs * dummy));
> +		mod = HDA_SSP_MAX_FREQ_192 % req_bclk;
> +		divisor = HDA_SSP_MAX_FREQ_192 / req_bclk;
> +		if (!mod) {
> +			found = 1;
> +			break;
> +		}
> +		/* Dont add odd number of dummy bits, since I2S requires
> +		 * dummy bit after each slot/channel
> +		 */

It does?

> +		dummy += 2;
> +		if (dummy > (HDA_SSPSP2_FEP_MASK >> HDA_SSPSP2_FEP_SHIFT)) {
> +			dev_err(ctx->dev, "Dummy bit greater than what SSP can support\n");
> +			return -EINVAL;
> +		}
> +
> +	} while (divisor > 0);

Aside from the limits this all looks like it could be generic?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20150424/07fdcf2f/attachment.sig>


More information about the Alsa-devel mailing list