Adds support for the new channel types in the dummy driver:
* a new channel IIO_ACTIVITY
* two state transition events (running and walking)
* a new channel IIO_STEPS and support for reading and writing
pedometer step counter
* step detect event
* a new IIO_CHAN_INFO_CALIBHEIGHT mask bit for reading and writing
user's height.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Some devices need the height of the user to compute various
parameters. One of this devices is Freescale's MMA9553L
(http://www.freescale.com/files/sensors/doc/ref_manual/MMA9553LSWRM.pdf)
that needs the height of the user to compute the stride length which
is used further to determine distance, speed and activity type.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
These changes are needed to support the functionality of a pedometer.
A pedometer has two basic functionalities: step counter and step detector.
The step counter needs to be enabled and then it will count the steps
in its hardware register. Whenever the application needs to check
the step count, it will read the step counter register. To support the
step counter a new channel type STEPS is added. Since the pedometer needs
to be enabled first so that the hardware can count and store the steps,
we need a specific ENABLE channel info mask.
The step detector will generate an interrupt each time a step is detected.
To support this functionality we add a new event type INSTANCE.
For more information on the Android requirements for step counter and step
detector see:
http://source.android.com/devices/sensors/composite_sensors.html#counter
and http://source.android.com/devices/sensors/composite_sensors.html#detector.
A device that has the pedometer functionality this interface needs to
support is Freescale's MMA9553L:
http://www.freescale.com/files/sensors/doc/ref_manual/MMA9553LSWRM.pdf
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
For some events (e.g.: step detector) a direction does not make sense.
Add IIO_EV_DIR_NONE to be used with such events and generate sysfs event
attributes that do not contain direction.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This channel will be used for exposing information about
activity composite sensors. Activities supported so far:
* running
* jogging
* walking
* still
THRESHOLD event is used to signal a change in the activity
state.
We associate a confidence interval for each activity expressed
as a percentage from 0 to 100.
* 0, means the sensor IS NOT reporting that activity.
* 100, means the sensor IS reporting that activity.
Users of this interface have two possible means to gather
information about the ongoing activities.
1. Event based, via event file descriptor
* sensor may report an event when ENTERING an activity or LEAVING
an activity based on a threshold value.
* drivers will wake up applications waiting data on the event fd
2. Polling, by reading the sysfs associated attribute files:
* /sys/bus/iio/devices/iio:device0/in_activity_running_input
expressed as percentage confidence value from 0 to 100.
This will offer an interface for Android significant motion
composite sensor defined here:
http://source.android.com/devices/sensors/composite_sensors.html
Activities listed above are supported by Freescale's MMA9553 sensor:
http://freescale.com/files/sensors/doc/ref_manual/MMA9553LSWRM.pdf
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
We need a way to store events generated by iio_dummy_evgen module,
in order to correctly process IRQs in iio_simple_dummy_events.
For the moment, we add two registers:
* id_reg - ID register, stores the source of the event
* id_data - DATA register, stores the type of the event
e.g echo 4 > /sys/bus/iio/devices/iio_evgen/poke2
id_reg 0x02, id_data 0x04
This means, event of type 4 was generated by fake device 2.
We currently use a hardcoded mapping of virtual events to IIO events.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Minimal implementation for KMX61 6-axis accelerometer/magnetometer. It exports
raw accel/magn readings together with scale and sampling frequency.
Datasheet will be available at:
http://www.kionix.com/6-axis-accelerometer-magnetometer/kmx61
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The Onda v975w tablet contains an accelerometer that's advertised over
ACPI as SMO8500. This device is however a KXCJ9 accelerometer as
can be seen in the Windows driver's INF file, and from the etching on
the chipset ("KXCJ9 41566 0414").
This patch also removes the attempt to get the IRQ for the "data ready"
signal, as it does not seem to be supported by this device on this
platform.
Signed-off-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch adds a new driver for solteam opto JSA1212 proximity and
ambient light sensor.
Basic details of the chip can be found here.
http://www.solteamopto.com.tw/detail.php?ms=3&po_unit=2&pt_unit=29&p_unit=120
Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Remove the private data member 'count' and use the comedi_async 'scans_done'
member to detect the end-of-acquisition.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the private data member 'ai_AiActualScan' and use the comedi_async
'scans_done' member to detect the end-of-acquisition.
The function v_APCI3120_InterruptDmaMoveBlock16bit() is then just a wrapper
for comedi_buf_write_samples(). Remove it.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the private data member 'ai_sample_count' and use the comedi_async
'scans_done' member to detect the analog input end-of-acquisition.
Move the EOA check so it happens after adding the samples from the current
urb to the async buffer. This prevents the unnecessary resubmit of the urb
when the EOA occurs.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the private data member 'ao_sample_count' and use the comedi_async
'scans_done' member to detect the analog output end-of-acquisition.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the private data member 'ai_sample_count' and use the comedi_async
'scans_done' member to detect the analog input end-of-acquisition.
Move the EOA check so it happens after adding the samples from the current
urb to the async buffer. This prevents the unnecessary resubmit of the urb
when the EOA occurs.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the private data member 'ao_sample_count' and use the comedi_async
'scans_done' member to detect the analog output end-of-acquisition.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the private data member 'ai_sample_count' and use the comedi_async
'scans_done' member to detect the end-of-acquisition.
Also, remove the unnecessary COMEDI_CB_EOS event. The core automatically
detects and adds that event.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the private data member 'stop_count' and use the comedi_async 'scans_done'
member to detect the end-of-acquisition.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the private data member 'count' and use the comedi_async 'scans_done'
member to detect the end-of-acquisition.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the private data member 'ai_act_scan' and use the comedi_async
'scans_done' member to detect the end-of-acquisition.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the private data member 'ai_act_scan' and use the comedi_async
'scans_done' member to detect the end-of-acquisition.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This member of the private data is set to '0' but never used. Remove it.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the private data member 'ai_act_scan' and use the comedi_async
'scans_done' member to detect the end-of-acquisition.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the private data member 'ai_act_scan' and use the comedi_async
'scans_done' member to detect the end-of-acquisition.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the private data member 'ntrig' and use the comedi_async 'scans_done'
member to detect the end-of-acquisition.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the private data member 'stopcount' and use the comedi_async 'scans_done'
member to detect the end-of-acquisition.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the private data member 'stop_count' and use the comedi_async 'scans_done'
member to detect the end-of-acquisition.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Introduce a new member to comedi_async to count the number of scans completed.
This member is cleared by comedi_buf_reset() along with the other comedi_async
members. It is incremented in comedi_inc_scan_progress() when the end of scan
is detected.
This member will be used to clean up the scan counting in the comedi drivers.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix the implementation of a single-open policy for both
devices (lcd and keypad) by using atomic_t instead of plain ints.
Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Wake queue in the dwIsr loop of device_intr instead of device_tx_srv.
This fixes an issue when ISR_TXDMA0 or ISR_AC0DMA does not occur
device_tx_srv is not called and the queue gets stuck in stopped
condition.
On test if the queue is stuck another MACvTransmitAC0 or MACvTransmit0
in vnt_tx_packet will clear it.
Check on vif that both buffers are available and the queue is stopped.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linux already includes a copy of the GPL, checkpatch compains about the address.
Remove it from the license text.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Now that Comedi has the structures in place to support setting the
current "read" and/or "write" subdevice on a per-file object basis, add
new ioctls to set them. The newly chosen "read" ("write") subdevice
needs to support "read" ("write") commands, and the file cannot be busy
handling a "read" ("write") command on the previous subdevice (if any).
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Comedi devices may have several subdevices that support "read" and/or
"write" asynchronous commands that use the "read" or "write" file
operations for data transfer. The low-level Comedi drivers may nominate
a default "read" subdevice and/or a default "write" subdevice, but it
may have other subdevices that support asynchronous commands.
The Comedi core provides a somewhat clunky mechanism to provide access
to the asynchronous command support of the non-default subdevices. When
a low-level device is "attached" to a core Comedi device, it dynamically
allocates a minor device number for each of the subdevices that support
asynchrounous commands and associates them with files created in SysFS
named "comediX_subdY", where "X" is the minor device number of the main
comedi device, and "Y" is the subdevice number. An application can open
these subdevice-specific files and they behave like the regular
"comediX" files except that the "read" and/or "write" subdevice may be
different to the default chosen by the low-level driver.
This patch adds a layer of indirection between the file object and the
comedi device object to allow the current "read" and/or "write"
subdevice to be altered after opening the Comedi device, on a per-file
object basis. The advantage is that an application only needs to open
the main Comedi device file and can then choose which subdevice it wants
to "read" or "write". The main Comedi device file can be opened more
than once, and each file object can choose the "read" and "write"
subdevices independently.
The new `struct comedi_file` is created on "open" and freed on
"release". It includes pointers to the main Comedi device structure,
and to the current "read" and "write" subdevice structures (which may be
NULL). It also has information to keep track of when a low-level device
has been attached or detached since the previous time the file object
was used. In that case, the current "read" and "write" subdevices in
the `struct comedi_file` will be changed to the new defaults (or set to
NULL). (The change to new defaults is done by `comedi_file_reset()`.
The checking for attach/detach is done by `comedi_file_check()` which
will call `comedi_file_reset()` if there have been any attach/detach
operations since the previous call.)
A subsequent patch will add the ioctls to change the current "read" and
"write" subdevices.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patches replaces one pr_debug call by dev_dbg and
changes the device used by one of the dev_err calls.
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The dgap_init_global() initialize the dgap_board
that is a global variable as static and dgap_poll_timer.
But init_timer() is called twice in dgap_start() and dgap_board
doesn't need to be initialized to NULL.
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
These functions are not used so remove them
BBbIsRegBitsOn
BBbIsRegBitsOff
BBvReadAllRegs
BBvLoopbackOn
BBvLoopbackOff
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The device starts up with a default rate of 54M
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Delete uislib_client_add_vnic() and uislib_client_delete_vnic(), since these
are never used.
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch removes extra blank lines from the virthba header and source
files. This is the first of a set of patches that will clean up the
virthba source file. The only checkpatch issue in the header file was
the blank line warnings.
Signed-off-by: Ken Depro <kenneth.depro@unisys.com>
Signed-off-by: Ben Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The GET_BUS_DEV macro contained flow control statements that are undesirable.
This patch removes the macro and places the code in each function.
Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix the function name declaration so it is just one line, and add the missing
brackets to the else clause in the if statement.
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>