linux/drivers/platform/chrome/chromeos_tbmc.c

// SPDX-License-Identifier: GPL-2.0
// Driver to detect Tablet Mode for ChromeOS convertible.
//
// Copyright (C) 2017 Google, Inc.
// Author: Gwendal Grignou <[email protected]>
//
// On Chromebook using ACPI, this device listens for notification
// from GOOG0006 and issue method TBMC to retrieve the status.
//
// GOOG0006 issues the notification when it receives EC_HOST_EVENT_MODE_CHANGE
// from the EC.
// Method TBMC reads EC_ACPI_MEM_DEVICE_ORIENTATION byte from the shared
// memory region.

#include <linux/acpi.h>
#include <linux/input.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/printk.h>

#define DRV_NAME
#define ACPI_DRV_NAME

static int chromeos_tbmc_query_switch(struct acpi_device *adev,
				     struct input_dev *idev)
{}

static __maybe_unused int chromeos_tbmc_resume(struct device *dev)
{}

static void chromeos_tbmc_notify(struct acpi_device *adev, u32 event)
{}

static int chromeos_tbmc_open(struct input_dev *idev)
{}

static int chromeos_tbmc_add(struct acpi_device *adev)
{}

static const struct acpi_device_id chromeos_tbmc_acpi_device_ids[] =;
MODULE_DEVICE_TABLE(acpi, chromeos_tbmc_acpi_device_ids);

static SIMPLE_DEV_PM_OPS(chromeos_tbmc_pm_ops, NULL,
		chromeos_tbmc_resume);

static struct acpi_driver chromeos_tbmc_driver =;

module_acpi_driver();

MODULE_LICENSE();
MODULE_DESCRIPTION();