Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
lkkbd.c File Reference
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/serio.h>
#include <linux/workqueue.h>

Go to the source code of this file.

Data Structures

struct  lkkbd
 

Macros

#define DRIVER_DESC   "LK keyboard driver"
 
#define DBG(x...)   do {} while (0)
 
#define LK_LED_WAIT   0x81
 
#define LK_LED_COMPOSE   0x82
 
#define LK_LED_SHIFTLOCK   0x84
 
#define LK_LED_SCROLLLOCK   0x88
 
#define LK_CMD_LED_ON   0x13
 
#define LK_CMD_LED_OFF   0x11
 
#define LK_MODE_DOWN   0x80
 
#define LK_MODE_AUTODOWN   0x82
 
#define LK_MODE_UPDOWN   0x86
 
#define LK_CMD_SET_MODE(mode, div)   ((mode) | ((div) << 3))
 
#define LK_CMD_ENABLE_KEYCLICK   0x1b
 
#define LK_CMD_DISABLE_KEYCLICK   0x99
 
#define LK_CMD_DISABLE_BELL   0xa1
 
#define LK_CMD_SOUND_BELL   0xa7
 
#define LK_CMD_ENABLE_BELL   0x23
 
#define LK_CMD_DISABLE_CTRCLICK   0xb9
 
#define LK_CMD_ENABLE_CTRCLICK   0xbb
 
#define LK_CMD_SET_DEFAULTS   0xd3
 
#define LK_CMD_POWERCYCLE_RESET   0xfd
 
#define LK_CMD_ENABLE_LK401   0xe9
 
#define LK_CMD_REQUEST_ID   0xab
 
#define LK_STUCK_KEY   0x3d
 
#define LK_SELFTEST_FAILED   0x3e
 
#define LK_ALL_KEYS_UP   0xb3
 
#define LK_METRONOME   0xb4
 
#define LK_OUTPUT_ERROR   0xb5
 
#define LK_INPUT_ERROR   0xb6
 
#define LK_KBD_LOCKED   0xb7
 
#define LK_KBD_TEST_MODE_ACK   0xb8
 
#define LK_PREFIX_KEY_DOWN   0xb9
 
#define LK_MODE_CHANGE_ACK   0xba
 
#define LK_RESPONSE_RESERVED   0xbb
 
#define LK_NUM_KEYCODES   256
 
#define LK_NUM_IGNORE_BYTES   6
 
#define CHECK_LED(LK, VAR_ON, VAR_OFF, LED, BITS)
 

Functions

 MODULE_AUTHOR ("Jan-Benedict Glaw <[email protected]>")
 
 MODULE_DESCRIPTION (DRIVER_DESC)
 
 MODULE_LICENSE ("GPL")
 
 module_param (bell_volume, int, 0)
 
 MODULE_PARM_DESC (bell_volume,"Bell volume (in %). default is 100%")
 
 module_param (keyclick_volume, int, 0)
 
 MODULE_PARM_DESC (keyclick_volume,"Keyclick volume (in %), default is 100%")
 
 module_param (ctrlclick_volume, int, 0)
 
 MODULE_PARM_DESC (ctrlclick_volume,"Ctrlclick volume (in %), default is 100%")
 
 module_param (lk201_compose_is_alt, int, 0)
 
 MODULE_PARM_DESC (lk201_compose_is_alt,"If set non-zero, LK201' Compose key will act as an Alt key")
 
 MODULE_DEVICE_TABLE (serio, lkkbd_serio_ids)
 
 module_serio_driver (lkkbd_drv)
 

Macro Definition Documentation

#define CHECK_LED (   LK,
  VAR_ON,
  VAR_OFF,
  LED,
  BITS 
)
Value:
do { \
if (test_bit(LED, (LK)->dev->led)) \
VAR_ON |= BITS; \
else \
VAR_OFF |= BITS; \
} while (0)

Definition at line 267 of file lkkbd.c.

#define DBG (   x...)    do {} while (0)

Definition at line 110 of file lkkbd.c.

#define DRIVER_DESC   "LK keyboard driver"

Definition at line 73 of file lkkbd.c.

#define LK_ALL_KEYS_UP   0xb3

Definition at line 143 of file lkkbd.c.

#define LK_CMD_DISABLE_BELL   0xa1

Definition at line 130 of file lkkbd.c.

#define LK_CMD_DISABLE_CTRCLICK   0xb9

Definition at line 133 of file lkkbd.c.

#define LK_CMD_DISABLE_KEYCLICK   0x99

Definition at line 129 of file lkkbd.c.

#define LK_CMD_ENABLE_BELL   0x23

Definition at line 132 of file lkkbd.c.

#define LK_CMD_ENABLE_CTRCLICK   0xbb

Definition at line 134 of file lkkbd.c.

#define LK_CMD_ENABLE_KEYCLICK   0x1b

Definition at line 128 of file lkkbd.c.

#define LK_CMD_ENABLE_LK401   0xe9

Definition at line 137 of file lkkbd.c.

#define LK_CMD_LED_OFF   0x11

Definition at line 119 of file lkkbd.c.

#define LK_CMD_LED_ON   0x13

Definition at line 118 of file lkkbd.c.

#define LK_CMD_POWERCYCLE_RESET   0xfd

Definition at line 136 of file lkkbd.c.

#define LK_CMD_REQUEST_ID   0xab

Definition at line 138 of file lkkbd.c.

#define LK_CMD_SET_DEFAULTS   0xd3

Definition at line 135 of file lkkbd.c.

#define LK_CMD_SET_MODE (   mode,
  div 
)    ((mode) | ((div) << 3))

Definition at line 125 of file lkkbd.c.

#define LK_CMD_SOUND_BELL   0xa7

Definition at line 131 of file lkkbd.c.

#define LK_INPUT_ERROR   0xb6

Definition at line 146 of file lkkbd.c.

#define LK_KBD_LOCKED   0xb7

Definition at line 147 of file lkkbd.c.

#define LK_KBD_TEST_MODE_ACK   0xb8

Definition at line 148 of file lkkbd.c.

#define LK_LED_COMPOSE   0x82

Definition at line 115 of file lkkbd.c.

#define LK_LED_SCROLLLOCK   0x88

Definition at line 117 of file lkkbd.c.

#define LK_LED_SHIFTLOCK   0x84

Definition at line 116 of file lkkbd.c.

#define LK_LED_WAIT   0x81

Definition at line 114 of file lkkbd.c.

#define LK_METRONOME   0xb4

Definition at line 144 of file lkkbd.c.

#define LK_MODE_AUTODOWN   0x82

Definition at line 123 of file lkkbd.c.

#define LK_MODE_CHANGE_ACK   0xba

Definition at line 150 of file lkkbd.c.

#define LK_MODE_DOWN   0x80

Definition at line 122 of file lkkbd.c.

#define LK_MODE_UPDOWN   0x86

Definition at line 124 of file lkkbd.c.

#define LK_NUM_IGNORE_BYTES   6

Definition at line 154 of file lkkbd.c.

#define LK_NUM_KEYCODES   256

Definition at line 153 of file lkkbd.c.

#define LK_OUTPUT_ERROR   0xb5

Definition at line 145 of file lkkbd.c.

#define LK_PREFIX_KEY_DOWN   0xb9

Definition at line 149 of file lkkbd.c.

#define LK_RESPONSE_RESERVED   0xbb

Definition at line 151 of file lkkbd.c.

#define LK_SELFTEST_FAILED   0x3e

Definition at line 142 of file lkkbd.c.

#define LK_STUCK_KEY   0x3d

Definition at line 141 of file lkkbd.c.

Function Documentation

MODULE_AUTHOR ( "Jan-Benedict Glaw <[email protected]>"  )
MODULE_DESCRIPTION ( DRIVER_DESC  )
MODULE_DEVICE_TABLE ( serio  ,
lkkbd_serio_ids   
)
MODULE_LICENSE ( "GPL"  )
module_param ( bell_volume  ,
int  ,
 
)
module_param ( keyclick_volume  ,
int  ,
 
)
module_param ( ctrlclick_volume  ,
int  ,
 
)
module_param ( lk201_compose_is_alt  ,
int  ,
 
)
MODULE_PARM_DESC ( bell_volume  ,
"Bell volume (in %). default is 100%"   
)
MODULE_PARM_DESC ( keyclick_volume  ,
"Keyclick volume   in %,
default is 100%"   
)
MODULE_PARM_DESC ( ctrlclick_volume  ,
"Ctrlclick volume   in %,
default is 100%"   
)
MODULE_PARM_DESC ( lk201_compose_is_alt  ,
"If set non-  zero,
LK201'Compose key will act as an Alt key  
)
module_serio_driver ( lkkbd_drv  )