#include <linux/device.h>
#include <linux/hid.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/mfd/core.h>
#include <linux/list.h>
#include <linux/hid-sensor-ids.h>
#include <linux/hid-sensor-hub.h>
#include "hid-ids.h"
#define HID_SENSOR_HUB_ENUM_QUIRK …
struct sensor_hub_data { … };
struct hid_sensor_hub_callbacks_list { … };
static struct hid_report *sensor_hub_report(int id, struct hid_device *hdev,
int dir)
{ … }
static int sensor_hub_get_physical_device_count(struct hid_device *hdev)
{ … }
static void sensor_hub_fill_attr_info(
struct hid_sensor_hub_attribute_info *info,
s32 index, s32 report_id, struct hid_field *field)
{ … }
static struct hid_sensor_hub_callbacks *sensor_hub_get_callback(
struct hid_device *hdev,
u32 usage_id,
int collection_index,
struct hid_sensor_hub_device **hsdev,
void **priv)
{ … }
int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev,
u32 usage_id,
struct hid_sensor_hub_callbacks *usage_callback)
{ … }
EXPORT_SYMBOL_GPL(…);
int sensor_hub_remove_callback(struct hid_sensor_hub_device *hsdev,
u32 usage_id)
{ … }
EXPORT_SYMBOL_GPL(…);
int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
u32 field_index, int buffer_size, void *buffer)
{ … }
EXPORT_SYMBOL_GPL(…);
int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
u32 field_index, int buffer_size, void *buffer)
{ … }
EXPORT_SYMBOL_GPL(…);
int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev,
u32 usage_id,
u32 attr_usage_id, u32 report_id,
enum sensor_hub_read_flags flag,
bool is_signed)
{ … }
EXPORT_SYMBOL_GPL(…);
int hid_sensor_get_usage_index(struct hid_sensor_hub_device *hsdev,
u32 report_id, int field_index, u32 usage_id)
{ … }
EXPORT_SYMBOL_GPL(…);
int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev,
u8 type,
u32 usage_id,
u32 attr_usage_id,
struct hid_sensor_hub_attribute_info *info)
{ … }
EXPORT_SYMBOL_GPL(…);
#ifdef CONFIG_PM
static int sensor_hub_suspend(struct hid_device *hdev, pm_message_t message)
{ … }
static int sensor_hub_resume(struct hid_device *hdev)
{ … }
static int sensor_hub_reset_resume(struct hid_device *hdev)
{ … }
#endif
static int sensor_hub_raw_event(struct hid_device *hdev,
struct hid_report *report, u8 *raw_data, int size)
{ … }
int sensor_hub_device_open(struct hid_sensor_hub_device *hsdev)
{ … }
EXPORT_SYMBOL_GPL(…);
void sensor_hub_device_close(struct hid_sensor_hub_device *hsdev)
{ … }
EXPORT_SYMBOL_GPL(…);
static __u8 *sensor_hub_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{ … }
static int sensor_hub_probe(struct hid_device *hdev,
const struct hid_device_id *id)
{ … }
static void sensor_hub_remove(struct hid_device *hdev)
{ … }
static const struct hid_device_id sensor_hub_devices[] = …;
MODULE_DEVICE_TABLE(hid, sensor_hub_devices);
static struct hid_driver sensor_hub_driver = …;
module_hid_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;