Path: blob/master/drivers/input/mouse/trackpoint.h
15112 views
/*1* IBM TrackPoint PS/2 mouse driver2*3* Stephen Evanchik <[email protected]>4*5* This program is free software; you can redistribute it and/or modify it6* under the terms of the GNU General Public License version 2 as published by7* the Free Software Foundation.8*/910#ifndef _TRACKPOINT_H11#define _TRACKPOINT_H1213/*14* These constants are from the TrackPoint System15* Engineering documentation Version 4 from IBM Watson16* research:17* http://wwwcssrv.almaden.ibm.com/trackpoint/download.html18*/1920#define TP_COMMAND 0xE2 /* Commands start with this */2122#define TP_READ_ID 0xE1 /* Sent for device identification */23#define TP_MAGIC_IDENT 0x01 /* Sent after a TP_READ_ID followed */24/* by the firmware ID */252627/*28* Commands29*/30#define TP_RECALIB 0x51 /* Recalibrate */31#define TP_POWER_DOWN 0x44 /* Can only be undone through HW reset */32#define TP_EXT_DEV 0x21 /* Determines if external device is connected (RO) */33#define TP_EXT_BTN 0x4B /* Read extended button status */34#define TP_POR 0x7F /* Execute Power on Reset */35#define TP_POR_RESULTS 0x25 /* Read Power on Self test results */36#define TP_DISABLE_EXT 0x40 /* Disable external pointing device */37#define TP_ENABLE_EXT 0x41 /* Enable external pointing device */3839/*40* Mode manipulation41*/42#define TP_SET_SOFT_TRANS 0x4E /* Set mode */43#define TP_CANCEL_SOFT_TRANS 0xB9 /* Cancel mode */44#define TP_SET_HARD_TRANS 0x45 /* Mode can only be set */454647/*48* Register oriented commands/properties49*/50#define TP_WRITE_MEM 0x8151#define TP_READ_MEM 0x80 /* Not used in this implementation */5253/*54* RAM Locations for properties55*/56#define TP_SENS 0x4A /* Sensitivity */57#define TP_MB 0x4C /* Read Middle Button Status (RO) */58#define TP_INERTIA 0x4D /* Negative Inertia */59#define TP_SPEED 0x60 /* Speed of TP Cursor */60#define TP_REACH 0x57 /* Backup for Z-axis press */61#define TP_DRAGHYS 0x58 /* Drag Hysteresis */62/* (how hard it is to drag */63/* with Z-axis pressed) */6465#define TP_MINDRAG 0x59 /* Minimum amount of force needed */66/* to trigger dragging */6768#define TP_THRESH 0x5C /* Minimum value for a Z-axis press */69#define TP_UP_THRESH 0x5A /* Used to generate a 'click' on Z-axis */70#define TP_Z_TIME 0x5E /* How sharp of a press */71#define TP_JENKS_CURV 0x5D /* Minimum curvature for double click */7273/*74* Toggling Flag bits75*/76#define TP_TOGGLE 0x47 /* Toggle command */7778#define TP_TOGGLE_MB 0x23 /* Disable/Enable Middle Button */79#define TP_MASK_MB 0x0180#define TP_TOGGLE_EXT_DEV 0x23 /* Disable external device */81#define TP_MASK_EXT_DEV 0x0282#define TP_TOGGLE_DRIFT 0x23 /* Drift Correction */83#define TP_MASK_DRIFT 0x8084#define TP_TOGGLE_BURST 0x28 /* Burst Mode */85#define TP_MASK_BURST 0x8086#define TP_TOGGLE_PTSON 0x2C /* Press to Select */87#define TP_MASK_PTSON 0x0188#define TP_TOGGLE_HARD_TRANS 0x2C /* Alternate method to set Hard Transparency */89#define TP_MASK_HARD_TRANS 0x8090#define TP_TOGGLE_TWOHAND 0x2D /* Two handed */91#define TP_MASK_TWOHAND 0x0192#define TP_TOGGLE_STICKY_TWO 0x2D /* Sticky two handed */93#define TP_MASK_STICKY_TWO 0x0494#define TP_TOGGLE_SKIPBACK 0x2D /* Suppress movement after drag release */95#define TP_MASK_SKIPBACK 0x0896#define TP_TOGGLE_SOURCE_TAG 0x20 /* Bit 3 of the first packet will be set to97to the origin of the packet (external or TP) */98#define TP_MASK_SOURCE_TAG 0x8099#define TP_TOGGLE_EXT_TAG 0x22 /* Bit 3 of the first packet coming from the100external device will be forced to 1 */101#define TP_MASK_EXT_TAG 0x04102103104/* Power on Self Test Results */105#define TP_POR_SUCCESS 0x3B106107/*108* Default power on values109*/110#define TP_DEF_SENS 0x80111#define TP_DEF_INERTIA 0x06112#define TP_DEF_SPEED 0x61113#define TP_DEF_REACH 0x0A114115#define TP_DEF_DRAGHYS 0xFF116#define TP_DEF_MINDRAG 0x14117118#define TP_DEF_THRESH 0x08119#define TP_DEF_UP_THRESH 0xFF120#define TP_DEF_Z_TIME 0x26121#define TP_DEF_JENKS_CURV 0x87122123/* Toggles */124#define TP_DEF_MB 0x00125#define TP_DEF_PTSON 0x00126#define TP_DEF_SKIPBACK 0x00127#define TP_DEF_EXT_DEV 0x00 /* 0 means enabled */128129#define MAKE_PS2_CMD(params, results, cmd) ((params<<12) | (results<<8) | (cmd))130131struct trackpoint_data132{133unsigned char sensitivity, speed, inertia, reach;134unsigned char draghys, mindrag;135unsigned char thresh, upthresh;136unsigned char ztime, jenks;137138unsigned char press_to_select;139unsigned char skipback;140141unsigned char ext_dev;142};143144#ifdef CONFIG_MOUSE_PS2_TRACKPOINT145int trackpoint_detect(struct psmouse *psmouse, bool set_properties);146#else147inline int trackpoint_detect(struct psmouse *psmouse, bool set_properties)148{149return -ENOSYS;150}151#endif /* CONFIG_MOUSE_PS2_TRACKPOINT */152153#endif /* _TRACKPOINT_H */154155156