From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
Takashi Iwai <tiwai@suse.de>, Dmitry Torokhov <dtor@mail.ru>
Subject: [049/143] Input: Add support of Synaptics Clickpad device
Date: Thu, 05 May 2011 17:20:34 -0700 [thread overview]
Message-ID: <20110506002210.041111928@clark.kroah.org> (raw)
In-Reply-To: <20110506002311.GA15354@kroah.com>
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit 5f57d67da87332a9a1ba8fa7a33bf0680e1c76e7 upstream.
The new type of touchpads can be detected via a new query command
0x0c. The clickpad flags are in cap[0]:4 and cap[1]:0 bits.
When the device is detected, the driver now reports only the left
button as the supported buttons so that X11 driver can detect that
the device is Clickpad. A Clickpad device gives the button events
only as the middle button. The kernel driver morphs to the left
button. The real handling of Clickpad is done rather in X driver
side.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/input/mouse/synaptics.c | 35 ++++++++++++++++++++++++++++++-----
drivers/input/mouse/synaptics.h | 4 ++++
2 files changed, 34 insertions(+), 5 deletions(-)
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -135,7 +135,8 @@ static int synaptics_capability(struct p
if (synaptics_send_cmd(psmouse, SYN_QUE_CAPABILITIES, cap))
return -1;
priv->capabilities = (cap[0] << 16) | (cap[1] << 8) | cap[2];
- priv->ext_cap = 0;
+ priv->ext_cap = priv->ext_cap_0c = 0;
+
if (!SYN_CAP_VALID(priv->capabilities))
return -1;
@@ -148,7 +149,7 @@ static int synaptics_capability(struct p
if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 1) {
if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_CAPAB, cap)) {
printk(KERN_ERR "Synaptics claims to have extended capabilities,"
- " but I'm not able to read them.");
+ " but I'm not able to read them.\n");
} else {
priv->ext_cap = (cap[0] << 16) | (cap[1] << 8) | cap[2];
@@ -160,6 +161,16 @@ static int synaptics_capability(struct p
priv->ext_cap &= 0xff0fff;
}
}
+
+ if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 4) {
+ if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_CAPAB_0C, cap)) {
+ printk(KERN_ERR "Synaptics claims to have extended capability 0x0c,"
+ " but I'm not able to read it.\n");
+ } else {
+ priv->ext_cap_0c = (cap[0] << 16) | (cap[1] << 8) | cap[2];
+ }
+ }
+
return 0;
}
@@ -346,7 +357,15 @@ static void synaptics_parse_hw_state(uns
hw->left = (buf[0] & 0x01) ? 1 : 0;
hw->right = (buf[0] & 0x02) ? 1 : 0;
- if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities)) {
+ if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) {
+ /*
+ * Clickpad's button is transmitted as middle button,
+ * however, since it is primary button, we will report
+ * it as BTN_LEFT.
+ */
+ hw->left = ((buf[0] ^ buf[3]) & 0x01) ? 1 : 0;
+
+ } else if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities)) {
hw->middle = ((buf[0] ^ buf[3]) & 0x01) ? 1 : 0;
if (hw->w == 2)
hw->scroll = (signed char)(buf[1]);
@@ -591,6 +610,12 @@ static void set_input_params(struct inpu
dev->absres[ABS_X] = priv->x_res;
dev->absres[ABS_Y] = priv->y_res;
+
+ if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) {
+ /* Clickpads report only left button */
+ __clear_bit(BTN_RIGHT, dev->keybit);
+ __clear_bit(BTN_MIDDLE, dev->keybit);
+ }
}
static void synaptics_disconnect(struct psmouse *psmouse)
@@ -689,10 +714,10 @@ int synaptics_init(struct psmouse *psmou
priv->pkt_type = SYN_MODEL_NEWABS(priv->model_id) ? SYN_NEWABS : SYN_OLDABS;
- printk(KERN_INFO "Synaptics Touchpad, model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx\n",
+ printk(KERN_INFO "Synaptics Touchpad, model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx/%#lx\n",
SYN_ID_MODEL(priv->identity),
SYN_ID_MAJOR(priv->identity), SYN_ID_MINOR(priv->identity),
- priv->model_id, priv->capabilities, priv->ext_cap);
+ priv->model_id, priv->capabilities, priv->ext_cap, priv->ext_cap_0c);
set_input_params(psmouse->dev, priv);
--- a/drivers/input/mouse/synaptics.h
+++ b/drivers/input/mouse/synaptics.h
@@ -18,6 +18,7 @@
#define SYN_QUE_SERIAL_NUMBER_SUFFIX 0x07
#define SYN_QUE_RESOLUTION 0x08
#define SYN_QUE_EXT_CAPAB 0x09
+#define SYN_QUE_EXT_CAPAB_0C 0x0c
/* synatics modes */
#define SYN_BIT_ABSOLUTE_MODE (1 << 7)
@@ -48,6 +49,8 @@
#define SYN_CAP_VALID(c) ((((c) & 0x00ff00) >> 8) == 0x47)
#define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20)
#define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12)
+#define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16)
+#define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100100)
/* synaptics modes query bits */
#define SYN_MODE_ABSOLUTE(m) ((m) & (1 << 7))
@@ -96,6 +99,7 @@ struct synaptics_data {
unsigned long int model_id; /* Model-ID */
unsigned long int capabilities; /* Capabilities */
unsigned long int ext_cap; /* Extended Capabilities */
+ unsigned long int ext_cap_0c; /* Ext Caps from 0x0c query */
unsigned long int identity; /* Identification */
int x_res; /* X resolution in units/mm */
int y_res; /* Y resolution in units/mm */
next prev parent reply other threads:[~2011-05-06 0:56 UTC|newest]
Thread overview: 144+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-06 0:23 [000/143] 2.6.32.40-longterm review Greg KH
2011-05-06 0:19 ` [001/143] ath: add missing regdomain pair 0x5c mapping Greg KH
2011-05-06 0:19 ` [002/143] block, blk-sysfs: Fix an err return path in blk_register_queue() Greg KH
2011-05-06 0:19 ` [003/143] p54: Initialize extra_len in p54_tx_80211 Greg KH
2011-05-06 0:19 ` [004/143] intel-iommu: Unlink domain from iommu Greg KH
2011-05-06 0:19 ` [005/143] intel-iommu: Fix get_domain_for_dev() error path Greg KH
2011-05-06 0:19 ` [006/143] drm/radeon/kms: fix bad shift in atom iio table parser Greg KH
2011-05-06 0:19 ` [007/143] NFS: nfs_wcc_update_inode() should set nfsi->attr_gencount Greg KH
2011-05-06 0:19 ` [008/143] serial/imx: read cts state only after acking cts change irq Greg KH
2011-05-06 0:19 ` [009/143] ASoC: Fix output PGA enabling in wm_hubs CODECs Greg KH
2011-05-06 0:19 ` [010/143] kconfig: Avoid buffer underrun in choice input Greg KH
2011-05-06 0:19 ` [011/143] UBIFS: fix master node recovery Greg KH
2011-05-06 0:19 ` [012/143] Remove extra struct page member from the buffer info structure Greg KH
2011-05-06 0:19 ` [013/143] [S390] dasd: correct device table Greg KH
2011-05-06 0:19 ` [014/143] iwlagn: Support new 5000 microcode Greg KH
2011-05-06 0:20 ` [015/143] atl1c: duplicate atl1c_get_tpd Greg KH
2011-05-06 0:20 ` [016/143] udp: Fix bogus UFO packet generation Greg KH
2011-05-06 0:20 ` [017/143] [PARISC] slub: fix panic with DISCONTIGMEM Greg KH
2011-05-06 0:20 ` [018/143] [PARISC] set memory ranges in N_NORMAL_MEMORY when onlined Greg KH
2011-05-06 0:20 ` [019/143] [media] FLEXCOP-PCI: fix __xlate_proc_name-warning for flexcop-pci Greg KH
2011-05-06 0:20 ` [020/143] m68k/mm: Set all online nodes in N_NORMAL_MEMORY Greg KH
2011-05-06 0:20 ` [021/143] nfs: dont lose MS_SYNCHRONOUS on remount of noac mount Greg KH
2011-05-06 0:20 ` [022/143] NFSv4.1: Ensure state manager thread dies on last umount Greg KH
2011-05-06 0:20 ` [023/143] agp: fix arbitrary kernel memory writes Greg KH
2011-05-06 0:20 ` [024/143] agp: fix OOM and buffer overflow Greg KH
2011-05-06 0:20 ` [025/143] Input: xen-kbdfront - fix mouse getting stuck after save/restore Greg KH
2011-05-06 0:20 ` [026/143] [SCSI] pmcraid: reject negative request size Greg KH
2011-05-06 0:20 ` [027/143] [SCSI] mpt2sas: prevent heap overflows and unchecked reads Greg KH
2011-05-06 0:20 ` [028/143] [SCSI] put stricter guards on queue dead checks Greg KH
2011-05-06 0:20 ` [029/143] mmc: sdhci-pci: Fix error case in sdhci_pci_probe_slot() Greg KH
2011-05-06 0:20 ` [030/143] mmc: sdhci: Check mrq->cmd in sdhci_tasklet_finish Greg KH
2011-05-06 0:20 ` [031/143] mmc: sdhci: Check mrq != NULL " Greg KH
2011-05-06 0:20 ` [032/143] USB: fix regression in usbip by setting has_tt flag Greg KH
2011-05-06 0:20 ` [033/143] x86, AMD: Fix APIC timer erratum 400 affecting K8 Rev.A-E processors Greg KH
2011-05-06 0:20 ` [034/143] af_unix: Only allow recv on connected seqpacket sockets Greg KH
2011-05-06 0:20 ` [035/143] ARM: 6891/1: prevent heap corruption in OABI semtimedop Greg KH
2011-05-06 0:20 ` [036/143] i8k: Tell gcc that *regs gets clobbered Greg KH
2011-05-06 0:20 ` [037/143] Fix gcc 4.5.1 miscompiling drivers/char/i8k.c (again) Greg KH
2011-05-06 0:20 ` [038/143] Open with O_CREAT flag set fails to open existing files on non writable directories Greg KH
2011-05-06 0:20 ` [039/143] can: Add missing socket check in can/bcm release Greg KH
2011-05-06 0:20 ` [040/143] fs/partitions/ldm.c: fix oops caused by corrupted partition table Greg KH
2011-05-06 0:20 ` [041/143] netxen: module firmware hints Greg KH
2011-05-06 0:20 ` [042/143] bnx2x: declare MODULE_FIRMWARE Greg KH
2011-05-06 0:20 ` [043/143] cxgb3: " Greg KH
2011-05-06 0:20 ` [044/143] myri10ge: " Greg KH
2011-05-06 0:20 ` [045/143] netx: " Greg KH
2011-05-06 0:20 ` [046/143] pcnet-cs: " Greg KH
2011-05-06 0:20 ` [047/143] spider-net: " Greg KH
2011-05-06 0:20 ` [048/143] tms380tr: " Greg KH
2011-05-06 0:20 ` Greg KH [this message]
2011-05-06 0:20 ` [050/143] Input: elantech - do not advertise relative events Greg KH
2011-05-06 0:20 ` [051/143] Input: elantech - fix firmware version check Greg KH
2011-05-06 0:20 ` [052/143] Input: elantech - allow forcing Elantech protocol Greg KH
2011-05-06 0:20 ` [053/143] Input: elantech - ignore high bits in the position coordinates Greg KH
2011-05-06 0:20 ` [054/143] Input: elantech - use all 3 bytes when checking version Greg KH
2011-05-06 0:20 ` [055/143] Input: elantech - relax signature checks Greg KH
2011-05-06 0:20 ` [056/143] Input: elantech - discard the first 2 positions on some firmwares Greg KH
2011-05-06 0:20 ` [057/143] Staging: rtl8192su: check for skb == NULL Greg KH
2011-05-06 0:20 ` [058/143] Staging: rtl8192su: Clean up in case of an error in module initialisation Greg KH
2011-05-06 0:20 ` [059/143] Staging: rtl8192su: Fix procfs code for interfaces not named wlan0 Greg KH
2011-05-06 0:20 ` [060/143] Staging: rtl8192su: remove device ids Greg KH
2011-05-06 0:20 ` [061/143] Staging: rtl8192su: add " Greg KH
2011-05-06 0:20 ` [062/143] USB: retain USB device power/wakeup setting across reconfiguration Greg KH
2011-05-06 0:20 ` [063/143] USB: dont enable remote wakeup by default Greg KH
2011-05-06 0:20 ` [064/143] USB: teach "devices" file about Wireless and SuperSpeed USB Greg KH
2011-05-06 0:20 ` [065/143] GFS2: Clean up gfs2_adjust_quota() and do_glock() Greg KH
2011-05-06 0:20 ` [066/143] GFS2: Fix writing to non-page aligned gfs2_quota structures Greg KH
2011-05-06 0:20 ` [067/143] GFS2: BUG in gfs2_adjust_quota Greg KH
2011-05-06 0:20 ` [068/143] SUNRPC: fix NFS client over TCP hangs due to packet loss (Bug 16494) Greg KH
2011-05-06 0:20 ` [069/143] nfs4: Ensure that ACL pages sent over NFS were not allocated from the slab (v3) Greg KH
2011-05-06 0:20 ` [070/143] nfs: fix compilation warning Greg KH
2011-05-06 0:20 ` [071/143] Fix corrupted OSF partition table parsing Greg KH
2011-05-06 0:20 ` [072/143] Increase OSF partition limit from 8 to 18 Greg KH
2011-05-06 0:20 ` [073/143] Please add support for Microsoft MN-120 PCMCIA network card Greg KH
2011-05-06 0:20 ` [074/143] hwmon: (applesmc) Add iMac9,1 and MacBookPro2,2 support Greg KH
2011-05-06 0:21 ` [075/143] hwmon: (applesmc) Add support for MacBook Pro 5,3 and 5,4 Greg KH
2011-05-06 0:21 ` [076/143] hwmon: (applesmc) Add generic support for MacBook Pro 6 Greg KH
2011-05-06 0:21 ` [077/143] hwmon: (applesmc) Add generic support for MacBook Pro 7 Greg KH
2011-05-06 0:21 ` [078/143] hwmon: (applesmc) Add MacBookAir3,1(3,2) support Greg KH
2011-05-06 0:21 ` [079/143] ALSA: emux: Add trivial compat ioctl handler Greg KH
2011-05-06 0:21 ` [080/143] ALSA: powermac - Reverse HP detection on G4 DA Greg KH
2011-05-06 0:21 ` [081/143] ALSA: powermac - Lineout " Greg KH
2011-05-06 0:21 ` [082/143] ALSA: hda - Add support for the new 27 inch IMacs Greg KH
2011-05-06 0:21 ` [083/143] ALSA: hda - MacBookPro 5,3 line-in support Greg KH
2011-05-06 0:21 ` [084/143] ALSA: hda - Add model=mbp55 entry for MacBookPro 7,1 Greg KH
2011-05-06 0:21 ` [085/143] ALSA: hda - MacBookAir3,1(3,2) alsa support Greg KH
2011-05-06 0:21 ` [086/143] virtio_net: Add schedule check to napi_enable call Greg KH
2011-05-06 0:21 ` [087/143] virtio_net: fix oom handling on tx Greg KH
2011-05-06 0:21 ` [088/143] mac80211: Add define for TX headroom reserved by mac80211 itself Greg KH
2011-05-06 0:21 ` [089/143] rt2x00: Centralize setting of extra TX headroom requested by rt2x00 Greg KH
2011-05-06 0:21 ` [090/143] rt2x00: Properly request tx headroom for alignment operations Greg KH
2011-05-06 0:21 ` [091/143] rt2x00: use correct headroom for transmission Greg KH
2011-05-06 0:21 ` [092/143] Bluetooth: Add support Bluetooth controller of MacbookPro 6,2 Greg KH
2011-05-06 0:21 ` [093/143] Bluetooth: Add support Bluetooth controller of MacbookPro 7,1 Greg KH
2011-05-06 0:21 ` [094/143] Bluetooth: Add MacBookAir3,1(2) support Greg KH
2011-05-06 0:21 ` [095/143] perf tools: Display better error messages on missing packages Greg KH
2011-05-06 0:21 ` [096/143] perf tools: Add make DEBUG=1 to remove the -O6 cflag Greg KH
2011-05-06 0:21 ` [097/143] perf tools: Test -fstack-protector-all compiler option for inclusion in CFLAGS Greg KH
2011-05-06 0:21 ` [098/143] perf tools: Support static build Greg KH
2011-05-06 0:21 ` [099/143] perf tools: Add V=2 option to help debug config issues Greg KH
2011-05-06 0:21 ` [100/143] perf tools: Suggest static libraries as well Greg KH
2011-05-06 0:21 ` [101/143] perf: Use default compiler mode by default Greg KH
2011-05-06 0:21 ` [102/143] perf tools: Move QUIET_STDERR def to before first use Greg KH
2011-05-06 0:21 ` [103/143] perf tools: Check if /dev/null can be used as the -o gcc argument Greg KH
2011-05-06 0:21 ` [104/143] perf symbols: allow forcing use of cplus_demangle Greg KH
2011-05-06 0:21 ` [105/143] V4L/DVB: Add Elgato EyeTV Diversity to dibcom driver Greg KH
2011-05-06 0:21 ` [106/143] mmc: fix all hangs related to mmc/sd card insert/removal during suspend/resume Greg KH
2011-05-06 0:21 ` [107/143] mmc: build fix: mmc_pm_notify is only available with CONFIG_PM=y Greg KH
2011-05-06 0:21 ` [108/143] b43: Fix warning at drivers/mmc/core/core.c:237 in mmc_wait_for_cmd Greg KH
2011-05-06 0:21 ` [109/143] econet: Fix redeclaration of symbol len Greg KH
2011-05-06 0:21 ` [110/143] econet: fix CVE-2010-3848 Greg KH
2011-05-06 0:21 ` [111/143] dell-laptop: Add another Dell laptop to the DMI whitelist Greg KH
2011-05-06 0:21 ` [112/143] dell-laptop: Add another Dell laptop family " Greg KH
2011-05-06 0:21 ` [113/143] scsi_dh_emc: fix mode select request setup Greg KH
2011-05-06 0:21 ` [114/143] scsi_dh_emc: request flag cleanup Greg KH
2011-05-06 0:21 ` [115/143] cifs: fix another memleak, in cifs_root_iget Greg KH
2011-05-06 0:21 ` [116/143] e1000e: Reset 82577/82578 PHY before first PHY register read Greg KH
2011-05-06 0:21 ` [117/143] e1000: fix Tx hangs by disabling 64-bit DMA Greg KH
2011-05-06 0:21 ` [118/143] btrfs: Require CAP_SYS_ADMIN for filesystem rebalance Greg KH
2011-05-06 0:21 ` [119/143] af_unix: limit recursion level Greg KH
2011-05-06 0:21 ` [120/143] af_unix: limit unix_tot_inflight Greg KH
2011-05-06 0:21 ` [121/143] init, sched: Fix race between init and kthreadd Greg KH
2011-05-06 0:21 ` [122/143] backlight: MacBookAir3,1(3,2) mbp-nvidia-bl support Greg KH
2011-05-06 0:21 ` [123/143] bonding: Ensure that we unshare skbs prior to calling pskb_may_pull Greg KH
2011-05-06 0:21 ` [124/143] HID: add MacBookAir 3,1 and 3,2 support Greg KH
2011-05-06 0:21 ` [125/143] intel-iommu: Force-disable IOMMU for iGFX on broken Cantiga revisions Greg KH
2011-05-06 0:21 ` [126/143] ipg: Remove device claimed by dl2k from pci id table Greg KH
2011-05-06 0:21 ` [127/143] ipv6: Silence privacy extensions initialization Greg KH
2011-05-06 0:21 ` [128/143] l2tp: Fix UDP socket reference count bugs in the pppol2tp driver Greg KH
2011-05-06 0:21 ` [129/143] MIPS: DMA: Fix computation of DMA flags from devices coherent_dma_mask Greg KH
2011-05-06 0:21 ` [130/143] mpt2sas: fix the incorrect scsi_dma_map error checking Greg KH
2011-05-06 0:21 ` [131/143] niu: Fix kernel buffer overflow for ETHTOOL_GRXCLSRLALL Greg KH
2011-05-06 0:21 ` [132/143] Phonet: device notifier only runs on initial namespace Greg KH
2011-05-06 0:21 ` [133/143] powerpc/boot/dts: Install dts from the right directory Greg KH
2011-05-06 0:21 ` [134/143] rt2500usb: fallback to SW encryption for TKIP+AES Greg KH
2011-05-06 0:22 ` [135/143] sata_via: Delay on vt6420 when starting ATAPI DMA write Greg KH
2011-05-06 0:22 ` [136/143] tehuti: Firmware filename is tehuti/bdx.bin Greg KH
2011-05-06 0:22 ` [137/143] wireless: b43: fix error path in SDIO Greg KH
2011-05-06 0:22 ` [138/143] libata: set queue DMA alignment to sector size for ATAPI too Greg KH
2011-05-06 0:22 ` [139/143] usb: musb: core: set has_tt flag Greg KH
2011-05-06 0:22 ` [140/143] iwlwifi: fix skb usage after free Greg KH
2011-05-06 0:22 ` [141/143] x86: pvclock: Move scale_delta into common header Greg KH
2011-05-06 0:22 ` [142/143] KVM: x86: Fix a possible backwards warp of kvmclock Greg KH
2011-05-06 0:22 ` [143/143] KVM: x86: Fix kvmclock bug Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110506002210.041111928@clark.kroah.org \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=dtor@mail.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=stable-review@kernel.org \
--cc=stable@kernel.org \
--cc=tiwai@suse.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®