linux/drivers/iio/common/hid-sensors/hid-sensor-attributes.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * HID Sensors Driver
 * Copyright (c) 2012, Intel Corporation.
 */
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/time.h>
#include <linux/units.h>

#include <linux/hid-sensor-hub.h>
#include <linux/iio/iio.h>

static struct {} unit_conversion[] =;

static void simple_div(int dividend, int divisor, int *whole,
				int *micro_frac)
{}

static void split_micro_fraction(unsigned int no, int exp, int *val1, int *val2)
{}

/*
VTF format uses exponent and variable size format.
For example if the size is 2 bytes
0x0067 with VTF16E14 format -> +1.03
To convert just change to 0x67 to decimal and use two decimal as E14 stands
for 10^-2.
Negative numbers are 2's complement
*/
static void convert_from_vtf_format(u32 value, int size, int exp,
					int *val1, int *val2)
{}

static u32 convert_to_vtf_format(int size, int exp, int val1, int val2)
{}

s32 hid_sensor_read_poll_value(struct hid_sensor_common *st)
{}
EXPORT_SYMBOL_NS();

int hid_sensor_read_samp_freq_value(struct hid_sensor_common *st,
				int *val1, int *val2)
{}
EXPORT_SYMBOL_NS();

int hid_sensor_write_samp_freq_value(struct hid_sensor_common *st,
				int val1, int val2)
{}
EXPORT_SYMBOL_NS();

int hid_sensor_read_raw_hyst_value(struct hid_sensor_common *st,
				int *val1, int *val2)
{}
EXPORT_SYMBOL_NS();

int hid_sensor_read_raw_hyst_rel_value(struct hid_sensor_common *st, int *val1,
				       int *val2)
{}
EXPORT_SYMBOL_NS();


int hid_sensor_write_raw_hyst_value(struct hid_sensor_common *st,
					int val1, int val2)
{}
EXPORT_SYMBOL_NS();

int hid_sensor_write_raw_hyst_rel_value(struct hid_sensor_common *st,
					int val1, int val2)
{}
EXPORT_SYMBOL_NS();

/*
 * This fuction applies the unit exponent to the scale.
 * For example:
 * 9.806650000 ->exp:2-> val0[980]val1[665000000]
 * 9.000806000 ->exp:2-> val0[900]val1[80600000]
 * 0.174535293 ->exp:2-> val0[17]val1[453529300]
 * 1.001745329 ->exp:0-> val0[1]val1[1745329]
 * 1.001745329 ->exp:2-> val0[100]val1[174532900]
 * 1.001745329 ->exp:4-> val0[10017]val1[453290000]
 * 9.806650000 ->exp:-2-> val0[0]val1[98066500]
 */
static void adjust_exponent_nano(int *val0, int *val1, int scale0,
				  int scale1, int exp)
{}

int hid_sensor_format_scale(u32 usage_id,
			struct hid_sensor_hub_attribute_info *attr_info,
			int *val0, int *val1)
{}
EXPORT_SYMBOL_NS();

int64_t hid_sensor_convert_timestamp(struct hid_sensor_common *st,
				     int64_t raw_value)
{}
EXPORT_SYMBOL_NS();

static
int hid_sensor_get_reporting_interval(struct hid_sensor_hub_device *hsdev,
					u32 usage_id,
					struct hid_sensor_common *st)
{}

static void hid_sensor_get_report_latency_info(struct hid_sensor_hub_device *hsdev,
					       u32 usage_id,
					       struct hid_sensor_common *st)
{}

int hid_sensor_get_report_latency(struct hid_sensor_common *st)
{}
EXPORT_SYMBOL_NS();

int hid_sensor_set_report_latency(struct hid_sensor_common *st, int latency_ms)
{}
EXPORT_SYMBOL_NS();

bool hid_sensor_batch_mode_supported(struct hid_sensor_common *st)
{}
EXPORT_SYMBOL_NS();

int hid_sensor_parse_common_attributes(struct hid_sensor_hub_device *hsdev,
					u32 usage_id,
					struct hid_sensor_common *st,
					const u32 *sensitivity_addresses,
					u32 sensitivity_addresses_len)
{}
EXPORT_SYMBOL_NS();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();