aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRobert Gerlach <khnz@gmx.de>2012-04-03 16:34:35 -0400
committerMatthew Garrett <mjg@redhat.com>2012-05-31 14:23:39 -0400
commit14b234b10544046544a81095c9ab372842f80eea (patch)
tree7461df34aadf9872158409a020e2786e1ebbb87c /drivers
parent32be65bee53ce7057b8ab3455af1e9b762bb510f (diff)
fujitsu-tablet: correct quirks for Lifebook and Stylistic tablets
This patch adds a quirk to fix the dock detection for Fujitsu Stylistic devices and fixes an bug in which tablet mode state was not correctly reported in Fujitsu Lifebook and Stylistic models. Signed-off-by: Robert Gerlach <khnz@gmx.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/platform/x86/fujitsu-tablet.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/drivers/platform/x86/fujitsu-tablet.c b/drivers/platform/x86/fujitsu-tablet.c
index 8b74fdfc77cd..da267eae8ba8 100644
--- a/drivers/platform/x86/fujitsu-tablet.c
+++ b/drivers/platform/x86/fujitsu-tablet.c
@@ -36,7 +36,8 @@
36#define ACPI_FUJITSU_CLASS "fujitsu" 36#define ACPI_FUJITSU_CLASS "fujitsu"
37 37
38#define INVERT_TABLET_MODE_BIT 0x01 38#define INVERT_TABLET_MODE_BIT 0x01
39#define FORCE_TABLET_MODE_IF_UNDOCK 0x02 39#define INVERT_DOCK_STATE_BIT 0x02
40#define FORCE_TABLET_MODE_IF_UNDOCK 0x04
40 41
41#define KEYMAP_LEN 16 42#define KEYMAP_LEN 16
42 43
@@ -163,6 +164,8 @@ static void fujitsu_send_state(void)
163 state = fujitsu_read_register(0xdd); 164 state = fujitsu_read_register(0xdd);
164 165
165 dock = state & 0x02; 166 dock = state & 0x02;
167 if (fujitsu.config.quirks & INVERT_DOCK_STATE_BIT)
168 dock = !dock;
166 169
167 if ((fujitsu.config.quirks & FORCE_TABLET_MODE_IF_UNDOCK) && (!dock)) { 170 if ((fujitsu.config.quirks & FORCE_TABLET_MODE_IF_UNDOCK) && (!dock)) {
168 tablet_mode = 1; 171 tablet_mode = 1;
@@ -274,25 +277,31 @@ static irqreturn_t fujitsu_interrupt(int irq, void *dev_id)
274 return IRQ_HANDLED; 277 return IRQ_HANDLED;
275} 278}
276 279
277static int __devinit fujitsu_dmi_default(const struct dmi_system_id *dmi) 280static void __devinit fujitsu_dmi_common(const struct dmi_system_id *dmi)
278{ 281{
279 pr_info("%s\n", dmi->ident); 282 pr_info("%s\n", dmi->ident);
280 memcpy(fujitsu.config.keymap, dmi->driver_data, 283 memcpy(fujitsu.config.keymap, dmi->driver_data,
281 sizeof(fujitsu.config.keymap)); 284 sizeof(fujitsu.config.keymap));
285}
286
287static int __devinit fujitsu_dmi_lifebook(const struct dmi_system_id *dmi)
288{
289 fujitsu_dmi_common(dmi);
290 fujitsu.config.quirks |= INVERT_TABLET_MODE_BIT;
282 return 1; 291 return 1;
283} 292}
284 293
285static int __devinit fujitsu_dmi_stylistic(const struct dmi_system_id *dmi) 294static int __devinit fujitsu_dmi_stylistic(const struct dmi_system_id *dmi)
286{ 295{
287 fujitsu_dmi_default(dmi); 296 fujitsu_dmi_common(dmi);
288 fujitsu.config.quirks |= FORCE_TABLET_MODE_IF_UNDOCK; 297 fujitsu.config.quirks |= FORCE_TABLET_MODE_IF_UNDOCK;
289 fujitsu.config.quirks |= INVERT_TABLET_MODE_BIT; 298 fujitsu.config.quirks |= INVERT_DOCK_STATE_BIT;
290 return 1; 299 return 1;
291} 300}
292 301
293static struct dmi_system_id dmi_ids[] __initconst = { 302static struct dmi_system_id dmi_ids[] __initconst = {
294 { 303 {
295 .callback = fujitsu_dmi_default, 304 .callback = fujitsu_dmi_lifebook,
296 .ident = "Fujitsu Siemens P/T Series", 305 .ident = "Fujitsu Siemens P/T Series",
297 .matches = { 306 .matches = {
298 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 307 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
@@ -301,7 +310,7 @@ static struct dmi_system_id dmi_ids[] __initconst = {
301 .driver_data = keymap_Lifebook_Tseries 310 .driver_data = keymap_Lifebook_Tseries
302 }, 311 },
303 { 312 {
304 .callback = fujitsu_dmi_default, 313 .callback = fujitsu_dmi_lifebook,
305 .ident = "Fujitsu Lifebook T Series", 314 .ident = "Fujitsu Lifebook T Series",
306 .matches = { 315 .matches = {
307 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 316 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
@@ -319,7 +328,7 @@ static struct dmi_system_id dmi_ids[] __initconst = {
319 .driver_data = keymap_Stylistic_Tseries 328 .driver_data = keymap_Stylistic_Tseries
320 }, 329 },
321 { 330 {
322 .callback = fujitsu_dmi_default, 331 .callback = fujitsu_dmi_lifebook,
323 .ident = "Fujitsu LifeBook U810", 332 .ident = "Fujitsu LifeBook U810",
324 .matches = { 333 .matches = {
325 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 334 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
@@ -346,7 +355,7 @@ static struct dmi_system_id dmi_ids[] __initconst = {
346 .driver_data = keymap_Stylistic_ST5xxx 355 .driver_data = keymap_Stylistic_ST5xxx
347 }, 356 },
348 { 357 {
349 .callback = fujitsu_dmi_default, 358 .callback = fujitsu_dmi_lifebook,
350 .ident = "Unknown (using defaults)", 359 .ident = "Unknown (using defaults)",
351 .matches = { 360 .matches = {
352 DMI_MATCH(DMI_SYS_VENDOR, ""), 361 DMI_MATCH(DMI_SYS_VENDOR, ""),
@@ -472,6 +481,6 @@ module_exit(fujitsu_module_exit);
472MODULE_AUTHOR("Robert Gerlach <khnz@gmx.de>"); 481MODULE_AUTHOR("Robert Gerlach <khnz@gmx.de>");
473MODULE_DESCRIPTION("Fujitsu tablet pc extras driver"); 482MODULE_DESCRIPTION("Fujitsu tablet pc extras driver");
474MODULE_LICENSE("GPL"); 483MODULE_LICENSE("GPL");
475MODULE_VERSION("2.4"); 484MODULE_VERSION("2.5");
476 485
477MODULE_DEVICE_TABLE(acpi, fujitsu_ids); 486MODULE_DEVICE_TABLE(acpi, fujitsu_ids);