@@ -73,10 +73,10 @@ struct intel_vbtn_priv {
73
73
bool wakeup_mode ;
74
74
};
75
75
76
- static void detect_tablet_mode (struct platform_device * device )
76
+ static void detect_tablet_mode (struct device * dev )
77
77
{
78
- struct intel_vbtn_priv * priv = dev_get_drvdata (& device -> dev );
79
- acpi_handle handle = ACPI_HANDLE (& device -> dev );
78
+ struct intel_vbtn_priv * priv = dev_get_drvdata (dev );
79
+ acpi_handle handle = ACPI_HANDLE (dev );
80
80
unsigned long long vgbs ;
81
81
acpi_status status ;
82
82
int m ;
@@ -89,6 +89,8 @@ static void detect_tablet_mode(struct platform_device *device)
89
89
input_report_switch (priv -> switches_dev , SW_TABLET_MODE , m );
90
90
m = (vgbs & VGBS_DOCK_MODE_FLAG ) ? 1 : 0 ;
91
91
input_report_switch (priv -> switches_dev , SW_DOCK , m );
92
+
93
+ input_sync (priv -> switches_dev );
92
94
}
93
95
94
96
/*
@@ -134,7 +136,7 @@ static int intel_vbtn_input_setup(struct platform_device *device)
134
136
priv -> switches_dev -> id .bustype = BUS_HOST ;
135
137
136
138
if (priv -> has_switches ) {
137
- detect_tablet_mode (device );
139
+ detect_tablet_mode (& device -> dev );
138
140
139
141
ret = input_register_device (priv -> switches_dev );
140
142
if (ret )
@@ -198,6 +200,9 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)
198
200
autorelease = val && (!ke_rel || ke_rel -> type == KE_IGNORE );
199
201
200
202
sparse_keymap_report_event (input_dev , event , val , autorelease );
203
+
204
+ /* Some devices need this to report further events */
205
+ acpi_evaluate_object (handle , "VBDL" , NULL , NULL );
201
206
}
202
207
203
208
/*
@@ -352,7 +357,13 @@ static void intel_vbtn_pm_complete(struct device *dev)
352
357
353
358
static int intel_vbtn_pm_resume (struct device * dev )
354
359
{
360
+ struct intel_vbtn_priv * priv = dev_get_drvdata (dev );
361
+
355
362
intel_vbtn_pm_complete (dev );
363
+
364
+ if (priv -> has_switches )
365
+ detect_tablet_mode (dev );
366
+
356
367
return 0 ;
357
368
}
358
369
0 commit comments