#include <linux/acpi.h>
#include <linux/hid.h>
#include <linux/input/vivaldi-fmap.h>
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_data/cros_ec_commands.h>
#include <linux/platform_data/cros_ec_proto.h>
#include <linux/platform_device.h>
#include <linux/pm_wakeup.h>
#include <asm/unaligned.h>
#include "hid-ids.h"
#include "hid-vivaldi-common.h"
struct cbas_ec { … };
static struct cbas_ec cbas_ec;
static DEFINE_SPINLOCK(cbas_ec_lock);
static DEFINE_MUTEX(cbas_ec_reglock);
static bool cbas_parse_base_state(const void *data)
{ … }
static int cbas_ec_query_base(struct cros_ec_device *ec_dev, bool get_state,
bool *state)
{ … }
static int cbas_ec_notify(struct notifier_block *nb,
unsigned long queued_during_suspend,
void *_notify)
{ … }
static __maybe_unused int cbas_ec_resume(struct device *dev)
{ … }
static SIMPLE_DEV_PM_OPS(cbas_ec_pm_ops, NULL, cbas_ec_resume);
static void cbas_ec_set_input(struct input_dev *input)
{ … }
static int __cbas_ec_probe(struct platform_device *pdev)
{ … }
static int cbas_ec_probe(struct platform_device *pdev)
{ … }
static void cbas_ec_remove(struct platform_device *pdev)
{ … }
static const struct acpi_device_id cbas_ec_acpi_ids[] = …;
MODULE_DEVICE_TABLE(acpi, cbas_ec_acpi_ids);
#ifdef CONFIG_OF
static const struct of_device_id cbas_ec_of_match[] = …;
MODULE_DEVICE_TABLE(of, cbas_ec_of_match);
#endif
static struct platform_driver cbas_ec_driver = …;
#define MAX_BRIGHTNESS …
struct hammer_kbd_leds { … };
static int hammer_kbd_brightness_set_blocking(struct led_classdev *cdev,
enum led_brightness br)
{ … }
static int hammer_register_leds(struct hid_device *hdev)
{ … }
#define HID_UP_GOOGLEVENDOR …
#define HID_VD_KBD_FOLDED …
#define HID_USAGE_KBD_FOLDED …
#define HID_AD_BRIGHTNESS …
static int hammer_input_mapping(struct hid_device *hdev, struct hid_input *hi,
struct hid_field *field,
struct hid_usage *usage,
unsigned long **bit, int *max)
{ … }
static void hammer_folded_event(struct hid_device *hdev, bool folded)
{ … }
static int hammer_event(struct hid_device *hid, struct hid_field *field,
struct hid_usage *usage, __s32 value)
{ … }
static bool hammer_has_usage(struct hid_device *hdev, unsigned int report_type,
unsigned application, unsigned usage)
{ … }
static bool hammer_has_folded_event(struct hid_device *hdev)
{ … }
static bool hammer_has_backlight_control(struct hid_device *hdev)
{ … }
static void hammer_get_folded_state(struct hid_device *hdev)
{ … }
static void hammer_stop(void *hdev)
{ … }
static int hammer_probe(struct hid_device *hdev,
const struct hid_device_id *id)
{ … }
static void hammer_remove(struct hid_device *hdev)
{ … }
static const struct hid_device_id hammer_devices[] = …;
MODULE_DEVICE_TABLE(hid, hammer_devices);
static struct hid_driver hammer_driver = …;
static int __init hammer_init(void)
{ … }
module_init(…) …;
static void __exit hammer_exit(void)
{ … }
module_exit(hammer_exit);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;