~ubuntu-branches/ubuntu/vivid/linux-ti-omap/vivid

« back to all changes in this revision

Viewing changes to ubuntu/omnibook/omnibook.h

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Bader, Amit Kucheria
  • Date: 2010-03-23 18:05:12 UTC
  • Revision ID: james.westby@ubuntu.com-20100323180512-iavj906ocnphdubp
Tags: 2.6.33-500.3
[ Amit Kucheria ]

* [Config] Fix the debug package name to end in -dbgsym
* SAUCE: Add the ubuntu/ drivers to omap
* SAUCE: Re-export the symbols for aufs
* [Config] Enable AUFS and COMPCACHE

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * omnibook.h -- High level data structures and functions of omnibook
 
3
 *               support code
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or modify it
 
6
 * under the terms of the GNU General Public License as published by the
 
7
 * Free Software Foundation; either version 2, or (at your option) any
 
8
 * later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful, but
 
11
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
 * General Public License for more details.
 
14
 *
 
15
 * Written by Soós Péter <sp@osb.hu>, 2002-2004
 
16
 * Modified by Mathieu Bérard <mathieu.berard@crans.org>, 2006-2007
 
17
 */
 
18
 
 
19
#include <linux/module.h>
 
20
#include <linux/moduleparam.h>
 
21
#include <linux/input.h>
 
22
#include <linux/version.h>
 
23
 
 
24
/*
 
25
 * EC types
 
26
 */
 
27
 
 
28
extern enum omnibook_ectype_t {
 
29
        NONE   = 0,       /* 0  Default/unknown EC type */ 
 
30
        XE3GF  = (1<<0),  /* 1  HP OmniBook XE3 GF, most old Toshiba Satellites */
 
31
        XE3GC  = (1<<1),  /* 2  HP OmniBook XE3 GC, GD, GE and compatible */
 
32
        OB500  = (1<<2),  /* 3  HP OmniBook 500 and compatible */
 
33
        OB510  = (1<<3),  /* 4  HP OmniBook 510 */
 
34
        OB6000 = (1<<4),  /* 5  HP OmniBook 6000 */
 
35
        OB6100 = (1<<5),  /* 6  HP OmniBook 6100 */
 
36
        XE4500 = (1<<6),  /* 7  HP OmniBook xe4500 and compatible */
 
37
        OB4150 = (1<<7),  /* 8  HP OmniBook 4150 */
 
38
        XE2    = (1<<8),  /* 9  HP OmniBook XE2 */
 
39
        AMILOD = (1<<9),  /* 10 Fujitsu Amilo D */
 
40
        TSP10  = (1<<10), /* 11 Toshiba Satellite P10, P15, P20 and compatible */
 
41
        TSM70  = (1<<11), /* 12 Toshiba Satellite M40X, M70 and compatible */
 
42
        TSM40  = (1<<12), /* 13 Toshiba Satellite M40, M45 and Tecra S1 */
 
43
        TSA105 = (1<<13), /* 14 Toshiba Satellite A105 and compatible (Real support is MISSING) */
 
44
        TSM30X = (1<<14), /* 15 Toshiba Stallite M30X and compatible */
 
45
        TSX205 = (1<<15)  /* 16 Toshiba Stallite X205 and compatible */
 
46
} omnibook_ectype;
 
47
 
 
48
#define ALL_ECTYPES XE3GF|XE3GC|OB500|OB510|OB6000|OB6100|XE4500|OB4150|XE2|AMILOD|TSP10|TSM70|TSM40|TSA105|TSM30X|TSX205
 
49
 
 
50
/*
 
51
 * This represent a feature provided by this module
 
52
 */
 
53
 
 
54
struct omnibook_operation;
 
55
 
 
56
struct omnibook_feature {
 
57
        char *name;                                             /* Name */
 
58
        int enabled;                                            /* Set from module parameter */
 
59
        int (*read) (char *,struct omnibook_operation *);       /* Procfile read function */
 
60
        int (*write) (char *,struct omnibook_operation *);      /* Procfile write function */
 
61
        int (*init) (struct omnibook_operation *);              /* Specific Initialization function */
 
62
        void (*exit) (struct omnibook_operation *);             /* Specific Cleanup function */
 
63
        int (*suspend) (struct omnibook_operation *);           /* PM Suspend function */
 
64
        int (*resume) (struct omnibook_operation *);            /* PM Resume function */
 
65
        int ectypes;                                            /* Type(s) of EC we support for this feature (bitmask) */
 
66
        struct omnibook_tbl *tbl;
 
67
        struct omnibook_operation *io_op;
 
68
        struct list_head list;
 
69
};
 
70
 
 
71
/*
 
72
 * State of a Wifi/Bluetooth adapter
 
73
 */
 
74
enum {
 
75
        WIFI_EX = (1<<0),       /* 1 1=present 0=absent */
 
76
        WIFI_STA = (1<<1),      /* 2 1=enabled 0=disabled */
 
77
        KILLSWITCH = (1<<2),    /* 4 1=radio on 0=radio off */
 
78
        BT_EX = (1<<3),         /* 8 1=present 0=absent */
 
79
        BT_STA = (1<<4),        /* 16 1=enabled 0=disabled */
 
80
};
 
81
 
 
82
/*
 
83
 * Hotkeys state backend neutral masks
 
84
 */
 
85
enum {
 
86
        HKEY_ONETOUCH = (1<<0),         /* 1   Ontetouch button scancode generation */
 
87
        HKEY_MULTIMEDIA = (1<<1),       /* 2   "Multimedia hotkeys" scancode generation */      
 
88
        HKEY_FN = (1<<2),               /* 4   Fn + foo hotkeys scancode generation */
 
89
        HKEY_STICK = (1<<3),            /* 8   Stick key (Fn locked/unlocked on keypress)  */
 
90
        HKEY_TWICE_LOCK = (1<<4),       /* 16  Press Fn twice to lock */
 
91
        HKEY_DOCK = (1<<5),             /* 32  (Un)Dock events scancode generation */
 
92
        HKEY_FNF5 = (1<<6),             /* 64  Fn + F5 (toggle display) is enabled */
 
93
};
 
94
 
 
95
#define HKEY_LAST_SHIFT 6
 
96
 
 
97
/*
 
98
 * Display state backend neutral masks
 
99
 * _ON masks = port is powered up and running
 
100
 * _DET masks = a plugged display have been detected 
 
101
 */
 
102
 
 
103
enum {  
 
104
        DISPLAY_LCD_ON = (1<<0),        /* 1 Internal LCD panel */
 
105
        DISPLAY_CRT_ON = (1<<1),        /* 2 External VGA port */
 
106
        DISPLAY_TVO_ON = (1<<2),        /* 4 External TV-OUT port */
 
107
        DISPLAY_DVI_ON = (1<<3),        /* 8 External DVI port */
 
108
        DISPLAY_LCD_DET = (1<<4),       /* 16 Internal LCD panel */
 
109
        DISPLAY_CRT_DET = (1<<5),       /* 32 External VGA port */
 
110
        DISPLAY_TVO_DET = (1<<6),       /* 64 External TV-OUT port */
 
111
        DISPLAY_DVI_DET = (1<<7),       /* 128 External DVI port */
 
112
};
 
113
 
 
114
extern unsigned int omnibook_max_brightness;
 
115
int set_omnibook_param(const char *val, struct kernel_param *kp);
 
116
int omnibook_lcd_blank(int blank);
 
117
struct omnibook_feature *omnibook_find_feature(char *name);
 
118
void omnibook_report_key(struct input_dev *dev, unsigned int keycode);
 
119
 
 
120
/* 
 
121
 * __attribute_used__ is not defined anymore in 2.6.24
 
122
 * but __used appeared only in 2.6.22
 
123
 */
 
124
#ifndef __used
 
125
#define __used  __attribute_used__
 
126
#endif
 
127
 
 
128
#define __declared_feature __attribute__ (( __section__(".features"),  __aligned__(__alignof__ (struct omnibook_feature)))) __used
 
129
 
 
130
/*
 
131
 * yet another printk wrapper
 
132
 */
 
133
#define O_INFO  KERN_INFO OMNIBOOK_MODULE_NAME ": "
 
134
#define O_WARN  KERN_WARNING OMNIBOOK_MODULE_NAME ": "
 
135
#define O_ERR   KERN_ERR OMNIBOOK_MODULE_NAME ": "
 
136
 
 
137
#ifdef CONFIG_OMNIBOOK_DEBUG
 
138
#define dprintk(fmt, args...) printk(KERN_INFO "%s: " fmt, OMNIBOOK_MODULE_NAME, ## args)
 
139
#define dprintk_simple(fmt, args...) printk(fmt, ## args)
 
140
#else
 
141
#define dprintk(fmt, args...)   do { } while(0)
 
142
#define dprintk_simple(fmt, args...) do { } while(0)
 
143
#endif
 
144
 
 
145
/* End of file */