1*607ca46eSDavid Howells /* 2*607ca46eSDavid Howells * Intel Multimedia Timer device interface 3*607ca46eSDavid Howells * 4*607ca46eSDavid Howells * This file is subject to the terms and conditions of the GNU General Public 5*607ca46eSDavid Howells * License. See the file "COPYING" in the main directory of this archive 6*607ca46eSDavid Howells * for more details. 7*607ca46eSDavid Howells * 8*607ca46eSDavid Howells * Copyright (c) 2001-2004 Silicon Graphics, Inc. All rights reserved. 9*607ca46eSDavid Howells * 10*607ca46eSDavid Howells * This file should define an interface compatible with the IA-PC Multimedia 11*607ca46eSDavid Howells * Timers Draft Specification (rev. 0.97) from Intel. Note that some 12*607ca46eSDavid Howells * hardware may not be able to safely export its registers to userspace, 13*607ca46eSDavid Howells * so the ioctl interface should support all necessary functionality. 14*607ca46eSDavid Howells * 15*607ca46eSDavid Howells * 11/01/01 - jbarnes - initial revision 16*607ca46eSDavid Howells * 9/10/04 - Christoph Lameter - remove interrupt support 17*607ca46eSDavid Howells * 9/17/04 - jbarnes - remove test program, move some #defines to the driver 18*607ca46eSDavid Howells */ 19*607ca46eSDavid Howells 20*607ca46eSDavid Howells #ifndef _LINUX_MMTIMER_H 21*607ca46eSDavid Howells #define _LINUX_MMTIMER_H 22*607ca46eSDavid Howells 23*607ca46eSDavid Howells /* 24*607ca46eSDavid Howells * Breakdown of the ioctl's available. An 'optional' next to the command 25*607ca46eSDavid Howells * indicates that supporting this command is optional, while 'required' 26*607ca46eSDavid Howells * commands must be implemented if conformance is desired. 27*607ca46eSDavid Howells * 28*607ca46eSDavid Howells * MMTIMER_GETOFFSET - optional 29*607ca46eSDavid Howells * Should return the offset (relative to the start of the page where the 30*607ca46eSDavid Howells * registers are mapped) for the counter in question. 31*607ca46eSDavid Howells * 32*607ca46eSDavid Howells * MMTIMER_GETRES - required 33*607ca46eSDavid Howells * The resolution of the clock in femto (10^-15) seconds 34*607ca46eSDavid Howells * 35*607ca46eSDavid Howells * MMTIMER_GETFREQ - required 36*607ca46eSDavid Howells * Frequency of the clock in Hz 37*607ca46eSDavid Howells * 38*607ca46eSDavid Howells * MMTIMER_GETBITS - required 39*607ca46eSDavid Howells * Number of bits in the clock's counter 40*607ca46eSDavid Howells * 41*607ca46eSDavid Howells * MMTIMER_MMAPAVAIL - required 42*607ca46eSDavid Howells * Returns nonzero if the registers can be mmap'd into userspace, 0 otherwise 43*607ca46eSDavid Howells * 44*607ca46eSDavid Howells * MMTIMER_GETCOUNTER - required 45*607ca46eSDavid Howells * Gets the current value in the counter 46*607ca46eSDavid Howells */ 47*607ca46eSDavid Howells #define MMTIMER_IOCTL_BASE 'm' 48*607ca46eSDavid Howells 49*607ca46eSDavid Howells #define MMTIMER_GETOFFSET _IO(MMTIMER_IOCTL_BASE, 0) 50*607ca46eSDavid Howells #define MMTIMER_GETRES _IOR(MMTIMER_IOCTL_BASE, 1, unsigned long) 51*607ca46eSDavid Howells #define MMTIMER_GETFREQ _IOR(MMTIMER_IOCTL_BASE, 2, unsigned long) 52*607ca46eSDavid Howells #define MMTIMER_GETBITS _IO(MMTIMER_IOCTL_BASE, 4) 53*607ca46eSDavid Howells #define MMTIMER_MMAPAVAIL _IO(MMTIMER_IOCTL_BASE, 6) 54*607ca46eSDavid Howells #define MMTIMER_GETCOUNTER _IOR(MMTIMER_IOCTL_BASE, 9, unsigned long) 55*607ca46eSDavid Howells 56*607ca46eSDavid Howells #endif /* _LINUX_MMTIMER_H */ 57