Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 353739
b: refs/heads/master
c: 2974cdf
h: refs/heads/master
i:
  353737: b52bcc2
  353735: f73d4e7
v: v3
  • Loading branch information
Alexander Holler authored and Jonathan Cameron committed Jan 6, 2013
1 parent 9c1cbe8 commit 80de747
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 64 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8e3cdca26c9d9f0936c555bc67e2a5d71e61bb0d
refs/heads/master: 2974cdf293e1cb00860522624252aeaba502c8bf
1 change: 0 additions & 1 deletion trunk/drivers/iio/accel/hid-sensor-accel-3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <linux/iio/buffer.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/triggered_buffer.h>
#include "../common/hid-sensors/hid-sensor-attributes.h"
#include "../common/hid-sensors/hid-sensor-trigger.h"

/*Format: HID-SENSOR-usage_id_in_hex*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <linux/hid-sensor-hub.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include "hid-sensor-attributes.h"

static int pow_10(unsigned power)
{
Expand Down
57 changes: 0 additions & 57 deletions trunk/drivers/iio/common/hid-sensors/hid-sensor-attributes.h

This file was deleted.

1 change: 0 additions & 1 deletion trunk/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <linux/iio/iio.h>
#include <linux/iio/trigger.h>
#include <linux/iio/sysfs.h>
#include "hid-sensor-attributes.h"
#include "hid-sensor-trigger.h"

static int hid_sensor_data_rdy_trigger_set_state(struct iio_trigger *trig,
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/iio/gyro/hid-sensor-gyro-3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <linux/iio/buffer.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/triggered_buffer.h>
#include "../common/hid-sensors/hid-sensor-attributes.h"
#include "../common/hid-sensors/hid-sensor-trigger.h"

/*Format: HID-SENSOR-usage_id_in_hex*/
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/iio/light/hid-sensor-als.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <linux/iio/buffer.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/triggered_buffer.h>
#include "../common/hid-sensors/hid-sensor-attributes.h"
#include "../common/hid-sensors/hid-sensor-trigger.h"

/*Format: HID-SENSOR-usage_id_in_hex*/
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/iio/magnetometer/hid-sensor-magn-3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <linux/iio/buffer.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/triggered_buffer.h>
#include "../common/hid-sensors/hid-sensor-attributes.h"
#include "../common/hid-sensors/hid-sensor-trigger.h"

/*Format: HID-SENSOR-usage_id_in_hex*/
Expand Down
38 changes: 38 additions & 0 deletions trunk/include/linux/hid-sensor-hub.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,42 @@ int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
*/
int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
u32 field_index, s32 *value);

/* hid-sensor-attributes */

/* Common hid sensor iio structure */
struct hid_sensor_iio_common {
struct hid_sensor_hub_device *hsdev;
struct platform_device *pdev;
unsigned usage_id;
bool data_ready;
struct hid_sensor_hub_attribute_info poll;
struct hid_sensor_hub_attribute_info report_state;
struct hid_sensor_hub_attribute_info power_state;
struct hid_sensor_hub_attribute_info sensitivity;
};

/*Convert from hid unit expo to regular exponent*/
static inline int hid_sensor_convert_exponent(int unit_expo)
{
if (unit_expo < 0x08)
return unit_expo;
else if (unit_expo <= 0x0f)
return -(0x0f-unit_expo+1);
else
return 0;
}

int hid_sensor_parse_common_attributes(struct hid_sensor_hub_device *hsdev,
u32 usage_id,
struct hid_sensor_iio_common *st);
int hid_sensor_write_raw_hyst_value(struct hid_sensor_iio_common *st,
int val1, int val2);
int hid_sensor_read_raw_hyst_value(struct hid_sensor_iio_common *st,
int *val1, int *val2);
int hid_sensor_write_samp_freq_value(struct hid_sensor_iio_common *st,
int val1, int val2);
int hid_sensor_read_samp_freq_value(struct hid_sensor_iio_common *st,
int *val1, int *val2);

#endif

0 comments on commit 80de747

Please sign in to comment.