linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Holler <holler@ahsoftware.de>
To: linux-kernel@vger.kernel.org
Cc: linux-iio@vger.kernel.org, Jonathan Cameron <jic23@cam.ac.uk>,
	Lars-Peter Clausen <lars@metafoo.de>,
	rtc-linux@googlegroups.com,
	Alessandro Zummo <a.zummo@towertech.it>,
	srinivas pandruvada <srinivas.pandruvada@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jiri Kosina <jkosina@suse.cz>,
	Alexander Holler <holler@ahsoftware.de>
Subject: [PATCH 2/4 RESEND] iio: merge hid-sensor-attributes.h into hid-sensor-hub.h
Date: Sat, 15 Dec 2012 13:45:35 +0100	[thread overview]
Message-ID: <1355575537-10093-2-git-send-email-holler@ahsoftware.de> (raw)
In-Reply-To: <1355575537-10093-1-git-send-email-holler@ahsoftware.de>

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>
---
 drivers/iio/accel/hid-sensor-accel-3d.c            |    1 -
 .../iio/common/hid-sensors/hid-sensor-attributes.c |    1 -
 .../iio/common/hid-sensors/hid-sensor-attributes.h |   57 --------------------
 .../iio/common/hid-sensors/hid-sensor-trigger.c    |    1 -
 drivers/iio/gyro/hid-sensor-gyro-3d.c              |    1 -
 drivers/iio/light/hid-sensor-als.c                 |    1 -
 drivers/iio/magnetometer/hid-sensor-magn-3d.c      |    1 -
 include/linux/hid-sensor-hub.h                     |   38 +++++++++++++
 8 files changed, 38 insertions(+), 63 deletions(-)
 delete mode 100644 drivers/iio/common/hid-sensors/hid-sensor-attributes.h

diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b/drivers/iio/accel/hid-sensor-accel-3d.c
index 314a405..72371aa 100644
--- a/drivers/iio/accel/hid-sensor-accel-3d.c
+++ b/drivers/iio/accel/hid-sensor-accel-3d.c
@@ -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*/
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
index 7537495..5873f16 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
@@ -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
index a4676a0..0000000
--- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.h
+++ /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
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
index d4b790d..b097b68 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
@@ -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,
diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c
index 4c56ada..b98cd70 100644
--- a/drivers/iio/gyro/hid-sensor-gyro-3d.c
+++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c
@@ -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*/
diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
index 96e3691..9610989 100644
--- a/drivers/iio/light/hid-sensor-als.c
+++ b/drivers/iio/light/hid-sensor-als.c
@@ -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*/
diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
index c4f0d27..4957430 100644
--- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c
+++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
@@ -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*/
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h
index 0aa5f4c..e6265f9 100644
--- a/include/linux/hid-sensor-hub.h
+++ b/include/linux/hid-sensor-hub.h
@@ -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
-- 
1.7.8.6


  reply	other threads:[~2012-12-15 12:46 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-09 12:21 [PATCH 0/3] iio: HID sensor time (as RTC) Alexander Holler
2012-12-09 12:21 ` [PATCH 1/3] iio: hid-sensors: respect CONFIG_IIO_TRIGGER Alexander Holler
2012-12-09 12:21 ` [PATCH 2/3] iio: Add Usage IDs for HID time sensors Alexander Holler
2012-12-09 12:21 ` [PATCH 3/3] iio: add rtc-driver for HID sensors of type time Alexander Holler
2012-12-09 12:55   ` Lars-Peter Clausen
2012-12-09 16:40     ` Alexander Holler
2012-12-09 18:16       ` Alexander Holler
2012-12-09 19:20         ` Lars-Peter Clausen
2012-12-10 13:12           ` Alexander Holler
2012-12-10 14:51             ` [PATCH 3/3 v2] " Alexander Holler
2012-12-10 17:05               ` Lars-Peter Clausen
2012-12-10 19:45                 ` Alexander Holler
2012-12-10 20:22                   ` Lars-Peter Clausen
2012-12-10 21:26                     ` Alexander Holler
2012-12-10 21:39                       ` Lars-Peter Clausen
2012-12-10 21:42                         ` Jonathan Cameron
2012-12-10 22:50                           ` Alexander Holler
2012-12-11  9:31                             ` Jonathan Cameron
2012-12-11  9:40                               ` Lars-Peter Clausen
2012-12-11 12:39                                 ` Alexander Holler
2012-12-11 13:54                                   ` Jonathan Cameron
2012-12-11 18:21                                     ` [PATCH 1/4 v2] iio: hid-sensors: respect CONFIG_IIO_TRIGGER Alexander Holler
2012-12-11 18:21                                       ` [PATCH 2/4 RESEND] iio: Add Usage IDs for HID time sensors Alexander Holler
2012-12-15 11:06                                         ` Jonathan Cameron
2012-12-15 12:41                                           ` Alexander Holler
2012-12-15 12:45                                             ` [PATCH 1/4 " Alexander Holler
2012-12-15 12:45                                               ` Alexander Holler [this message]
2013-01-03  9:41                                                 ` [PATCH 2/4 RESEND] iio: merge hid-sensor-attributes.h into hid-sensor-hub.h Jiri Kosina
2013-01-06 11:50                                                   ` Jonathan Cameron
2012-12-15 12:45                                               ` [PATCH 3/4 v5 RESEND] rtc: add rtc-driver for HID sensors of type time Alexander Holler
2013-01-03 22:39                                                 ` Andrew Morton
2013-01-04  9:18                                                   ` Jiri Kosina
2013-01-04 13:10                                                     ` Alexander Holler
2013-01-06 11:50                                                       ` Jonathan Cameron
2012-12-15 12:45                                               ` [PATCH 4/4 RESEND] hid: iio: rename struct hid_sensor_iio_common to hid_sensor_common Alexander Holler
2013-01-03  9:42                                                 ` Jiri Kosina
2013-01-06 11:50                                                   ` Jonathan Cameron
2013-01-03  9:40                                               ` [PATCH 1/4 RESEND] iio: Add Usage IDs for HID time sensors Jiri Kosina
2013-01-06 11:51                                                 ` Jonathan Cameron
2012-12-11 18:21                                       ` [PATCH 3/4] iio: merge hid-sensor-attributes.h into hid-sensor-hub.h Alexander Holler
2012-12-12 15:45                                         ` Pandruvada, Srinivas
2012-12-12 20:10                                           ` Alexander Holler
2012-12-12 20:28                                             ` [PATCHi 5/4] hid: iio: rename struct hid_sensor_iio_common to hid_sensor_common Alexander Holler
2012-12-12 21:04                                               ` Pandruvada, Srinivas
2012-12-11 18:21                                       ` [PATCH 4/4 v3] rtc: add rtc-driver for HID sensors of type time Alexander Holler
2012-12-12  9:51                                         ` Lars-Peter Clausen
2012-12-12 10:14                                           ` Alexander Holler
2012-12-12 10:18                                             ` Lars-Peter Clausen
2012-12-12 11:11                                             ` [PATCH 4/4 v4] " Alexander Holler
2012-12-14  9:42                                               ` Lars-Peter Clausen
2012-12-14 13:08                                                 ` Alexander Holler
2012-12-14 14:15                                                   ` Alexander Holler
2012-12-14 14:29                                                     ` Alexander Holler
2012-12-14 14:34                                                       ` Lars-Peter Clausen
2012-12-14 15:24                                                         ` Alexander Holler
2012-12-14 16:33                                                           ` Lars-Peter Clausen
2012-12-14 21:24                                                             ` Alexander Holler
2012-12-14 22:02                                                               ` [PATCH 4/4 v5] " Alexander Holler
2012-12-15 10:54                                       ` [PATCH 1/4 v2] iio: hid-sensors: respect CONFIG_IIO_TRIGGER Jonathan Cameron
2012-12-15 12:37                                         ` Alexander Holler
2012-12-16 22:15                                 ` [PATCH 3/3 v2] iio: add rtc-driver for HID sensors of type time Alessandro Zummo
2012-12-17  7:38                                   ` Alexander Holler
2012-12-10 22:20                 ` Alexander Holler
2012-12-10 22:36                   ` Lars-Peter Clausen
2012-12-11  0:01                     ` Alexander Holler
2012-12-11 10:35                       ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1355575537-10093-2-git-send-email-holler@ahsoftware.de \
    --to=holler@ahsoftware.de \
    --cc=a.zummo@towertech.it \
    --cc=akpm@linux-foundation.org \
    --cc=jic23@cam.ac.uk \
    --cc=jkosina@suse.cz \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    --cc=srinivas.pandruvada@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).