Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
bcm5974.c File Reference
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/usb/input.h>
#include <linux/hid.h>
#include <linux/mutex.h>
#include <linux/input/mt.h>

Go to the source code of this file.

Data Structures

struct  bt_data
 
struct  tp_finger
 
struct  bcm5974_param
 
struct  bcm5974_config
 
struct  bcm5974
 

Macros

#define USB_VENDOR_ID_APPLE   0x05ac
 
#define USB_DEVICE_ID_APPLE_WELLSPRING_ANSI   0x0223
 
#define USB_DEVICE_ID_APPLE_WELLSPRING_ISO   0x0224
 
#define USB_DEVICE_ID_APPLE_WELLSPRING_JIS   0x0225
 
#define USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI   0x0230
 
#define USB_DEVICE_ID_APPLE_WELLSPRING2_ISO   0x0231
 
#define USB_DEVICE_ID_APPLE_WELLSPRING2_JIS   0x0232
 
#define USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI   0x0236
 
#define USB_DEVICE_ID_APPLE_WELLSPRING3_ISO   0x0237
 
#define USB_DEVICE_ID_APPLE_WELLSPRING3_JIS   0x0238
 
#define USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI   0x023f
 
#define USB_DEVICE_ID_APPLE_WELLSPRING4_ISO   0x0240
 
#define USB_DEVICE_ID_APPLE_WELLSPRING4_JIS   0x0241
 
#define USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI   0x0242
 
#define USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO   0x0243
 
#define USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS   0x0244
 
#define USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI   0x0245
 
#define USB_DEVICE_ID_APPLE_WELLSPRING5_ISO   0x0246
 
#define USB_DEVICE_ID_APPLE_WELLSPRING5_JIS   0x0247
 
#define USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI   0x0249
 
#define USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO   0x024a
 
#define USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS   0x024b
 
#define USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI   0x024c
 
#define USB_DEVICE_ID_APPLE_WELLSPRING6_ISO   0x024d
 
#define USB_DEVICE_ID_APPLE_WELLSPRING6_JIS   0x024e
 
#define USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI   0x0252
 
#define USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO   0x0253
 
#define USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS   0x0254
 
#define USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI   0x0262
 
#define USB_DEVICE_ID_APPLE_WELLSPRING7_ISO   0x0263
 
#define USB_DEVICE_ID_APPLE_WELLSPRING7_JIS   0x0264
 
#define USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI   0x0259
 
#define USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO   0x025a
 
#define USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS   0x025b
 
#define BCM5974_DEVICE(prod)
 
#define dprintk(level, format, a...)   { if (debug >= level) printk(KERN_DEBUG format, ##a); }
 
#define FINGER_TYPE1   (13 * sizeof(__le16))
 
#define FINGER_TYPE2   (15 * sizeof(__le16))
 
#define BUTTON_TYPE2   15
 
#define HAS_INTEGRATED_BUTTON   1
 
#define MAX_FINGERS   16
 
#define SIZEOF_FINGER   sizeof(struct tp_finger)
 
#define SIZEOF_ALL_FINGERS   (MAX_FINGERS * SIZEOF_FINGER)
 
#define MAX_FINGER_ORIENTATION   16384
 
#define SN_PRESSURE   45 /* pressure signal-to-noise ratio */
 
#define SN_WIDTH   25 /* width signal-to-noise ratio */
 
#define SN_COORD   250 /* coordinate signal-to-noise ratio */
 
#define SN_ORIENT   10 /* orientation signal-to-noise ratio */
 
#define BCM5974_WELLSPRING_MODE_READ_REQUEST_ID   1
 
#define BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID   9
 
#define BCM5974_WELLSPRING_MODE_REQUEST_VALUE   0x300
 
#define BCM5974_WELLSPRING_MODE_REQUEST_INDEX   0
 
#define BCM5974_WELLSPRING_MODE_VENDOR_VALUE   0x01
 
#define BCM5974_WELLSPRING_MODE_NORMAL_VALUE   0x08
 

Enumerations

enum  tp_type { TYPE1, TYPE2 }
 

Functions

 MODULE_DEVICE_TABLE (usb, bcm5974_table)
 
 MODULE_AUTHOR ("Henrik Rydberg")
 
 MODULE_DESCRIPTION ("Apple USB BCM5974 multitouch driver")
 
 MODULE_LICENSE ("GPL")
 
 module_param (debug, int, 0644)
 
 MODULE_PARM_DESC (debug,"Activate debugging output")
 
struct tp_finger __attribute__ ((packed, aligned(2)))
 
 module_usb_driver (bcm5974_driver)
 

Variables

__le16 origin
 
__le16 abs_x
 
__le16 abs_y
 
__le16 rel_x
 
__le16 rel_y
 
__le16 tool_major
 
__le16 tool_minor
 
__le16 orientation
 
__le16 touch_major
 
__le16 touch_minor
 
__le16 unused [3]
 
__le16 multi
 
struct bcm5974_param __attribute__
 

Macro Definition Documentation

#define BCM5974_DEVICE (   prod)
Value:
{ \
.match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \
USB_DEVICE_ID_MATCH_INT_CLASS | \
USB_DEVICE_ID_MATCH_INT_PROTOCOL), \
.idVendor = USB_VENDOR_ID_APPLE, \
.idProduct = (prod), \
.bInterfaceClass = USB_INTERFACE_CLASS_HID, \
.bInterfaceProtocol = USB_INTERFACE_PROTOCOL_MOUSE \
}

Definition at line 92 of file bcm5974.c.

#define BCM5974_WELLSPRING_MODE_NORMAL_VALUE   0x08

Definition at line 571 of file bcm5974.c.

#define BCM5974_WELLSPRING_MODE_READ_REQUEST_ID   1

Definition at line 566 of file bcm5974.c.

#define BCM5974_WELLSPRING_MODE_REQUEST_INDEX   0

Definition at line 569 of file bcm5974.c.

#define BCM5974_WELLSPRING_MODE_REQUEST_VALUE   0x300

Definition at line 568 of file bcm5974.c.

#define BCM5974_WELLSPRING_MODE_VENDOR_VALUE   0x01

Definition at line 570 of file bcm5974.c.

#define BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID   9

Definition at line 567 of file bcm5974.c.

#define BUTTON_TYPE2   15

Definition at line 183 of file bcm5974.c.

#define dprintk (   level,
  format,
  a... 
)    { if (debug >= level) printk(KERN_DEBUG format, ##a); }

Definition at line 157 of file bcm5974.c.

#define FINGER_TYPE1   (13 * sizeof(__le16))

Definition at line 179 of file bcm5974.c.

#define FINGER_TYPE2   (15 * sizeof(__le16))

Definition at line 180 of file bcm5974.c.

#define HAS_INTEGRATED_BUTTON   1

Definition at line 186 of file bcm5974.c.

#define MAX_FINGER_ORIENTATION   16384

Definition at line 208 of file bcm5974.c.

#define MAX_FINGERS   16

Definition at line 205 of file bcm5974.c.

#define SIZEOF_ALL_FINGERS   (MAX_FINGERS * SIZEOF_FINGER)

Definition at line 207 of file bcm5974.c.

#define SIZEOF_FINGER   sizeof(struct tp_finger)

Definition at line 206 of file bcm5974.c.

#define SN_COORD   250 /* coordinate signal-to-noise ratio */

Definition at line 255 of file bcm5974.c.

#define SN_ORIENT   10 /* orientation signal-to-noise ratio */

Definition at line 256 of file bcm5974.c.

#define SN_PRESSURE   45 /* pressure signal-to-noise ratio */

Definition at line 253 of file bcm5974.c.

#define SN_WIDTH   25 /* width signal-to-noise ratio */

Definition at line 254 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI   0x0230

Definition at line 52 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING2_ISO   0x0231

Definition at line 53 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING2_JIS   0x0232

Definition at line 54 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI   0x0236

Definition at line 56 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING3_ISO   0x0237

Definition at line 57 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING3_JIS   0x0238

Definition at line 58 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI   0x023f

Definition at line 60 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING4_ISO   0x0240

Definition at line 61 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING4_JIS   0x0241

Definition at line 62 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI   0x0242

Definition at line 64 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO   0x0243

Definition at line 65 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS   0x0244

Definition at line 66 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI   0x0245

Definition at line 68 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING5_ISO   0x0246

Definition at line 69 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING5_JIS   0x0247

Definition at line 70 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI   0x0252

Definition at line 80 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO   0x0253

Definition at line 81 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS   0x0254

Definition at line 82 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI   0x024c

Definition at line 76 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING6_ISO   0x024d

Definition at line 77 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING6_JIS   0x024e

Definition at line 78 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI   0x0249

Definition at line 72 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO   0x024a

Definition at line 73 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS   0x024b

Definition at line 74 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI   0x0262

Definition at line 84 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING7_ISO   0x0263

Definition at line 85 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING7_JIS   0x0264

Definition at line 86 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI   0x0259

Definition at line 88 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO   0x025a

Definition at line 89 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS   0x025b

Definition at line 90 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING_ANSI   0x0223

Definition at line 48 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING_ISO   0x0224

Definition at line 49 of file bcm5974.c.

#define USB_DEVICE_ID_APPLE_WELLSPRING_JIS   0x0225

Definition at line 50 of file bcm5974.c.

#define USB_VENDOR_ID_APPLE   0x05ac

Definition at line 45 of file bcm5974.c.

Enumeration Type Documentation

enum tp_type
Enumerator:
TYPE1 
TYPE2 

Definition at line 173 of file bcm5974.c.

Function Documentation

struct tp_finger __attribute__ ( (packed, aligned(2))  )
MODULE_AUTHOR ( "Henrik Rydberg"  )
MODULE_DESCRIPTION ( "Apple USB BCM5974 multitouch driver )
MODULE_DEVICE_TABLE ( usb  ,
bcm5974_table   
)
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
int  ,
0644   
)
MODULE_PARM_DESC ( debug  ,
"Activate debugging output  
)
module_usb_driver ( bcm5974_driver  )

Variable Documentation

__le16 abs_x

Definition at line 204 of file bcm5974.c.

__le16 abs_y

Definition at line 205 of file bcm5974.c.

Definition at line 214 of file bcm5974.c.

unsigned char orientation

Definition at line 210 of file bcm5974.c.

Definition at line 203 of file bcm5974.c.

__le16 rel_x

Definition at line 206 of file bcm5974.c.

__le16 rel_y

Definition at line 207 of file bcm5974.c.

__le16 tool_major

Definition at line 208 of file bcm5974.c.

__le16 tool_minor

Definition at line 209 of file bcm5974.c.

__le16 touch_major

Definition at line 211 of file bcm5974.c.

__le16 touch_minor

Definition at line 212 of file bcm5974.c.

Definition at line 213 of file bcm5974.c.