]> Pileus Git - ~andy/linux/commitdiff
iio: merge hid-sensor-attributes.h into hid-sensor-hub.h
authorAlexander Holler <holler@ahsoftware.de>
Sat, 15 Dec 2012 12:45:00 +0000 (12:45 +0000)
committerJonathan Cameron <jic23@kernel.org>
Sun, 6 Jan 2013 11:43:37 +0000 (11:43 +0000)
The stuff in hid-sensor-attributes.h is needed by every piece which
uses hid-sensor-hub and merging it into hid-sensor-hub.h makes it accessible
from outside the iio subdirectory.

Signed-off-by: Alexander Holler <holler@ahsoftware.de>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/accel/hid-sensor-accel-3d.c
drivers/iio/common/hid-sensors/hid-sensor-attributes.c
drivers/iio/common/hid-sensors/hid-sensor-attributes.h [deleted file]
drivers/iio/common/hid-sensors/hid-sensor-trigger.c
drivers/iio/gyro/hid-sensor-gyro-3d.c
drivers/iio/light/hid-sensor-als.c
drivers/iio/magnetometer/hid-sensor-magn-3d.c
include/linux/hid-sensor-hub.h

index e67bb912bd197b90de0cfccfda2a50041325c52f..268ca3a1030e463cf3bba2bf8ee81e009c79c8d5 100644 (file)
@@ -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*/
index 75374955cabae0a1d2bf873b8f69692107f781ed..5873f160bac9a11b61e79cb2b988467a3e9c04e1 100644 (file)
@@ -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)
 {
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.h b/drivers/iio/common/hid-sensors/hid-sensor-attributes.h
deleted file mode 100644 (file)
index a4676a0..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * HID Sensors Driver
- * Copyright (c) 2012, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-#ifndef _HID_SENSORS_ATTRIBUTES_H
-#define _HID_SENSORS_ATTRIBUTES_H
-
-/* 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
index d60198a6ca29a0ee6fa187fb6dbdbb2016df5ca3..7da73800dcddd647a2ec698865227bc63142de34 100644 (file)
@@ -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,
index 4c8b158e40e18d508d4dfd53d7108249e2f2a455..8d34ee4f33b15b6b6aa75891a96336d6f3395e61 100644 (file)
@@ -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*/
index 23eeeef64e84b93e656ccb07a21dfd57c90a8190..723f203269f25001bd56330b4a23abfe341f16f8 100644 (file)
@@ -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*/
index 8e75eb76ccd992729785c340e7eaea801026ec89..7811c0bdc95e1c1f9c604cf2f58c7ed46641653e 100644 (file)
@@ -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*/
index 0aa5f4c42ae6af5c7b26b7fc4f8f6cee9af72c63..e6265f94d81658061d74dc306198d7b9ded9ca7a 100644 (file)
@@ -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