/*1* 8237A DMA controller suspend functions.2*3* Written by Pierre Ossman, 2005.4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License as published by7* the Free Software Foundation; either version 2 of the License, or (at8* your option) any later version.9*/1011#include <linux/init.h>12#include <linux/syscore_ops.h>1314#include <asm/dma.h>1516/*17* This module just handles suspend/resume issues with the18* 8237A DMA controller (used for ISA and LPC).19* Allocation is handled in kernel/dma.c and normal usage is20* in asm/dma.h.21*/2223static void i8237A_resume(void)24{25unsigned long flags;26int i;2728flags = claim_dma_lock();2930dma_outb(0, DMA1_RESET_REG);31dma_outb(0, DMA2_RESET_REG);3233for (i = 0; i < 8; i++) {34set_dma_addr(i, 0x000000);35/* DMA count is a bit weird so this is not 0 */36set_dma_count(i, 1);37}3839/* Enable cascade DMA or channel 0-3 won't work */40enable_dma(4);4142release_dma_lock(flags);43}4445static struct syscore_ops i8237_syscore_ops = {46.resume = i8237A_resume,47};4849static int __init i8237A_init_ops(void)50{51register_syscore_ops(&i8237_syscore_ops);52return 0;53}54device_initcall(i8237A_init_ops);555657