staging:iio:meter:ade7758: Use iio channel spec and miscellaneous other changes.
Use iio channel spec for the ring buffer channels.
Add/update file comment/license headers.
Use available_scan_masks to prevent that multiple channels are enabled.
Remove wavefrom type attributes. (no handled directly by the scan_elements)
Use SPI_MODE_1.
Move ade7758_initial_setup() before ade7758_probe_trigger() to ensure the ADE7758 interrupt is disabled when the host interrupt get's enabled.
Add spi_device_id.
Update ring buffer setup.
Some backporting needed to ensure driver builds all the way through core
changes.
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
staging:iio:meter:ade7758: Fix timing on SPI read accessor functions.
According to the ADE7758 datasheet the minimum time between read command
(that is, a write to communication register) and data read must not be
less than 4us.
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
staging:iio:adc:ad7606 Convert to new channel registration method Update Add missing call to iio_trigger_notify_done() Set pollfunc top and bottom half handler
V3: rebase fixup.
Backported to relevant merge point by Jonathan Cameron.
V2: IIO_CHAN macro usage update
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Wed, 18 May 2011 13:41:37 +0000 (14:41 +0100)]
staging:iio:adc:ad7298 move to irqchip based trigger handling.
Untested. This one is of a different form, so worth a closer look than
the previous incredibly similar patches (which were based on the
adis16400 that I have tested).
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Wed, 18 May 2011 13:41:28 +0000 (14:41 +0100)]
staging:iio:imu:adis16350 etc support into adis16400 driver.
Next patch will remove the current adis16350 driver.
These should have been merged a long time ago, but there we are.
V3: rebase fixup + add missing extend_name for supply on adis16350
V2: Move to single IIO_CHAN macro + use the new extend_name
to make the naming of the temperature sensors contain x, y, z
rather than messing with modifiers. This a very weird case
and I don't want temperature to use axial modifiers.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Wed, 18 May 2011 13:41:18 +0000 (14:41 +0100)]
staging:iio: Add infrastructure for irq_chip based triggers
V3: Get rid of separate interrupt pool. This is well handled
by irq_get_descs and irq_free_descs. Two functions I simply
wasn't aware of previously. Thus the allocation for a given
trigger is now handled by core code rather than us reinventing
the wheel.
V2: Stop silly name duplication.
Move pool handling to industrialio-trigger as that is the only user.
Changed over to using irq_modify_status rather than the arm
specific set_irq_flags as per Thomas Gleixner's suggestion.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Wed, 18 May 2011 13:41:12 +0000 (14:41 +0100)]
staging:iio:adc:adt7410 move to current event handling
This device actually has a pair of interrupts. The code basically ignores
that and feeds them both to the same handlers. I'm not sure if that is
the right thing to do, but the updated code should do exactly the same.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Wed, 18 May 2011 13:41:07 +0000 (14:41 +0100)]
staging:iio:adc:ad7816 move from old to current event handling.
I'm not sure what the event is and am very much against the dodgy
hack to give it a code. However for now, lets just stop it using
the deprecated core handling so we can move on.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Wed, 18 May 2011 13:41:06 +0000 (14:41 +0100)]
staging:iio:adc:ad7745 move from old to current event handling.
Nice simple one. Not sure we actually want devices outputting
datardy signals like that, but I'll leave it for now.
Cleaned up some unneeded functions whilst here.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Wed, 18 May 2011 13:41:05 +0000 (14:41 +0100)]
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>
Jonathan Cameron [Wed, 18 May 2011 13:41:02 +0000 (14:41 +0100)]
staging:iio:buffering remove unused parameter dead_offset from read_last_n in all buffer implementations.
This element has been usused by the core for quite some time. sca3000 set it none the less
until the rewrite in the previous patch (and hence didn't work).
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Wed, 18 May 2011 13:40:53 +0000 (14:40 +0100)]
staging:iio:max1363 - move to channel_spec registration.
V3: move to single chan registration macro. Also introduce some
local macros to greatly reduce code length when setting up the
chan_spec arrays for all the different devices.
V2: update read_raw for two value approach.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Wed, 18 May 2011 13:40:51 +0000 (14:40 +0100)]
staging:iio: allow channels to be set up using a table of iio_channel_spec structures.
V8: Add missing address in IIO_CHAN macro. Spotted by Michael Hennerich.
V7: Document additions to iio_dev structure.
V6: Fixup the docs for iio_chan_spec structure.
V5: Actually have the macro handle the _input type channels (oops)
V4: Add ability to do, _input and modified channel naming in a coherent fashion.
Scrap all the messy IIO_CHAN_* macros and move to only one.
V3: Added more types - intensity and light.
V2: Various fixes - some thanks to Arnd.
Bug fix for unregistering of event attr group
Changed iio_read_channel_info to have two part value - use for
raw value read as well.
constify the channelspec structures
raw write support for calibbias and similar
Additional strings for buidling attribute names.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
J. Ali Harlow [Wed, 18 May 2011 18:18:56 +0000 (19:18 +0100)]
comedi vmk80xx: support comedi auto-configuration
Add support for automatically associating a vmk8055 device with a
comedi device (previously the user had to use comedi_num_legacy_minors
to reserve device slots and then associate them with vmk8055 devices
using comedi_config).
Tested on multiple K8055s, but not on K8061s.
Signed-off-by: J. Ali Harlow <ali@avrc.city.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
J. Ali Harlow [Wed, 18 May 2011 18:18:55 +0000 (19:18 +0100)]
comedi vmk80xx: support bits instruction
Calling comedi_dio_bifield2() returns EBUSY permanently. Implementing
the insn_bits call fixes the problem and is good in its own right since
one can then read and write to all the digitial lines at the same time.
Tested on a K8055, but not on a K8061.
Signed-off-by: J. Ali Harlow <ali@avrc.city.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
J. Ali Harlow [Wed, 18 May 2011 18:18:54 +0000 (19:18 +0100)]
comedi vmk80xx: extend rudimentary_check to check both directions
rudimentary_check() can currently check whether the input or
output direction is currently available (no pending transaction),
but not both at the same time. We need this facility for do_bits().
Signed-off-by: J. Ali Harlow <ali@avrc.city.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Julia Lawall [Wed, 18 May 2011 19:20:43 +0000 (21:20 +0200)]
drivers/staging/cptm1217/clearpad_tm1217.c: Correct call to input_free_device
This code is in a loop that currently is only executed once. Because of
this property, the first block of code is currently actually correct.
Nevertheless, the comments associated with the code suggest that the loop
is planned to take more than one iteration in the future, and thus this
patch is made with that case in mind.
In the first block of code, there is currently an immediate abort from the
function. It is changed to jump to the error handling code at fail, to be
able to unregister and free the resources allocated on previous iterations.
In the second block of code, the input_dev for the current iteration has
been allocated, but has not been registered. It has also not been stored
in ts->cp_input_info[i].input. Thus on jumping to fail, it will not be
freed. In this case, we want to free, but not unregister, so the free for
this most recently allocated resource is put before the jump.
A simplified version of the semantic match that finds this problem is:
(http://coccinelle.lip6.fr/)
// <smpl>
@r exists@
local idexpression struct input_dev * x;
expression ra,rr;
position p1,p2;
@@
x = input_allocate_device@p1(...)
... when != x = rr
when != input_free_device(x,...)
when != if (...) { ... input_free_device(x,...) ...}
if(...) { ... when != x = ra
when forall
when != input_free_device(x,...)
\(return <+...x...+>; \| return@p2...; \) }
Oren Weil [Sun, 15 May 2011 10:43:46 +0000 (13:43 +0300)]
staging/mei: mei.h defining user space interface
define IOCTL_MEI_CONNECT_CLIENT and its associated structure
When the user wants to connect to a ME feature/client after
it open a file descriptor to the driver, he need to use Connect
IOCTL.
This IOCTL received a struct that contains a union of 2 other structs.
1st struct - Input Parameters:
UUID - a predefine unique that identify the ME feature, this
id per feature is constant all over the chipsets
and versions.
2nd struct Output Parameters:
MaxMessageLen - maximum message length that allowed
to be send to the feature
ProtocolVersion ME feature current protocol version.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Itzhak Tzeel-Krupp <itzhak.tzeel-krupp@intel.com> Signed-off-by: Oren Weil <oren.jer.weil@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Oren Weil [Sun, 15 May 2011 10:43:44 +0000 (13:43 +0300)]
staging/mei: MEI driver init flow.
Init driver list and queue, MEI Hardware reset flow,
init of driver specific host client.
MEI Init/reset flow:
- Ack all waiting interrupts
- Hardware reset flow (Set Reset Bit, Generate Interrupt, Clear Reset Bit
Generate Interrupt)
- Wait for ME Ready Bit (done in interrupt thread)
- Set ME Ready Bit (done in interrupt thread)
- Send Start request (done in interrupt thread)
- wait for answer
- Send Enumerate Clients request (done in interrupt thread)
- wait for answer
- Send Get Client property for each client request (done in interrupt thread)
- Wait for answers
- Init Done.
MEI Driver connect internally to 2 ME clients/features:
AMTHI and AMT watchdog.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Itzhak Tzeel-Krupp <itzhak.tzeel-krupp@intel.com> Signed-off-by: Oren Weil <oren.jer.weil@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Oren Weil [Sun, 15 May 2011 10:43:43 +0000 (13:43 +0300)]
staging/mei: MEI link layer
Implementation of the communication between host and ME.
connect/disconnect to/from a client, send MEI message,
read MEI message, flow control handling.
Each MEI message has mei_msg_hdr followed by a payload.
Driver is oblivious the payload.
ME Address/ID - This is the logical address of the ME
feature/client of that message.
Host Address/ID - This is the logical address of the Host
client of that message
Length - This is the Length of message payload in bytes
Reserved - reserved for future use.
Message Complete - This bit is used to indicative that
this is the last message of multi message
MEI transfer of a client message that is larger
then the MEI circular buffer.
Payload - Message payload (data) up to 512bytes
The HW data registers are consist two circular buffers,
one for data from ME and other data from Host application.
Each buffer has two pointers, read_ptr (H_CBRP)
and write_ptr (H_CBWP).
The buffers size is defined by depth value that exists
in the status registers (H_CBD and ME_CBD_HRA).
Every read from ME circular buffer cause read_ptr++
Every write to the Host circular buffer write_ptr++
Flow control MEI message that ME and MEI Driver use to notify
each other that a ME feature/client or Host client buffer is ready
to receive data.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Itzhak Tzeel-Krupp <itzhak.tzeel-krupp@intel.com> Signed-off-by: Oren Weil <oren.jer.weil@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>