Commit Graph

86 Commits

Author SHA1 Message Date
Jonathan Cameron 48f27194a3 staging:iio:adis16209 replace unnecessary event line registration.
Untested but identical in form to those that have been.

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>
2011-04-25 17:24:34 -07:00
Jonathan Cameron bdd560c52b staging:iio:adis16240 replace unnecessary event line registration.
Untested but identical in form to those that have been.

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>
2011-04-25 17:24:34 -07:00
Jonathan Cameron 80782446bc staging:iio:adis16201 replace unnecessary event line registration.
Untested but identical in form to those that have been.

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>
2011-04-25 17:24:33 -07:00
Jonathan Cameron 37f9d2714a staging:iio:adis16204 replace unnecessary event line registration.
Whilst the adis16204 does indeed support events, currently the driver
does not.  The trigger code should never use that infrastructure.

Untested but identical in form to those that have been.

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>
2011-04-25 17:24:33 -07:00
Jonathan Cameron 9e558ff544 staging:iio:adis16203 replace unnecessary event line registration.
Whilst the adis16203 does indeed support events, currently the driver
does not.  The trigger code should never use that infrastructure.

Untested, but identical in form to those that have been so should be fine.

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>
2011-04-25 17:24:33 -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
Jonathan Cameron b428173316 staging:iio: replace rip_lots naming with read_first_n
Change suggested by Arnd Bergmann, Related patch to remove
pointless (now) dead_offset parameter will have await
proper fix for the sca3000 driver.  That depends on
some intermediate patches so may be a little while.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 17:23:09 -07:00
Joe Perches 95cd17c9f3 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>
2011-04-25 16:58:35 -07:00
Lucas De Marchi 25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03:00
Jonathan Cameron b949793b2c staging:iio:lis3l02dq allow buffer implementation selection
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-18 13:22:51 -08:00
Greg Kroah-Hartman ea3398a1ae Staging: Merge 2.6.37-rc5 into staging-next
This was done to handle a number of conflicts in the batman-adv
and winbond drivers properly.  It also now allows us to fix up the sysfs
attributes properly that were not in the .37 release due to them being
only in this tree at the time.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-07 10:47:56 -08:00
Greg Kroah-Hartman c9e51d9e4b Staging: iio: adis16220: fix up my fixup for some sysfs attribute permissions
They should be writable by root, not readable.
Doh, stupid me with the wrong flags.

Reported-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Cc: Barry Song <Barry.Song@analog.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-18 11:27:19 -08:00
Joe Perches 859171ca92 drivers/staging: Remove unnecessary semicolons
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 12:06:47 -08:00
Greg Kroah-Hartman 1d904e8950 Staging: iio: adis16220: fix up some sysfs attribute permissions
They should not be writable by any user

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jonathan Cameron <jic23@cam.ac.uk>
Cc: Barry Song <Barry.Song@analog.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 11:19:53 -08:00
Barry Song e1ffd62b8f staging: iio: adis16209: tuning spi delay to make hardware more stable
Looks like one spot was missed in the previous spi tune patch.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09 15:46:46 -08:00
Barry Song bb6f19eafe staging: iio: new adis16204 driver
IIO driver for Programmable High-g Digital Impact Sensor and Recorder.

Signed-off-by: Barry Song <barry.song@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>
2010-11-09 15:46:33 -08:00
Barry Song f11ba4f577 staging: iio: new adis16203 driver
IIO driver for Programmable 360 Degrees Inclinometer adis16203 parts.

Signed-off-by: Barry Song <barry.song@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>
2010-11-09 15:46:33 -08:00
Barry Song f7fe1d1dd5 staging: iio: new adis16201 driver
IIO driver for dual Axis Accelerometer/inclinometer adis16201 parts.

Signed-off-by: Barry Song <barry.song@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>
2010-11-09 15:46:33 -08:00
Jonathan Cameron 1755b0ae17 staging: iio: adc add numbers to naming of all adc channels as needed to associate events with them.
Given event codes are associated by number not name, all adc channels
including those with names need to have numbers.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:17:56 -07:00
Jonathan Cameron d750e375c1 staging: iio: accel remove deprecated and misleading event macros.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:17:55 -07:00
Jonathan Cameron fc5d0e4254 staging: iio: sca3000 event attribute name updates
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:17:54 -07:00
Jonathan Cameron c33680c483 staging: iio: lis3l02dq event attribute renames
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:17:54 -07:00
Jonathan Cameron deb02fc574 staging: iio: accel remove old event codes
Signed-off-by: Joanthan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:17:52 -07:00
Jonathan Cameron de9fe32afc staging: iio: sca3000 move to new event code scheme and add combined orientations
The combined orientations allow handling of typical motion and free fall
detectors to be handled as threshold events just applied to a number of
axes via boolean operations.  So freefall is when x, y and z magnitudes
are all below a threshold for a particular period.  Motion detectors
are typically whether x or y or z are above a particular value.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:17:52 -07:00
Jonathan Cameron 18e69a9904 staging: iio: lis3l02dq move to new event code scheme
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:17:52 -07:00
Jonathan Cameron 7aa3baeb97 staging: iio: sca3000 fix bug due to scan_element directory move.
The device found passed to the attr functions is that of the ring
buffer, not the the iio_dev so we need to bounce through one more
hop to get the right address.

Reported-by: Michael Hennerich <michael.hennerich@analog.com>
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>
2010-10-07 10:06:44 -07:00
Jonathan Cameron d16061bb67 staging: iio: sca3000 add _index attribute registration
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:43 -07:00
Jonathan Cameron 6d2174f438 staging: iio: adis16240 add _index attribute registration
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:42 -07:00
Jonathan Cameron 49624fa833 staging: iio: adis16209 add _index attribute registration
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:42 -07:00
Jonathan Cameron 13a091abb7 staging: iio: lis3l02dq add _index attribute registration
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:42 -07:00
Jonathan Cameron 44f270de71 staging: iio: Remove unused bit_count from struct iio_scan_el
The job this was intended to do (never implemented) is now done
by explicit definition of _type attributes in all drivers

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:41 -07:00
Jonathan Cameron ef26b83090 staging: iio: sca3000 add _type attributes for all scan elements
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:40 -07:00
Jonathan Cameron be3ebd1f16 staging: iio: adis16240 add _type attributes for all scan elements
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:40 -07:00
Jonathan Cameron 6a4429c85e staging: iio: adis16209 add _type attributes for all scan elements
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:40 -07:00
Jonathan Cameron 6a36e618b4 staging: iio: lis3l02dq add _type attributes for all scan elements
Also, adds a macro to make defining such attributes simple.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:39 -07:00
Manuel Stahl 6267ea655f staging: iio: sca3000 convert byte order of ring buffer data
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-14 16:37:58 -07:00
Manuel Stahl b68d58a84b staging: iio: sca3000 fix sca3000_[show,store]_ring_bpse
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-14 16:37:58 -07:00
Uwe Kleine-König 6cd5a9a35c staging/trivial: fix typos concerning "access"
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-04 21:23:25 -07:00
Jonathan Cameron 9dbfb6f14a staging: iio: Make use of the convenient IIO_TRIGGER_NAME_ATTR macro
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-04 21:19:01 -07:00
Jonathan Cameron 2d7770a942 staging: iio: Remove deprecated ATTR_TEMP in favour of ATTR_TEMP_RAW
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-04 21:19:00 -07:00
Manuel Stahl 4f64b80144 staging: iio sync scale units
g     -> ms/s^2
deg   -> rad
deg/s -> rad/s
some temperatures still broken

Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:42:03 -07:00
Manuel Stahl 51a0a5b021 staging: iio sync drivers with current ABI
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:42:02 -07:00
Manuel Stahl bf32963cbe staging: iio move scan_elements into ring buffer
tested with sca3000, adis16400

Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:42:02 -07:00
Manuel Stahl 07e6229e42 staging: iio: lis3l02dq adjust lis3l02dq_configure_ring
Now fits other driver's structure for easier modification.

Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:42:01 -07:00
Manuel Stahl ffcab07a74 staging: iio rename ring attributes
bps -> bytes_per_datum
ring_enable -> enable

Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:42:01 -07:00
Jonathan Cameron b98c9e60a4 staging: iio: lis3l02dq add a thresh_timestamp field to state for no ring case
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-02 17:06:03 -07:00
Jonathan Cameron 73bce12e44 staging: iio: lis3l02dq: use iio_sw_ring_helper_state and funcs
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 11:38:29 -07:00
Jonathan Cameron 43c11b4373 staging: iio: Make extensive use of iio_sw_ring_preenable
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 11:38:29 -07:00
Jonathan Cameron 69584bd6d2 staging: iio: Fix scan_element naming issue
The addition of a number to the scan_element names caused
an issue in drivers that used either #define or an enum
to provide the number. Before this fix names like
ADIS16350_ACCEL_X_accel_x_en occur rather than 5_accel_x_en.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 11:38:29 -07:00
Jonathan Cameron 2662051e08 staging: iio: Add stubs for iio_ring_buffer_[un]register and equivalent driver stubs
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 11:38:28 -07:00