1
0
Files
kernel-49/drivers/input/mouse/trackpoint.h
Greg Kroah-Hartman 24f6e0cbaf Merge 4.9.190 into android-4.9
Changes in 4.9.190
	usb: usbfs: fix double-free of usb memory upon submiturb error
	usb: iowarrior: fix deadlock on disconnect
	sound: fix a memory leak bug
	x86/mm: Check for pfn instead of page in vmalloc_sync_one()
	x86/mm: Sync also unmappings in vmalloc_sync_all()
	mm/vmalloc: Sync unmappings in __purge_vmap_area_lazy()
	perf record: Fix wrong size in perf_record_mmap for last kernel module
	perf db-export: Fix thread__exec_comm()
	perf record: Fix module size on s390
	usb: yurex: Fix use-after-free in yurex_delete
	can: peak_usb: fix potential double kfree_skb()
	netfilter: nfnetlink: avoid deadlock due to synchronous request_module
	iscsi_ibft: make ISCSI_IBFT dependson ACPI instead of ISCSI_IBFT_FIND
	mac80211: don't warn about CW params when not using them
	hwmon: (nct6775) Fix register address and added missed tolerance for nct6106
	cpufreq/pasemi: fix use-after-free in pas_cpufreq_cpu_init()
	s390/qdio: add sanity checks to the fast-requeue path
	ALSA: compress: Fix regression on compressed capture streams
	ALSA: compress: Prevent bypasses of set_params
	ALSA: compress: Don't allow paritial drain operations on capture streams
	ALSA: compress: Be more restrictive about when a drain is allowed
	perf probe: Avoid calling freeing routine multiple times for same pointer
	drbd: dynamically allocate shash descriptor
	ACPI/IORT: Fix off-by-one check in iort_dev_find_its_id()
	ARM: davinci: fix sleep.S build error on ARMv4
	scsi: megaraid_sas: fix panic on loading firmware crashdump
	scsi: ibmvfc: fix WARN_ON during event pool release
	scsi: scsi_dh_alua: always use a 2 second delay before retrying RTPG
	tty/ldsem, locking/rwsem: Add missing ACQUIRE to read_failed sleep loop
	perf/core: Fix creating kernel counters for PMUs that override event->cpu
	can: peak_usb: pcan_usb_pro: Fix info-leaks to USB devices
	can: peak_usb: pcan_usb_fd: Fix info-leaks to USB devices
	hwmon: (nct7802) Fix wrong detection of in4 presence
	ALSA: firewire: fix a memory leak bug
	ALSA: hda - Don't override global PCM hw info flag
	mac80211: don't WARN on short WMM parameters from AP
	SMB3: Fix deadlock in validate negotiate hits reconnect
	smb3: send CAP_DFS capability during session setup
	mwifiex: fix 802.11n/WPA detection
	iwlwifi: don't unmap as page memory that was mapped as single
	scsi: mpt3sas: Use 63-bit DMA addressing on SAS35 HBA
	sh: kernel: hw_breakpoint: Fix missing break in switch statement
	mm/usercopy: use memory range to be accessed for wraparound check
	mm/memcontrol.c: fix use after free in mem_cgroup_iter()
	bpf: get rid of pure_initcall dependency to enable jits
	bpf: restrict access to core bpf sysctls
	bpf: add bpf_jit_limit knob to restrict unpriv allocations
	vhost-net: set packet weight of tx polling to 2 * vq size
	vhost_net: use packet weight for rx handler, too
	vhost_net: introduce vhost_exceeds_weight()
	vhost: introduce vhost_exceeds_weight()
	vhost_net: fix possible infinite loop
	vhost: scsi: add weight support
	siphash: add cryptographically secure PRF
	siphash: implement HalfSipHash1-3 for hash tables
	inet: switch IP ID generator to siphash
	netfilter: ctnetlink: don't use conntrack/expect object addresses as id
	xtensa: add missing isync to the cpu_reset TLB code
	ALSA: hda - Fix a memory leak bug
	ALSA: hda - Add a generic reboot_notify
	ALSA: hda - Let all conexant codec enter D3 when rebooting
	HID: holtek: test for sanity of intfdata
	HID: hiddev: avoid opening a disconnected device
	HID: hiddev: do cleanup in failure of opening a device
	Input: kbtab - sanity check for endpoint type
	Input: iforce - add sanity checks
	net: usb: pegasus: fix improper read if get_registers() fail
	xen/pciback: remove set but not used variable 'old_state'
	irqchip/irq-imx-gpcv2: Forward irq type to parent
	perf header: Fix divide by zero error if f_header.attr_size==0
	perf header: Fix use of unitialized value warning
	libata: zpodd: Fix small read overflow in zpodd_get_mech_type()
	scsi: hpsa: correct scsi command status issue after reset
	ata: libahci: do not complain in case of deferred probe
	kbuild: modpost: handle KBUILD_EXTRA_SYMBOLS only for external modules
	arm64/efi: fix variable 'si' set but not used
	arm64/mm: fix variable 'pud' set but not used
	IB/core: Add mitigation for Spectre V1
	IB/mad: Fix use-after-free in ib mad completion handling
	ocfs2: remove set but not used variable 'last_hash'
	staging: comedi: dt3000: Fix signed integer overflow 'divider * base'
	staging: comedi: dt3000: Fix rounding up of timer divisor
	USB: core: Fix races in character device registration and deregistraion
	usb: cdc-acm: make sure a refcount is taken early enough
	USB: CDC: fix sanity checks in CDC union parser
	USB: serial: option: add D-Link DWM-222 device ID
	USB: serial: option: Add support for ZTE MF871A
	USB: serial: option: add the BroadMobi BM818 card
	USB: serial: option: Add Motorola modem UARTs
	asm-generic: fix -Wtype-limits compiler warnings
	bpf: fix bpf_jit_limit knob for PAGE_SIZE >= 64K
	arm64: compat: Allow single-byte watchpoints on all addresses
	netfilter: conntrack: Use consistent ct id hash calculation
	Input: psmouse - fix build error of multiple definition
	iommu/amd: Move iommu_init_pci() to .init section
	bnx2x: Fix VF's VLAN reconfiguration in reload.
	net/packet: fix race in tpacket_snd()
	sctp: fix the transport error_count check
	xen/netback: Reset nr_frags before freeing skb
	net/mlx5e: Only support tx/rx pause setting for port owner
	net/mlx5e: Use flow keys dissector to parse packets for ARFS
	team: Add vlan tx offload to hw_enc_features
	bonding: Add vlan tx offload to hw_enc_features
	Linux 4.9.190

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2019-09-22 16:58:59 +03:00

164 lines
4.9 KiB
C

/*
* IBM TrackPoint PS/2 mouse driver
*
* Stephen Evanchik <evanchsa@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*/
#ifndef _TRACKPOINT_H
#define _TRACKPOINT_H
/*
* These constants are from the TrackPoint System
* Engineering documentation Version 4 from IBM Watson
* research:
* http://wwwcssrv.almaden.ibm.com/trackpoint/download.html
*/
#define TP_COMMAND 0xE2 /* Commands start with this */
#define TP_READ_ID 0xE1 /* Sent for device identification */
#define TP_MAGIC_IDENT 0x03 /* Sent after a TP_READ_ID followed */
/* by the firmware ID */
/* Firmware ID includes 0x1, 0x2, 0x3 */
/*
* Commands
*/
#define TP_RECALIB 0x51 /* Recalibrate */
#define TP_POWER_DOWN 0x44 /* Can only be undone through HW reset */
#define TP_EXT_DEV 0x21 /* Determines if external device is connected (RO) */
#define TP_EXT_BTN 0x4B /* Read extended button status */
#define TP_POR 0x7F /* Execute Power on Reset */
#define TP_POR_RESULTS 0x25 /* Read Power on Self test results */
#define TP_DISABLE_EXT 0x40 /* Disable external pointing device */
#define TP_ENABLE_EXT 0x41 /* Enable external pointing device */
/*
* Mode manipulation
*/
#define TP_SET_SOFT_TRANS 0x4E /* Set mode */
#define TP_CANCEL_SOFT_TRANS 0xB9 /* Cancel mode */
#define TP_SET_HARD_TRANS 0x45 /* Mode can only be set */
/*
* Register oriented commands/properties
*/
#define TP_WRITE_MEM 0x81
#define TP_READ_MEM 0x80 /* Not used in this implementation */
/*
* RAM Locations for properties
*/
#define TP_SENS 0x4A /* Sensitivity */
#define TP_MB 0x4C /* Read Middle Button Status (RO) */
#define TP_INERTIA 0x4D /* Negative Inertia */
#define TP_SPEED 0x60 /* Speed of TP Cursor */
#define TP_REACH 0x57 /* Backup for Z-axis press */
#define TP_DRAGHYS 0x58 /* Drag Hysteresis */
/* (how hard it is to drag */
/* with Z-axis pressed) */
#define TP_MINDRAG 0x59 /* Minimum amount of force needed */
/* to trigger dragging */
#define TP_THRESH 0x5C /* Minimum value for a Z-axis press */
#define TP_UP_THRESH 0x5A /* Used to generate a 'click' on Z-axis */
#define TP_Z_TIME 0x5E /* How sharp of a press */
#define TP_JENKS_CURV 0x5D /* Minimum curvature for double click */
#define TP_DRIFT_TIME 0x5F /* How long a 'hands off' condition */
/* must last (x*107ms) for drift */
/* correction to occur */
/*
* Toggling Flag bits
*/
#define TP_TOGGLE 0x47 /* Toggle command */
#define TP_TOGGLE_MB 0x23 /* Disable/Enable Middle Button */
#define TP_MASK_MB 0x01
#define TP_TOGGLE_EXT_DEV 0x23 /* Disable external device */
#define TP_MASK_EXT_DEV 0x02
#define TP_TOGGLE_DRIFT 0x23 /* Drift Correction */
#define TP_MASK_DRIFT 0x80
#define TP_TOGGLE_BURST 0x28 /* Burst Mode */
#define TP_MASK_BURST 0x80
#define TP_TOGGLE_PTSON 0x2C /* Press to Select */
#define TP_MASK_PTSON 0x01
#define TP_TOGGLE_HARD_TRANS 0x2C /* Alternate method to set Hard Transparency */
#define TP_MASK_HARD_TRANS 0x80
#define TP_TOGGLE_TWOHAND 0x2D /* Two handed */
#define TP_MASK_TWOHAND 0x01
#define TP_TOGGLE_STICKY_TWO 0x2D /* Sticky two handed */
#define TP_MASK_STICKY_TWO 0x04
#define TP_TOGGLE_SKIPBACK 0x2D /* Suppress movement after drag release */
#define TP_MASK_SKIPBACK 0x08
#define TP_TOGGLE_SOURCE_TAG 0x20 /* Bit 3 of the first packet will be set to
to the origin of the packet (external or TP) */
#define TP_MASK_SOURCE_TAG 0x80
#define TP_TOGGLE_EXT_TAG 0x22 /* Bit 3 of the first packet coming from the
external device will be forced to 1 */
#define TP_MASK_EXT_TAG 0x04
/* Power on Self Test Results */
#define TP_POR_SUCCESS 0x3B
/*
* Default power on values
*/
#define TP_DEF_SENS 0x80
#define TP_DEF_INERTIA 0x06
#define TP_DEF_SPEED 0x61
#define TP_DEF_REACH 0x0A
#define TP_DEF_DRAGHYS 0xFF
#define TP_DEF_MINDRAG 0x14
#define TP_DEF_THRESH 0x08
#define TP_DEF_UP_THRESH 0xFF
#define TP_DEF_Z_TIME 0x26
#define TP_DEF_JENKS_CURV 0x87
#define TP_DEF_DRIFT_TIME 0x05
/* Toggles */
#define TP_DEF_MB 0x00
#define TP_DEF_PTSON 0x00
#define TP_DEF_SKIPBACK 0x00
#define TP_DEF_EXT_DEV 0x00 /* 0 means enabled */
#define TP_DEF_TWOHAND 0x00
#define TP_DEF_SOURCE_TAG 0x00
#define MAKE_PS2_CMD(params, results, cmd) ((params<<12) | (results<<8) | (cmd))
struct trackpoint_data
{
unsigned char sensitivity, speed, inertia, reach;
unsigned char draghys, mindrag;
unsigned char thresh, upthresh;
unsigned char ztime, jenks;
unsigned char drift_time;
/* toggles */
unsigned char press_to_select;
unsigned char skipback;
unsigned char ext_dev;
};
#ifdef CONFIG_MOUSE_PS2_TRACKPOINT
int trackpoint_detect(struct psmouse *psmouse, bool set_properties);
#else
static inline int trackpoint_detect(struct psmouse *psmouse,
bool set_properties)
{
return -ENOSYS;
}
#endif /* CONFIG_MOUSE_PS2_TRACKPOINT */
#endif /* _TRACKPOINT_H */