History log of /drivers/staging/iio/addac/adt7316.c
Revision Date Author Comments
aa27f0ba0fac819083c505c85021dc19d2b53083 30-Sep-2014 Gulsah Kose <gulsah.1004@gmail.com> staging: iio: addac: Combined seperated strings.

This patch fixes "quoted string split across lines" checkpatch.pl
warning in adt7316.c

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15c643661bf65176efd8349f0ad2bf096b915da1 29-Sep-2014 Roxana Blaj <roxanagabriela10@gmail.com> staging: iio: addac: remove unnecessary else

This fixes the checkpatch.pl warning:
WARNING: else is not generally useful after a break or return

Signed-off-by: Roxana Blaj <roxanagabriela10@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
e3c5be2bdae553ddefacc636496f2df21aee31ee 22-Apr-2014 Masanari Iida <standby24x7@gmail.com> staging: iio: Fix typo in iio

Correct spelling typo in comment within staging/iio

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
6db685c35e89cc9b639185349498690ce9157e55 17-Mar-2014 Aybuke Ozdemir <aybuke.147@gmail.com> staging: addac: adt7316.c: Fix line over 80 characters

Fix checkpatch.pl issues with line over 80 characters in adt7316.c

Signed-off-by: Aybuke Ozdemir <aybuke.147@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
334696bd603619bc001eb022e60c120fc8223ecb 29-Oct-2013 Sachin Kamat <sachin.kamat@linaro.org> staging: iio: addac: Use devm_iio_device_register

devm_iio_device_register simplifies the code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
e5e26dd5bb740c34c975e2ae059126ba3486a1ce 20-Aug-2013 Jingoo Han <jg1.han@samsung.com> staging: iio: replace strict_strto*() with kstrto*()

The usage of strict_strto*() is not preferred, because
strict_strto*() is obsolete. Thus, kstrto*() should be
used.

Previously, there were only strict_strtol(), strict_strtoul(),
strict_strtoull(), and strict_strtoll(). Thus, when converting
to the variables, only long, unsigned long, unsigned long long,
and long long can be used.

However, kstrto*() provides various functions handling all types
of variables. Therefore, the types of variables can be changed
properly.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7af9648fbc024a2e7ac1094fbdbc23229e189190 31-Aug-2013 Sachin Kamat <sachin.kamat@linaro.org> staging: iio: adt7316: Use devm_* APIs

devm_* APIs are device managed and make code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
aae6e9eb9560dc5c80add68450a4319f9ff44f13 16-Jul-2013 Lars-Peter Clausen <lars@metafoo.de> staging:iio:adt7316: Don't expose the chip reset to userspace

There is no reason why userspace should want to trigger a manual reset of the
device, so remove this functionality.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9f16778c5d0a32f264812a9bf1602b71613720b8 04-Apr-2013 Luck, Tony <tony.luck@intel.com> staging:iio:adt7316 Fix some 'interesting' string operations

Calling memcmp() to check the value of the first byte in a string is overkill.
Just use buf[0] == '1' or buf[0] != '1' as appropriate.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
447d4f29ee3fa62f13c65688bb7b74d5a9a0d767 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu> staging: iio: remove use of __devexit

CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4ae1c61ff2ba4fea4e4c1a045cb1f34520608789 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu> staging: iio: remove use of __devinit

CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
703196b6bef2f4750f2deef85cbc64c06cb431f0 12-May-2012 Lars-Peter Clausen <lars@metafoo.de> staging:iio:addac: Use dev_to_iio_dev()

Replace open-coded instances of getting a iio_dev struct from a device struct
with dev_to_iio_dev().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7cbb753701d11f3c71e8543e1ae0fc0772edac06 26-Apr-2012 Lars-Peter Clausen <lars@metafoo.de> staging:iio: Streamline API function naming

Currently we use two different naming schemes in the IIO API, iio_verb_object
and iio_object_verb. E.g iio_device_register and iio_allocate_device. This
patches renames instances of the later to the former. The patch also renames allocate to
alloc as this seems to be the preferred form throughout the kernel.

In particular the following renames are performed by the patch:
iio_put_device -> iio_device_put
iio_allocate_device -> iio_device_alloc
iio_free_device -> iio_device_free
iio_get_trigger -> iio_trigger_get
iio_put_trigger -> iio_trigger_put
iio_allocate_trigger -> iio_trigger_alloc
iio_free_trigger -> iio_trigger_free

The conversion was done with the following coccinelle patch with manual fixes to
comments and documentation.

<smpl>
@@
@@
-iio_put_device
+iio_device_put
@@
@@
-iio_allocate_device
+iio_device_alloc
@@
@@
-iio_free_device
+iio_device_free
@@
@@
-iio_get_trigger
+iio_trigger_get
@@
@@
-iio_put_trigger
+iio_trigger_put
@@
@@
-iio_allocate_trigger
+iio_trigger_alloc
@@
@@
-iio_free_trigger
+iio_trigger_free
</smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
06458e277eac2b8761b0a04d3c808d57be281a2e 25-Apr-2012 Jonathan Cameron <jic23@kernel.org> IIO: Move core headers to include/linux/iio

Step 1 in moving the IIO core out of staging.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
01788c533acbd63702146a2be975ae4007cfb2cf 20-Feb-2012 Lars-Peter Clausen <lars@metafoo.de> staging:iio: Use dev_pm_ops

Use dev_pm_ops instead of legacy suspend/resume callbacks for IIO drivers.

Note that this patch introduces a few new #ifdef CONFIG_PM_SLEEP around the
suspend and resume callbacks to avoid warnings of unused functions if
CONFIG_PM_SLEEP is not defined.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
af5046af1c812839f085030f358a01814666fc80 26-Oct-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio: header reorganization

Issue brought up by Lars-Peter Clausen. This is a varient of what
he suggested.

io/iio.h for driver stuff (has to include types.h)
Sub files for the bits drivers may or may not use
iio/sysfs.h
iio/buffer.h (contents of current buffer_generic.h)
(obviously anything offering events will need events.h as well)
iio/types.h for the enums that matter to both
iio_chan_type, iio_modifier
iio/events.h for the event code stuff
IIO_EVENT_CODE and friends. + everything in chrdev.h So this
is the stuff that userspace cares about.
Also include iio_event_type, iio_event_direction

Thus iio drivers include iio.h + as required
events.h
sysfs.h
buffer.h

in kernel users (once that interface is merged) will need inkern.h
which will pull in types.h

Userspace will need just events.h (which pulls in types.h) to get
everything they need to know about. Buffer userspace access doesn't
currently need any core defines. All information about the data
format is passed through sysfs.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
d2fffd6c2fd60fe9ab63ef30758d9d43a5057549 14-Oct-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio: fix removal path to allow correct freeing.

Fix a dumb lack of consideration of the effect of combining
the iio_device_unregister and iio_free_device calls into
one. There is no valid place to free some of the sysfs
array elements.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6835cb6b438b77ba82ad5a23944bbfb12128f5db 27-Sep-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio: unwind the IIO_IN -> IIO_VOLTAGE define

This was originally there to avoid churn during a complex change.
Now everything is stable lets get rid of this as it is missleading
and confusing.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
26d25ae3f0d8ffe350aacc75b71198d6b35bd1f4 02-Sep-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio: rework of attribute registration.

This set also includes quite a number of bug fixes of particularly
remove functions.

Necessary due to issue pointed out in Bart Van Assche's patch:
docs/driver-model: Document device.groups

V2: Rebase due to patch reordering.
V3: Pull various error fixes and cleanups out into their own patches.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <Michael.Hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
3e39440789adef103422ce201538b4da8745fe8e 30-Aug-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio:fix using iio_priv or iio_dev after iio_unregister_device

This includes calling iio_free_device as that should only be called
before the device has been registered.

Also one case of iio_free_device being called on a registered device.

This has been pulled out of the reworking attributes patch.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
5aa9618896e0ba49b444731f9fafa7f7c18a13ab 30-Aug-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio: remove broken support for multiple event interfaces.

We don't have a use case for these. Two drivers appeared to use them
but both report all events on the first.

V2: Remove now irrelevant comment.
V3: Include fixup for adc/ad7280a.c

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
8e7d967244a8eebcdadb048efc5e66849ec0a6b6 30-Aug-2011 Jonathan Cameron <jic23@cam.ac.uk> staging: iio: remove specific chrdev for event reading. Get fd from ioctl on buffer.

Change suggested by Arnd Bergmann.

No real reason to have two chrdevs per device. This step merges them into one.
Currently this means that events will only work on devices with buffers. THat will
be remedied shortly.

V2: set name for event attribute groups. Otherwise they all sorts of fun occurs on
dynamic channel event attribute creation.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
99c978529a40132a6f7a5f136b4362b56fc88d8c 03-Jul-2011 Paul Gortmaker <paul.gortmaker@windriver.com> staging: Add module.h to drivers/staging users

Lots of people expect module.h to just "be there" without
any #include effort. But we are crushing that. So fix those
files in staging relying on implicit module.h presence.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
8df322385a7e253672dc5077c11dc1a6219d25cc 12-Aug-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio:addac:adt7316 make interrupt mask sane.

Coccinelle found this one. I'm not certain what
the intent is, but this fix makes no functional changes.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
70be42919a876af79187ce5385914597988583f9 27-Jun-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio:addac:adt7316: allocate chip state with iio_dev and use iio_priv to access.

Various minor cleanups needed to deal with removal of iio_dev pointer from chip state.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6fe8135fccd66aedcc55ded70824342587fd2499 18-May-2011 Jonathan Cameron <jic23@cam.ac.uk> 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>
383f650f6cf739b256eb24c4a1d397d883de56ff 18-May-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio:addac:adt7316 replace abuse of buffer events.

Currently squashed the fault condition from external
temperature sensor - lots of other issues to be fixed
with this driver which obeys almost no elements of the
abi.

V2: removed a couple of usused variables that sparse found.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
845bd12ac78f92ba8905f45de7e17a4a8b3cef40 18-May-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio: use the new central name attribute creation code

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
90f79e76871b570480d87ac15603aa2685008f78 18-May-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio:adt7316 get rid of legacy event handling code.

Note this driver is still a long way from being abi compliant.
What I have done here cleans up a few corners, but primarily gets
it away from using the infrastructure that is going away.

Untested

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6f7c8ee585e9db54cb29af1bdb93f29837824933 15-Apr-2011 Jonathan Cameron <jic23@cam.ac.uk> 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>
95cd17c9f3734091a5811fabbd778e3f7b1f0789 10-Apr-2011 Joe Perches <joe@perches.com> staging: Remove unnecessary semicolons when switch (foo) {...};

Done via perl script:

$ cat remove_semi_switch.pl
my $match_balanced_parentheses = qr/(\((?:[^\(\)]++|(?-1))*\))/;
my $match_balanced_braces = qr/(\{(?:[^\{\}]++|(?-1))*\})/;

foreach my $file (@ARGV) {
my $f;
my $text;
my $oldtext;

next if ((-d $file));

open($f, '<', $file)
or die "$P: Can't open $file for read\n";
$oldtext = do { local($/) ; <$f> };
close($f);

next if ($oldtext eq "");

$text = $oldtext;

my $count = 0;
do {
$count = 0;
$count += $text =~ s@\b(switch\s*${match_balanced_parentheses}\s*)${match_balanced_braces}\s*;@"$1$3"@egx;
} while ($count > 0);

if ($text ne $oldtext) {
my $newfile = $file;

open($f, '>', $newfile)
or die "$P: Can't open $newfile for write\n";
print $f $text;
close($f);
}
}

$

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
35f6b6b86ede34a9f8c029943842640b2ffbfa19 28-Oct-2010 Sonic Zhang <sonic.zhang@analog.com> staging: iio: new ADT7316/7/8 and ADT7516/7/9 driver

IIO driver for temperature sensor, ADC and DAC devices over SPI and I2C.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>