2
* omnibook.h -- High level data structures and functions of omnibook
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
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.
15
* Written by Soós Péter <sp@osb.hu>, 2002-2004
16
* Modified by Mathieu Bérard <mathieu.berard@crans.org>, 2006-2007
19
#include <linux/module.h>
20
#include <linux/moduleparam.h>
21
#include <linux/input.h>
22
#include <linux/version.h>
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 */
48
#define ALL_ECTYPES XE3GF|XE3GC|OB500|OB510|OB6000|OB6100|XE4500|OB4150|XE2|AMILOD|TSP10|TSM70|TSM40|TSA105|TSM30X|TSX205
51
* This represent a feature provided by this module
54
struct omnibook_operation;
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;
72
* State of a Wifi/Bluetooth adapter
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 */
83
* Hotkeys state backend neutral masks
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 */
95
#define HKEY_LAST_SHIFT 6
98
* Display state backend neutral masks
99
* _ON masks = port is powered up and running
100
* _DET masks = a plugged display have been detected
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 */
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);
121
* __attribute_used__ is not defined anymore in 2.6.24
122
* but __used appeared only in 2.6.22
125
#define __used __attribute_used__
128
#define __declared_feature __attribute__ (( __section__(".features"), __aligned__(__alignof__ (struct omnibook_feature)))) __used
131
* yet another printk wrapper
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 ": "
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)
141
#define dprintk(fmt, args...) do { } while(0)
142
#define dprintk_simple(fmt, args...) do { } while(0)