Exemplo n.º 1
0
static void fdma_reset_all(struct fdma *fdma)
{
	fdma_disable_all_channels(fdma);
	fdma_reset_channels(fdma);
	/* reset the CPU program counter and all the
	 * instruction pipeline registers */
	writel(5, fdma->io_base + fdma->regs.clk_gate);
}
Exemplo n.º 2
0
static int fdma_run_initialise_sequence(struct fdma *fdma)
{
	fdma->llu_pool = dma_pool_create(fdma->name, NULL,
			sizeof(struct fdma_llu_entry), 32, 0);

	if (fdma->llu_pool == NULL) {
		fdma_dbg(fdma, "%s Can't allocate dma_pool memory\n",
				__FUNCTION__);
		return -ENOMEM;
	}

	fdma_initialise(fdma);
	fdma_reset_channels(fdma);

	if (!fdma_enable_all_channels(fdma))
		return -ENODEV;

	return 0;
}
Exemplo n.º 3
0
static int fdma_restore_noirq(struct device *dev)
{
	struct fdma *fdma = dev_get_drvdata(dev);
	int i; /* index segments */

	if (fdma->firmware_loaded != 1)
		return 0;

	stm_fdma_clk_enable(fdma);

	for (i = 0; i < 2; ++i)
		memcpy_toio(fdma->io_base + fdma->segment_pm[i].offset,
			fdma->segment_pm[i].data,
			fdma->segment_pm[i].size);

	fdma_initialise(fdma);
	fdma_reset_channels(fdma);

	if (!fdma_enable_all_channels(fdma))
		return -ENODEV;
	return 0;
}