Save sram context after changing MPU, DSP or core clocks
[linux-ginger.git] / drivers / cbus / user_retu_tahvo.h
bloba5c219026c5966ba45dffd1fb58da14ba8df1979
1 /**
2 * drivers/cbus/user_retu_tahvo.h
4 * Copyright (C) 2004, 2005 Nokia Corporation
6 * Written by Mikko Ylinen <mikko.k.ylinen@nokia.com>
8 * Definitions and types used by both retu-user and tahvo-user.
10 * This file is subject to the terms and conditions of the GNU General
11 * Public License. See the file "COPYING" in the main directory of this
12 * archive for more details.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #ifndef _USER_RETU_TAHVO_H
25 #define _USER_RETU_TAHVO_H
27 /* Chip IDs */
28 #define CHIP_RETU 1
29 #define CHIP_TAHVO 2
31 /* Register access type bits */
32 #define READ_ONLY 1
33 #define WRITE_ONLY 2
34 #define READ_WRITE 3
35 #define TOGGLE 4
37 #define MASK(field) ((u16)(field & 0xFFFF))
38 #define REG(field) ((u16)((field >> 16) & 0x3F))
40 /*** IOCTL definitions. These should be kept in sync with user space **********/
42 #define URT_IOC_MAGIC '`'
45 * IOCTL function naming conventions:
46 * ==================================
47 * 0 -- No argument and return value
48 * S -- Set through a pointer
49 * T -- Tell directly with the argument value
50 * G -- Reply by setting through a pointer
51 * Q -- response is on the return value
52 * X -- S and G atomically
53 * H -- T and Q atomically
56 /* General */
57 #define URT_IOCT_IRQ_SUBSCR _IO(URT_IOC_MAGIC, 0)
59 /* RETU */
60 #define RETU_IOCH_READ _IO(URT_IOC_MAGIC, 1)
61 #define RETU_IOCX_WRITE _IO(URT_IOC_MAGIC, 2)
62 #define RETU_IOCH_ADC_READ _IO(URT_IOC_MAGIC, 3)
64 /* TAHVO */
65 #define TAHVO_IOCH_READ _IO(URT_IOC_MAGIC, 4)
66 #define TAHVO_IOCX_WRITE _IO(URT_IOC_MAGIC, 5)
68 /* This structure is used for writing RETU/TAHVO registers */
69 struct retu_tahvo_write_parms {
70 u32 field;
71 u16 value;
72 u8 result;
75 #endif