Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
sonypi.c File Reference
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/input.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/miscdevice.h>
#include <linux/poll.h>
#include <linux/delay.h>
#include <linux/wait.h>
#include <linux/acpi.h>
#include <linux/dmi.h>
#include <linux/err.h>
#include <linux/kfifo.h>
#include <linux/platform_device.h>
#include <linux/gfp.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <linux/sonypi.h>

Go to the source code of this file.

Data Structures

struct  sonypi_ioport_list
 
struct  sonypi_irq_list
 
struct  sonypi_event
 
struct  sonypi_eventtypes
 
struct  sonypi_keypress
 
struct  sonypi_device
 

Macros

#define SONYPI_DRIVER_VERSION   "1.26"
 
#define SONYPI_DEVICE_MODEL_TYPE1   1
 
#define SONYPI_DEVICE_MODEL_TYPE2   2
 
#define SONYPI_DEVICE_MODEL_TYPE3   3
 
#define SONYPI_IRQ_PORT   0x8034
 
#define SONYPI_IRQ_SHIFT   22
 
#define SONYPI_TYPE1_BASE   0x50
 
#define SONYPI_G10A   (SONYPI_TYPE1_BASE+0x14)
 
#define SONYPI_TYPE1_REGION_SIZE   0x08
 
#define SONYPI_TYPE1_EVTYPE_OFFSET   0x04
 
#define SONYPI_SIRQ   0x9b
 
#define SONYPI_SLOB   0x9c
 
#define SONYPI_SHIB   0x9d
 
#define SONYPI_TYPE2_REGION_SIZE   0x20
 
#define SONYPI_TYPE2_EVTYPE_OFFSET   0x12
 
#define SONYPI_TYPE3_BASE   0x40
 
#define SONYPI_TYPE3_GID2   (SONYPI_TYPE3_BASE+0x48) /* 16 bits */
 
#define SONYPI_TYPE3_MISC   (SONYPI_TYPE3_BASE+0x6d) /* 8 bits */
 
#define SONYPI_TYPE3_REGION_SIZE   0x20
 
#define SONYPI_TYPE3_EVTYPE_OFFSET   0x12
 
#define SONYPI_BAT_FLAGS   0x81
 
#define SONYPI_LCD_LIGHT   0x96
 
#define SONYPI_BAT1_PCTRM   0xa0
 
#define SONYPI_BAT1_LEFT   0xa2
 
#define SONYPI_BAT1_MAXRT   0xa4
 
#define SONYPI_BAT2_PCTRM   0xa8
 
#define SONYPI_BAT2_LEFT   0xaa
 
#define SONYPI_BAT2_MAXRT   0xac
 
#define SONYPI_BAT1_MAXTK   0xb0
 
#define SONYPI_BAT1_FULL   0xb2
 
#define SONYPI_BAT2_MAXTK   0xb8
 
#define SONYPI_BAT2_FULL   0xba
 
#define SONYPI_FAN0_STATUS   0x93
 
#define SONYPI_TEMP_STATUS   0xC1
 
#define SONYPI_DATA_IOPORT   0x62
 
#define SONYPI_CST_IOPORT   0x66
 
#define SONYPI_CAMERA_BRIGHTNESS   0
 
#define SONYPI_CAMERA_CONTRAST   1
 
#define SONYPI_CAMERA_HUE   2
 
#define SONYPI_CAMERA_COLOR   3
 
#define SONYPI_CAMERA_SHARPNESS   4
 
#define SONYPI_CAMERA_PICTURE   5
 
#define SONYPI_CAMERA_EXPOSURE_MASK   0xC
 
#define SONYPI_CAMERA_WHITE_BALANCE_MASK   0x3
 
#define SONYPI_CAMERA_PICTURE_MODE_MASK   0x30
 
#define SONYPI_CAMERA_MUTE_MASK   0x40
 
#define SONYPI_CAMERA_AGC   6
 
#define SONYPI_CAMERA_AGC_MASK   0x30
 
#define SONYPI_CAMERA_SHUTTER_MASK   0x7
 
#define SONYPI_CAMERA_SHUTDOWN_REQUEST   7
 
#define SONYPI_CAMERA_CONTROL   0x10
 
#define SONYPI_CAMERA_STATUS   7
 
#define SONYPI_CAMERA_STATUS_READY   0x2
 
#define SONYPI_CAMERA_STATUS_POSITION   0x4
 
#define SONYPI_DIRECTION_BACKWARDS   0x4
 
#define SONYPI_CAMERA_REVISION   8
 
#define SONYPI_CAMERA_ROMVERSION   9
 
#define SONYPI_JOGGER_MASK   0x00000001
 
#define SONYPI_CAPTURE_MASK   0x00000002
 
#define SONYPI_FNKEY_MASK   0x00000004
 
#define SONYPI_BLUETOOTH_MASK   0x00000008
 
#define SONYPI_PKEY_MASK   0x00000010
 
#define SONYPI_BACK_MASK   0x00000020
 
#define SONYPI_HELP_MASK   0x00000040
 
#define SONYPI_LID_MASK   0x00000080
 
#define SONYPI_ZOOM_MASK   0x00000100
 
#define SONYPI_THUMBPHRASE_MASK   0x00000200
 
#define SONYPI_MEYE_MASK   0x00000400
 
#define SONYPI_MEMORYSTICK_MASK   0x00000800
 
#define SONYPI_BATTERY_MASK   0x00001000
 
#define SONYPI_WIRELESS_MASK   0x00002000
 
#define SONYPI_BUF_SIZE   128
 
#define ITERATIONS_LONG   10000
 
#define ITERATIONS_SHORT   10
 
#define wait_on_command(quiet, command, iterations)
 
#define SONYPI_ACPI_ACTIVE   0
 
#define SONYPI_PM   NULL
 

Functions

 MODULE_AUTHOR ("Stelian Pop <[email protected]>")
 
 MODULE_DESCRIPTION ("Sony Programmable I/O Control Device driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (SONYPI_DRIVER_VERSION)
 
 module_param (minor, int, 0)
 
 MODULE_PARM_DESC (minor,"minor number of the misc device, default is -1 (automatic)")
 
 module_param (verbose, int, 0644)
 
 MODULE_PARM_DESC (verbose,"be verbose, default is 0 (no)")
 
 module_param (fnkeyinit, int, 0444)
 
 MODULE_PARM_DESC (fnkeyinit,"set this if your Fn keys do not generate any event")
 
 module_param (camera, int, 0444)
 
 MODULE_PARM_DESC (camera,"set this if you have a MotionEye camera (PictureBook series)")
 
 module_param (compat, int, 0444)
 
 MODULE_PARM_DESC (compat,"set this if you want to enable backward compatibility mode")
 
 module_param (mask, ulong, 0644)
 
 MODULE_PARM_DESC (mask,"set this to the mask of event you want to enable (see doc)")
 
 module_param (useinput, int, 0444)
 
 MODULE_PARM_DESC (useinput,"set this if you would like sonypi to feed events to the input subsystem")
 
 module_param (check_ioport, int, 0444)
 
 MODULE_PARM_DESC (check_ioport,"set this to 0 if you think the automatic ioport check for sony-laptop is wrong")
 
 module_init (sonypi_init)
 
 module_exit (sonypi_exit)
 

Macro Definition Documentation

#define ITERATIONS_LONG   10000

Definition at line 502 of file sonypi.c.

#define ITERATIONS_SHORT   10

Definition at line 503 of file sonypi.c.

#define SONYPI_ACPI_ACTIVE   0

Definition at line 516 of file sonypi.c.

#define SONYPI_BACK_MASK   0x00000020

Definition at line 240 of file sonypi.c.

#define SONYPI_BAT1_FULL   0xb2

Definition at line 142 of file sonypi.c.

#define SONYPI_BAT1_LEFT   0xa2

Definition at line 136 of file sonypi.c.

#define SONYPI_BAT1_MAXRT   0xa4

Definition at line 137 of file sonypi.c.

#define SONYPI_BAT1_MAXTK   0xb0

Definition at line 141 of file sonypi.c.

#define SONYPI_BAT1_PCTRM   0xa0

Definition at line 135 of file sonypi.c.

#define SONYPI_BAT2_FULL   0xba

Definition at line 144 of file sonypi.c.

#define SONYPI_BAT2_LEFT   0xaa

Definition at line 139 of file sonypi.c.

#define SONYPI_BAT2_MAXRT   0xac

Definition at line 140 of file sonypi.c.

#define SONYPI_BAT2_MAXTK   0xb8

Definition at line 143 of file sonypi.c.

#define SONYPI_BAT2_PCTRM   0xa8

Definition at line 138 of file sonypi.c.

#define SONYPI_BAT_FLAGS   0x81

Definition at line 133 of file sonypi.c.

#define SONYPI_BATTERY_MASK   0x00001000

Definition at line 247 of file sonypi.c.

#define SONYPI_BLUETOOTH_MASK   0x00000008

Definition at line 238 of file sonypi.c.

#define SONYPI_BUF_SIZE   128

Definition at line 432 of file sonypi.c.

#define SONYPI_CAMERA_AGC   6

Definition at line 218 of file sonypi.c.

#define SONYPI_CAMERA_AGC_MASK   0x30

Definition at line 219 of file sonypi.c.

#define SONYPI_CAMERA_BRIGHTNESS   0

Definition at line 205 of file sonypi.c.

#define SONYPI_CAMERA_COLOR   3

Definition at line 208 of file sonypi.c.

#define SONYPI_CAMERA_CONTRAST   1

Definition at line 206 of file sonypi.c.

#define SONYPI_CAMERA_CONTROL   0x10

Definition at line 223 of file sonypi.c.

#define SONYPI_CAMERA_EXPOSURE_MASK   0xC

Definition at line 212 of file sonypi.c.

#define SONYPI_CAMERA_HUE   2

Definition at line 207 of file sonypi.c.

#define SONYPI_CAMERA_MUTE_MASK   0x40

Definition at line 215 of file sonypi.c.

#define SONYPI_CAMERA_PICTURE   5

Definition at line 211 of file sonypi.c.

#define SONYPI_CAMERA_PICTURE_MODE_MASK   0x30

Definition at line 214 of file sonypi.c.

#define SONYPI_CAMERA_REVISION   8

Definition at line 231 of file sonypi.c.

#define SONYPI_CAMERA_ROMVERSION   9

Definition at line 232 of file sonypi.c.

#define SONYPI_CAMERA_SHARPNESS   4

Definition at line 209 of file sonypi.c.

#define SONYPI_CAMERA_SHUTDOWN_REQUEST   7

Definition at line 222 of file sonypi.c.

#define SONYPI_CAMERA_SHUTTER_MASK   0x7

Definition at line 220 of file sonypi.c.

#define SONYPI_CAMERA_STATUS   7

Definition at line 225 of file sonypi.c.

#define SONYPI_CAMERA_STATUS_POSITION   0x4

Definition at line 227 of file sonypi.c.

#define SONYPI_CAMERA_STATUS_READY   0x2

Definition at line 226 of file sonypi.c.

#define SONYPI_CAMERA_WHITE_BALANCE_MASK   0x3

Definition at line 213 of file sonypi.c.

#define SONYPI_CAPTURE_MASK   0x00000002

Definition at line 236 of file sonypi.c.

#define SONYPI_CST_IOPORT   0x66

Definition at line 152 of file sonypi.c.

#define SONYPI_DATA_IOPORT   0x62

Definition at line 151 of file sonypi.c.

#define SONYPI_DEVICE_MODEL_TYPE1   1

Definition at line 106 of file sonypi.c.

#define SONYPI_DEVICE_MODEL_TYPE2   2

Definition at line 107 of file sonypi.c.

#define SONYPI_DEVICE_MODEL_TYPE3   3

Definition at line 108 of file sonypi.c.

#define SONYPI_DIRECTION_BACKWARDS   0x4

Definition at line 229 of file sonypi.c.

#define SONYPI_DRIVER_VERSION   "1.26"

Definition at line 60 of file sonypi.c.

#define SONYPI_FAN0_STATUS   0x93

Definition at line 147 of file sonypi.c.

#define SONYPI_FNKEY_MASK   0x00000004

Definition at line 237 of file sonypi.c.

#define SONYPI_G10A   (SONYPI_TYPE1_BASE+0x14)

Definition at line 114 of file sonypi.c.

#define SONYPI_HELP_MASK   0x00000040

Definition at line 241 of file sonypi.c.

#define SONYPI_IRQ_PORT   0x8034

Definition at line 111 of file sonypi.c.

#define SONYPI_IRQ_SHIFT   22

Definition at line 112 of file sonypi.c.

#define SONYPI_JOGGER_MASK   0x00000001

Definition at line 235 of file sonypi.c.

#define SONYPI_LCD_LIGHT   0x96

Definition at line 134 of file sonypi.c.

#define SONYPI_LID_MASK   0x00000080

Definition at line 242 of file sonypi.c.

#define SONYPI_MEMORYSTICK_MASK   0x00000800

Definition at line 246 of file sonypi.c.

#define SONYPI_MEYE_MASK   0x00000400

Definition at line 245 of file sonypi.c.

#define SONYPI_PKEY_MASK   0x00000010

Definition at line 239 of file sonypi.c.

#define SONYPI_PM   NULL

Definition at line 1479 of file sonypi.c.

#define SONYPI_SHIB   0x9d

Definition at line 121 of file sonypi.c.

#define SONYPI_SIRQ   0x9b

Definition at line 119 of file sonypi.c.

#define SONYPI_SLOB   0x9c

Definition at line 120 of file sonypi.c.

#define SONYPI_TEMP_STATUS   0xC1

Definition at line 148 of file sonypi.c.

#define SONYPI_THUMBPHRASE_MASK   0x00000200

Definition at line 244 of file sonypi.c.

#define SONYPI_TYPE1_BASE   0x50

Definition at line 113 of file sonypi.c.

#define SONYPI_TYPE1_EVTYPE_OFFSET   0x04

Definition at line 116 of file sonypi.c.

#define SONYPI_TYPE1_REGION_SIZE   0x08

Definition at line 115 of file sonypi.c.

#define SONYPI_TYPE2_EVTYPE_OFFSET   0x12

Definition at line 123 of file sonypi.c.

#define SONYPI_TYPE2_REGION_SIZE   0x20

Definition at line 122 of file sonypi.c.

#define SONYPI_TYPE3_BASE   0x40

Definition at line 126 of file sonypi.c.

#define SONYPI_TYPE3_EVTYPE_OFFSET   0x12

Definition at line 130 of file sonypi.c.

#define SONYPI_TYPE3_GID2   (SONYPI_TYPE3_BASE+0x48) /* 16 bits */

Definition at line 127 of file sonypi.c.

#define SONYPI_TYPE3_MISC   (SONYPI_TYPE3_BASE+0x6d) /* 8 bits */

Definition at line 128 of file sonypi.c.

#define SONYPI_TYPE3_REGION_SIZE   0x20

Definition at line 129 of file sonypi.c.

#define SONYPI_WIRELESS_MASK   0x00002000

Definition at line 248 of file sonypi.c.

#define SONYPI_ZOOM_MASK   0x00000100

Definition at line 243 of file sonypi.c.

#define wait_on_command (   quiet,
  command,
  iterations 
)
Value:
{ \
unsigned int n = iterations; \
while (--n && (command)) \
udelay(1); \
if (!n && (verbose || !quiet)) \
printk(KERN_WARNING "sonypi command failed at %s : %s (line %d)\n", __FILE__, __func__, __LINE__); \
}

Definition at line 505 of file sonypi.c.

Function Documentation

MODULE_AUTHOR ( "Stelian Pop <[email protected]>"  )
MODULE_DESCRIPTION ( "Sony Programmable I/O Control Device driver )
module_exit ( sonypi_exit  )
module_init ( sonypi_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( minor  ,
int  ,
 
)
module_param ( verbose  ,
int  ,
0644   
)
module_param ( fnkeyinit  ,
int  ,
0444   
)
module_param ( camera  ,
int  ,
0444   
)
module_param ( compat  ,
int  ,
0444   
)
module_param ( mask  ,
ulong  ,
0644   
)
module_param ( useinput  ,
int  ,
0444   
)
module_param ( check_ioport  ,
int  ,
0444   
)
MODULE_PARM_DESC ( minor  ,
"minor number of the misc  device,
default is-1(automatic)"   
)
MODULE_PARM_DESC ( verbose  ,
"be  verbose,
default is 0(no)"   
)
MODULE_PARM_DESC ( fnkeyinit  ,
"set this if your Fn keys do not generate any event  
)
MODULE_PARM_DESC ( camera  ,
"set this if you have a MotionEye camera (PictureBook series)"   
)
MODULE_PARM_DESC ( compat  ,
"set this if you want to enable backward compatibility mode  
)
MODULE_PARM_DESC ( mask  ,
"set this to the mask of event you want to enable (see doc)"   
)
MODULE_PARM_DESC ( useinput  ,
"set this if you would like sonypi to feed events to the input subsystem"   
)
MODULE_PARM_DESC ( check_ioport  ,
"set this to 0 if you think the automatic ioport check for sony-laptop is wrong"   
)
MODULE_VERSION ( SONYPI_DRIVER_VERSION  )

Variable Documentation

int inputev

Definition at line 437 of file sonypi.c.

int sonypiev

Definition at line 436 of file sonypi.c.