Commit Graph

16 Commits

Author SHA1 Message Date
Jonathan Cameron 765f88f2ea staging:iio:magnetometer: remove unused header magnet.h
Now all magnetomers are using iio_chan_spec there is no need for
the macros in magnet.h

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 13:34:23 -07:00
Jonathan Cameron 694e1b5f95 staging:iio:magnetometer:ak8975 convert to iio_chan_spec + cleanups.
iio_chan_spec conversion is straight forward.

Other changes:
* use i2c_smbus_write_byte_data in write_data
* c99 isms to setup various structures.
* move the comment about the scale factor and kill off trivial access func.
* make mode setting code use a bool rather than a ulong.

Ultimately I'd like to get rid of that mode bit entirely and handle it through
core pm routines, but have left it for now.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 13:32:49 -07:00
Jonathan Cameron 494c6b150a staging:iio:magnetometer:hmc5843 iio_chan_spec conversion.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 13:32:48 -07:00
Jonathan Cameron 88fa4de48e staging:iio:magnetometer:hmc5843: allocate device state with iio_dev.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:39:51 -07:00
Jonathan Cameron 338473c819 staging:iio:magnetometer:ak8975: allocate chip state with iio_dev.
Here the ordering is a little tricky, so to keep changes minimal, a copy of the gpio
number is introduced.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:39:51 -07:00
Jonathan Cameron 6fe8135fcc staging:iio: implement an iio_info structure to take some of the constant elements out of iio_dev.
This was suggested by Arnd Bergmann,  Other elements may well
move in here in future, but it definitely makes sense for these.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:15:05 -07:00
Jonathan Cameron 6f7c8ee585 staging:iio: Add ability to allocate private data space to iio_allocate_device
Suggested by Arnd Bergmann.  Note this will break ALL drivers that
are out of mainline.  The fix is trivial change of
iio_allocate_device() -> iio_allocate_device(0)
Sorry if this causes issues for any one!

V2: Include new drivers in the update

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 17:23:09 -07:00
Alan Cox 01fbb4781f Staging: iio: oaktrail AK8975 support via IIO
Actually this is generic 'I have no GPIO' support for the AK8975, instead
we have to go bus polling.

Huang Liang produced an initial patch which worked by removing the support
for GPIO pins. This patch instead makes GPIO support optional and Huang then
fixed some bugs in it.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-20 14:18:55 -07:00
Andrew Chew 3285aae1ed staging: iio: ak8975: Add ak8975 magnetometer sensor
This is for the Asahi Kasei AK8975 3-axis magnetometer.  It resides within
the magnetometer section of the IIO subsystem, and implements the raw
magn_x,y,z_raw attributes, as well as magn_x,y,z_scale attributes for
converting to Gauss.

Changed to use the magn_x,y,z_scale attributes, and made those attributes
give the scale factor to conert to Gauss.  Also applied more fixes from
feedback.

Keeping mode as an unsigned long.  I'm going to add proper power management
at some point anyway, which would deprecate this attribute.

Signed-off-by: Andrew Chew <achew@nvidia.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-14 16:37:11 -07:00
Andrew Chew 7223234ee0 staging: iio: Change GAIN macros to SCALE.
Per email exchange with Jonathan Cameron, GAIN should instead be SCALE, to
be consistent with documentation.

Resending, since this goes with the 2/2 patch.

Signed-off-by: Andrew Chew <achew@nvidia.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-14 16:37:10 -07:00
Manuel Stahl 11f05c7715 staging: iio: hmc5843 change ABI to comply with documentation
this one completes my last patch set to compile fine for all drivers.

Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Datta, Shubhrajyoti <shubhrajyoti@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:42:48 -07:00
Dan Carpenter 213fd22704 Staging: iio: signedness bug
i2c_smbus_read_byte_data() returns an s32 type.  We need to change
"rate" to signed for the error handling to work.

Also I changed it to propogate the error code instead of just returning
-EINVAL.  Other error codes could be -EAGAIN for example.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:40:35 -07:00
Julia Lawall d1ae4da731 drivers/staging/iio: call mutex_unlock in error handling code
Adjust the error handling code so that it benefits from the call to
mutex_unlock at the end of the function.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@rcu exists@
position p1;
expression E;
@@

mutex_lock@p1(E);
...
mutex_unlock(E);

@exists@
position rcu.p1;
expression E;
@@

*mutex_lock@p1(E);
... when != mutex_unlock(E);
?*return ...;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:40:35 -07:00
Shubhrajyoti D b4e178224c Staging: iio: add digital compass hmc5843 driver
Adding support for the Honeywell HMC5843. The interface to the device is
i2c

TODO:
Adding the documentation

Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 14:26:57 -07:00
Jonathan Cameron a1169c5a0b staging: iio: Break up gyro.h and move to new abi
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 14:33:24 -07:00
Barry Song a9d26f00b8 staging:iio:imu ADIS16400 and ADIS16405 driver
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Barry Song <Barry.Song@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:36:06 -07:00