summaryrefslogtreecommitdiff
path: root/taia.c
blob: 34d53473e5f3c12ffc09bfa1c06a9bc7cdd47fdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <stdbool.h>

#include "taia.h"

static const struct taia tolerance_taia = {
	.sec.x = 0,
	.nano = 700000000ULL,	/* 700ms acceptance window */
	.atto = 0,
};

bool taia_looks_good(struct taia *arr_taia, struct taia *pkt_taia)
{
	bool good = false;
	struct taia tmp;

	if (taia_less(arr_taia, pkt_taia)) {
		taia_sub(&tmp, pkt_taia, arr_taia);
		if (taia_less(&tmp, &tolerance_taia))
			good = true;
	} else {
		taia_sub(&tmp, arr_taia, pkt_taia);
		if (taia_less(&tmp, &tolerance_taia))
			good = true;
	}

	return good;
}
form>
authorMatthias Reichl <hias@horus.com>2016-04-27 15:26:51 +0200
committerMark Brown <broonie@kernel.org>2016-04-27 17:34:11 +0100
commit73fe01cfb3babff01748a9fbc95cc3ea2079cc7f (patch)
treef3f6b72b1fa9e2d0374f9417c9e97f1779d5af4a /Documentation/i2c
parentf55532a0c0b8bb6148f4e07853b876ef73bc69ca (diff)
ASoC: dmaengine_pcm: Add support for packed transfers
dmaengine_pcm currently only supports setups where FIFO reads/writes correspond to exactly one sample, eg 16-bit sample data is transferred via 16-bit FIFO accesses, 32-bit data via 32-bit accesses. This patch adds support for setups with fixed width FIFOs where multiple samples are packed into a larger word. For example setups with a 32-bit wide FIFO register that expect 16-bit sample transfers to be done with the left+right sample data packed into a 32-bit word. Support for packed transfers is controlled via the SND_DMAENGINE_PCM_DAI_FLAG_PACK flag in snd_dmaengine_dai_dma_data.flags If this flag is set dmaengine_pcm doesn't put any restriction on the supported formats and sets the DMA transfer width to undefined. This means control over the constraints is now transferred to the DAI driver and it's responsible to provide proper configuration and check for possible corner cases that aren't handled by the ALSA core. Signed-off-by: Matthias Reichl <hias@horus.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Martin Sperl <kernel@martin.sperl.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'Documentation/i2c')