#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/hid-sensor-hub.h>
#include <linux/iio/iio.h>
#include <linux/iio/buffer.h>
#include "../common/hid-sensors/hid-sensor-trigger.h"
enum magn_3d_channel { … };
struct common_attributes { … };
struct magn_3d_state { … };
static const u32 magn_3d_addresses[MAGN_3D_CHANNEL_MAX] = …;
static const u32 magn_3d_sensitivity_addresses[] = …;
static const struct iio_chan_spec magn_3d_channels[] = …;
static void magn_3d_adjust_channel_bit_mask(struct iio_chan_spec *channels,
int channel, int size)
{ … }
static int magn_3d_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2,
long mask)
{ … }
static int magn_3d_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int val,
int val2,
long mask)
{ … }
static const struct iio_info magn_3d_info = …;
static int magn_3d_proc_event(struct hid_sensor_hub_device *hsdev,
unsigned usage_id,
void *priv)
{ … }
static int magn_3d_capture_sample(struct hid_sensor_hub_device *hsdev,
unsigned usage_id,
size_t raw_len, char *raw_data,
void *priv)
{ … }
static int magn_3d_parse_report(struct platform_device *pdev,
struct hid_sensor_hub_device *hsdev,
struct iio_chan_spec **channels,
int *chan_count,
unsigned usage_id,
struct magn_3d_state *st)
{ … }
static int hid_magn_3d_probe(struct platform_device *pdev)
{ … }
static void hid_magn_3d_remove(struct platform_device *pdev)
{ … }
static const struct platform_device_id hid_magn_3d_ids[] = …;
MODULE_DEVICE_TABLE(platform, hid_magn_3d_ids);
static struct platform_driver hid_magn_3d_platform_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_IMPORT_NS(…);