summarylogtreecommitdiffstats
path: root/0002-synaptics-add-debugging-to-synaptics_has_led.patch
blob: bbaed93cdcaba768ca7f62ee7c3cf3f1bf5c6f60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
From 3fc9047435e4ecd085a22387c8d5b03dd3bab685 Mon Sep 17 00:00:00 2001
Message-Id: <3fc9047435e4ecd085a22387c8d5b03dd3bab685.1380721797.git.matthew.monaco@0x01b.net>
In-Reply-To: <b39dcb00fbece6da346b6581c3ec6c6a2ba133ca.1380721797.git.matthew.monaco@0x01b.net>
References: <b39dcb00fbece6da346b6581c3ec6c6a2ba133ca.1380721797.git.matthew.monaco@0x01b.net>
From: Matthew Monaco <matthew.monaco@0x01b.net>
Date: Mon, 19 Nov 2012 11:24:13 -0700
Subject: [PATCH 2/2] synaptics: add debugging to synaptics_has_led()

---
 drivers/input/mouse/Kconfig     |  1 +
 drivers/input/mouse/synaptics.c | 24 ++++++++++++++++++++----
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig
index 39d1578..36a84df 100644
--- a/drivers/input/mouse/Kconfig
+++ b/drivers/input/mouse/Kconfig
@@ -80,6 +80,7 @@ config MOUSE_PS2_CYPRESS
 
 config MOUSE_PS2_SYNAPTICS_LED
 	bool "Support embedded LED on Synaptics devices"
+	default y
 	depends on MOUSE_PS2_SYNAPTICS
 	depends on LEDS_CLASS=y || LEDS_CLASS=MOUSE_PS2
 	help
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 44051fe9..9553595 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -486,7 +486,7 @@ static void synaptics_pt_create(struct psmouse *psmouse)
 	serio_register_port(serio);
 }
 
-#ifdef CONFIG_MOUSE_PS2_SYNAPTICS_LED
+#if 1
 /*
  * LED handling:
  * Some Synaptics devices have an embeded LED at the top-left corner.
@@ -544,19 +544,35 @@ static void synaptics_sync_led(struct psmouse *psmouse)
 
 static bool synaptics_has_led(struct synaptics_data *priv)
 {
-	if (!priv->ext_cap_0c)
+	printk(KERN_NOTICE "synaptics: led: checking for led\n");
+
+	if (!priv->ext_cap_0c) {
+		printk(KERN_NOTICE "synaptics: led: !priv->ext_cap_0c is true... no led\n");
 		return false;
+	}
+
+	printk(KERN_NOTICE "synaptics: led: your product ID is %2lx\n", SYN_CAP_PRODUCT_ID(priv->ext_cap));
+
 	/* FIXME: LED is supposedly detectable in cap0c[1] 0x20, but it seems
 	 * not working on real machines.
 	 * So we check the product id to be sure.
 	 */
+
 	if (SYN_CAP_PRODUCT_ID(priv->ext_cap) != 0xe4 &&
 	    SYN_CAP_PRODUCT_ID(priv->ext_cap) != 0x64 &&
-	    SYN_CAP_PRODUCT_ID(priv->ext_cap) != 0x84)
+	    SYN_CAP_PRODUCT_ID(priv->ext_cap) != 0x84) {
+		printk(KERN_NOTICE "synaptics: led: your product ID is not in the whitelist\n");
 		return false;
+	}
+
 	if (!(priv->ext_cap_0c & 0x2000) &&
-	    (priv->capabilities & 0xd000ff) != 0xd00073)
+	    (priv->capabilities & 0xd000ff) != 0xd00073) {
+		printk(KERN_NOTICE "synaptics: led: failed capabilities check\n");
 		return false;
+	}
+
+	printk(KERN_NOTICE "synaptics: led: looks like you have one\n");
+
 	return true;
 }
 
-- 
1.8.4