130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng/*
230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * Intel Multimedia Timer device interface
330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng *
430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * This file is subject to the terms and conditions of the GNU General Public
530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * License.  See the file "COPYING" in the main directory of this archive
630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * for more details.
730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng *
830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * Copyright (c) 2001-2004 Silicon Graphics, Inc.  All rights reserved.
930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng *
1030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * This file should define an interface compatible with the IA-PC Multimedia
1130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * Timers Draft Specification (rev. 0.97) from Intel.  Note that some
1230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * hardware may not be able to safely export its registers to userspace,
1330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * so the ioctl interface should support all necessary functionality.
1430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng *
1530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * 11/01/01 - jbarnes - initial revision
1630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * 9/10/04 - Christoph Lameter - remove interrupt support
1730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * 9/17/04 - jbarnes - remove test program, move some #defines to the driver
1830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng */
1930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
2030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#ifndef _LINUX_MMTIMER_H
2130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define _LINUX_MMTIMER_H
2230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
2330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng/*
2430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * Breakdown of the ioctl's available.  An 'optional' next to the command
2530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * indicates that supporting this command is optional, while 'required'
2630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * commands must be implemented if conformance is desired.
2730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng *
2830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * MMTIMER_GETOFFSET - optional
2930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng *   Should return the offset (relative to the start of the page where the
3030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng *   registers are mapped) for the counter in question.
3130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng *
3230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * MMTIMER_GETRES - required
3330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng *   The resolution of the clock in femto (10^-15) seconds
3430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng *
3530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * MMTIMER_GETFREQ - required
3630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng *   Frequency of the clock in Hz
3730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng *
3830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * MMTIMER_GETBITS - required
3930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng *   Number of bits in the clock's counter
4030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng *
4130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * MMTIMER_MMAPAVAIL - required
4230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng *   Returns nonzero if the registers can be mmap'd into userspace, 0 otherwise
4330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng *
4430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * MMTIMER_GETCOUNTER - required
4530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng *   Gets the current value in the counter
4630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng */
4730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define MMTIMER_IOCTL_BASE 'm'
4830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
4930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define MMTIMER_GETOFFSET _IO(MMTIMER_IOCTL_BASE, 0)
5030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define MMTIMER_GETRES _IOR(MMTIMER_IOCTL_BASE, 1, unsigned long)
5130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define MMTIMER_GETFREQ _IOR(MMTIMER_IOCTL_BASE, 2, unsigned long)
5230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define MMTIMER_GETBITS _IO(MMTIMER_IOCTL_BASE, 4)
5330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define MMTIMER_MMAPAVAIL _IO(MMTIMER_IOCTL_BASE, 6)
5430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define MMTIMER_GETCOUNTER _IOR(MMTIMER_IOCTL_BASE, 9, unsigned long)
5530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
5630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#endif /* _LINUX_MMTIMER_H */
57