#include <linux/hid-sensor-hub.h>
#include <linux/iio/buffer.h>
#include <linux/iio/iio.h>
#include <linux/platform_device.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include "../common/hid-sensors/hid-sensor-trigger.h"
enum hinge_channel { … };
#define CHANNEL_SCAN_INDEX_TIMESTAMP …
static const u32 hinge_addresses[CHANNEL_SCAN_INDEX_MAX] = …;
static const char *const hinge_labels[CHANNEL_SCAN_INDEX_MAX] = …;
struct hinge_state { … };
static const u32 hinge_sensitivity_addresses[] = …;
static const struct iio_chan_spec hinge_channels[] = …;
static void hinge_adjust_channel_realbits(struct iio_chan_spec *channels,
int channel, int size)
{ … }
static int hinge_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, int *val, int *val2,
long mask)
{ … }
static int hinge_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, int val, int val2,
long mask)
{ … }
static int hinge_read_label(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, char *label)
{ … }
static const struct iio_info hinge_info = …;
static int hinge_proc_event(struct hid_sensor_hub_device *hsdev,
unsigned int usage_id, void *priv)
{ … }
static int hinge_capture_sample(struct hid_sensor_hub_device *hsdev,
unsigned int usage_id, size_t raw_len,
char *raw_data, void *priv)
{ … }
static int hinge_parse_report(struct platform_device *pdev,
struct hid_sensor_hub_device *hsdev,
struct iio_chan_spec *channels,
unsigned int usage_id, struct hinge_state *st)
{ … }
static int hid_hinge_probe(struct platform_device *pdev)
{ … }
static void hid_hinge_remove(struct platform_device *pdev)
{ … }
static const struct platform_device_id hid_hinge_ids[] = …;
MODULE_DEVICE_TABLE(platform, hid_hinge_ids);
static struct platform_driver hid_hinge_platform_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_IMPORT_NS(…);