diff options
author | Hans de Goede | 2020-05-10 14:20:46 +0200 |
---|---|---|
committer | Andy Shevchenko | 2020-05-12 17:27:12 +0300 |
commit | f913c3086c5078f67c1a6833f6fd1593d8a174fe (patch) | |
tree | 960414612a9b1a72f1a7ed41056aced7f1468d5a /drivers/platform | |
parent | 10d7ff74b6f2d5e5b38d752a683225c944dd3da9 (diff) |
platform/x86: intel-vbtn: Move detect_tablet_mode() to higher in the file
This is a preparation patch for calling detect_tablet_mode() from
intel_vbtn_input_setup() without needing a forward declaration.
Note this commit makes no functional changes, the moved block of code
is completely unchanged.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/intel-vbtn.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c index 4efc70b693a7..29984154f8e4 100644 --- a/drivers/platform/x86/intel-vbtn.c +++ b/drivers/platform/x86/intel-vbtn.c @@ -60,6 +60,24 @@ struct intel_vbtn_priv { bool wakeup_mode; }; +static void detect_tablet_mode(struct platform_device *device) +{ + struct intel_vbtn_priv *priv = dev_get_drvdata(&device->dev); + acpi_handle handle = ACPI_HANDLE(&device->dev); + unsigned long long vgbs; + acpi_status status; + int m; + + status = acpi_evaluate_integer(handle, "VGBS", NULL, &vgbs); + if (ACPI_FAILURE(status)) + return; + + m = !(vgbs & TABLET_MODE_FLAG); + input_report_switch(priv->input_dev, SW_TABLET_MODE, m); + m = (vgbs & DOCK_MODE_FLAG) ? 1 : 0; + input_report_switch(priv->input_dev, SW_DOCK, m); +} + static int intel_vbtn_input_setup(struct platform_device *device) { struct intel_vbtn_priv *priv = dev_get_drvdata(&device->dev); @@ -138,24 +156,6 @@ out_unknown: dev_dbg(&device->dev, "unknown event index 0x%x\n", event); } -static void detect_tablet_mode(struct platform_device *device) -{ - struct intel_vbtn_priv *priv = dev_get_drvdata(&device->dev); - acpi_handle handle = ACPI_HANDLE(&device->dev); - unsigned long long vgbs; - acpi_status status; - int m; - - status = acpi_evaluate_integer(handle, "VGBS", NULL, &vgbs); - if (ACPI_FAILURE(status)) - return; - - m = !(vgbs & TABLET_MODE_FLAG); - input_report_switch(priv->input_dev, SW_TABLET_MODE, m); - m = (vgbs & DOCK_MODE_FLAG) ? 1 : 0; - input_report_switch(priv->input_dev, SW_DOCK, m); -} - static bool intel_vbtn_has_buttons(acpi_handle handle) { acpi_status status; |