Skip to contentSkip to conversation

IIO: Another set of buglets plus cleanups.

PATCH New Jonathan Cameron 1 participant 5 messages Apr 13, 2012

Subsystems (3)
lore
Share & tools
lore

Jonathan Cameron

author maintainer
#0 lore raw

cover IIO: Another set of buglets plus cleanups.

Hi Greg,

A fairly trivial set that no one has reported any problems with.

Only difference in here from version sent to list was an accidentally included binary file pointed out by Maxime Ripard.

Thanks,

Jonathan

Jonathan Cameron (4):
staging:iio:light:tsl2563 channel spec buglet / always reading same
adc.
staging:iio:Documentation: Fix a cut and paste error. staging:iio:iio_core.h make less dependent on other included headers staging:iio: chan_spec - take extend_name constant.

 drivers/staging/iio/Documentation/sysfs-bus-iio |    8 ++++----
 drivers/staging/iio/iio.h                       |    2 +-
 drivers/staging/iio/iio_core.h                  |    6 ++++++
 drivers/staging/iio/light/tsl2563.c             |    3 ++-
 4 files changed, 13 insertions(+), 6 deletions(-)
author maintainer
#1 lore raw

PATCH 1/4 staging:iio:light:tsl2563 channel spec buglet / always reading same adc.

The IIO_LIGHT channel was not marked as being a processed_val despite clearly being in lux.

The IIO_INTENSITY channel reads were dependent on channel and that isn't specified for either adc (as they now use modifiers). Hence use the modifier instead.

---
 drivers/staging/iio/light/tsl2563.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/staging/iio/light/tsl2563.c +2 -1
index 546c95a..beb51d7 100644
@@ -465,7 +465,7 @@ static int tsl2563_write_raw(struct iio_dev *indio_dev,
 {
 	struct tsl2563_chip *chip = iio_priv(indio_dev);
 
-	if (chan->channel == 0)
+	if (chan->channel == IIO_MOD_LIGHT_BOTH)
 		chip->calib0 = calib_from_sysfs(val);
 	else
 		chip->calib1 = calib_from_sysfs(val);
@@ -534,6 +534,7 @@ static const struct iio_chan_spec tsl2563_channels[] = {
 	{
 		.type = IIO_LIGHT,
 		.indexed = 1,
+		.processed_val = 1,
 		.channel = 0,
 	}, {
 		.type = IIO_INTENSITY,
Signature · 1 line
1.7.0.4
author maintainer
#2 lore raw

PATCH 2/4 staging:iio:Documentation: Fix a cut and paste error.

In reply to Jonathan Cameron

falling is repeated in some entries instead of 1x falling and 1x rising for the entry.

---
 drivers/staging/iio/Documentation/sysfs-bus-iio |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/iio/Documentation/sysfs-bus-iio +4 -4
index 46a995d..ca12784 100644
@@ -453,9 +453,9 @@ What:		/sys/.../events/in_magn_z_raw_thresh_rising_value
 What:		/sys/.../events/in_magn_z_raw_thresh_falling_value
 What:		/sys/.../events/in_voltageY_supply_raw_thresh_rising_value
 What:		/sys/.../events/in_voltageY_supply_raw_thresh_falling_value
+What:		/sys/.../events/in_voltageY_raw_thresh_rising_value
 What:		/sys/.../events/in_voltageY_raw_thresh_falling_value
-What:		/sys/.../events/in_voltageY_raw_thresh_falling_value
-What:		/sys/.../events/in_tempY_raw_thresh_falling_value
+What:		/sys/.../events/in_tempY_raw_thresh_rising_value
 What:		/sys/.../events/in_tempY_raw_thresh_falling_value
 KernelVersion:	2.6.37
 Contact:	[email protected]
@@ -490,9 +490,9 @@ What:		/sys/.../events/in_magn_z_raw_roc_rising_value
 What:		/sys/.../events/in_magn_z_raw_roc_falling_value
 What:		/sys/.../events/in_voltageY_supply_raw_roc_rising_value
 What:		/sys/.../events/in_voltageY_supply_raw_roc_falling_value
+What:		/sys/.../events/in_voltageY_raw_roc_rising_value
 What:		/sys/.../events/in_voltageY_raw_roc_falling_value
-What:		/sys/.../events/in_voltageY_raw_roc_falling_value
-What:		/sys/.../events/in_tempY_raw_roc_falling_value
+What:		/sys/.../events/in_tempY_raw_roc_rising_value
 What:		/sys/.../events/in_tempY_raw_roc_falling_value
 KernelVersion:	2.6.37
 Contact:	[email protected]
Signature · 1 line
1.7.0.4
author maintainer
#3 lore raw

PATCH 3/4 staging:iio:iio_core.h make less dependent on other included headers

In reply to Jonathan Cameron

There are a lot of pointers to structures used in here that are not declared unless a particular header is included first. Deal with the IIO specific ones by putting in forward declarations and the other ones by including kernel.h and device.h.

---
 drivers/staging/iio/iio_core.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/staging/iio/iio_core.h +6 -0
index c9dfcba..f652e6a 100644
@@ -12,6 +12,12 @@
 
 #ifndef _IIO_CORE_H_
 #define _IIO_CORE_H_
+#include <linux/kernel.h>
+#include <linux/device.h>
+
+struct iio_chan_spec;
+struct iio_dev;
+
 
 int __iio_add_chan_devattr(const char *postfix,
 			   struct iio_chan_spec const *chan,
Signature · 1 line
1.7.0.4
author maintainer
#4 lore raw

PATCH 4/4 staging:iio: chan_spec - take extend_name constant.

In reply to Jonathan Cameron

I can't envision a case where this is not constant and we don't seem to have any in tree, so lets clear up this loose end.

---
 drivers/staging/iio/iio.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/iio/iio.h +1 -1
index 833a849..4824812 100644
@@ -164,7 +164,7 @@ struct iio_chan_spec {
 	long			info_mask;
 	long			event_mask;
 	const struct iio_chan_spec_ext_info *ext_info;
-	char			*extend_name;
+	const char		*extend_name;
 	const char		*datasheet_name;
 	unsigned		processed_val:1;
 	unsigned		modified:1;
Signature · 1 line
1.7.0.4