OMAP3: PM: Fixed VDD2 control to work from both sysfs and SRF API
[linux-ginger.git] / drivers / staging / rar / rar_driver.h
blob3690f984ff55a7b68d0dd86de04154f043c7f00f
1 /* === RAR Physical Addresses === */
2 struct RAR_address_struct {
3 u32 low;
4 u32 high;
5 };
7 /* The get_rar_address function is used by other device drivers
8 * to obtain RAR address information on a RAR. It takes two
9 * parameter:
11 * int rar_index
12 * The rar_index is an index to the rar for which you wish to retrieve
13 * the address information.
14 * Values can be 0,1, or 2.
16 * struct RAR_address_struct is a pointer to a place to which the function
17 * can return the address structure for the RAR.
19 * The function returns a 0 upon success or a -1 if there is no RAR
20 * facility on this system.
22 int get_rar_address(int rar_index,struct RAR_address_struct *addresses);
25 /* The lock_rar function is ued by other device drivers to lock an RAR.
26 * once an RAR is locked, it stays locked until the next system reboot.
27 * The function takes one parameter:
29 * int rar_index
30 * The rar_index is an index to the rar that you want to lock.
31 * Values can be 0,1, or 2.
33 * The function returns a 0 upon success or a -1 if there is no RAR
34 * facility on this system.
36 int lock_rar(int rar_index);
39 /* DEBUG LEVEL MASKS */
40 #define RAR_DEBUG_LEVEL_BASIC 0x1
42 #define RAR_DEBUG_LEVEL_REGISTERS 0x2
44 #define RAR_DEBUG_LEVEL_EXTENDED 0x4
46 #define DEBUG_LEVEL 0x7
48 /* FUNCTIONAL MACROS */
50 /* debug macro without paramaters */
51 #define DEBUG_PRINT_0(DEBUG_LEVEL , info) \
52 do \
53 { \
54 if(DEBUG_LEVEL) \
55 { \
56 printk(KERN_WARNING info); \
57 } \
58 }while(0)
60 /* debug macro with 1 paramater */
61 #define DEBUG_PRINT_1(DEBUG_LEVEL , info , param1) \
62 do \
63 { \
64 if(DEBUG_LEVEL) \
65 { \
66 printk(KERN_WARNING info , param1); \
67 } \
68 }while(0)
70 /* debug macro with 2 paramaters */
71 #define DEBUG_PRINT_2(DEBUG_LEVEL , info , param1, param2) \
72 do \
73 { \
74 if(DEBUG_LEVEL) \
75 { \
76 printk(KERN_WARNING info , param1, param2); \
77 } \
78 }while(0)
80 /* debug macro with 3 paramaters */
81 #define DEBUG_PRINT_3(DEBUG_LEVEL , info , param1, param2 , param3) \
82 do \
83 { \
84 if(DEBUG_LEVEL) \
85 { \
86 printk(KERN_WARNING info , param1, param2 , param3); \
87 } \
88 }while(0)
90 /* debug macro with 4 paramaters */
91 #define DEBUG_PRINT_4(DEBUG_LEVEL , info , param1, param2 , param3 , param4) \
92 do \
93 { \
94 if(DEBUG_LEVEL) \
95 { \
96 printk(KERN_WARNING info , param1, param2 , param3 , param4); \
97 } \
98 }while(0)