summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-05-10iio: hid-sensors: typo leads to potential forever loopDan Carpenter
The "i < " was missing in this condition. Fixes: 5d02edfc3957 ('iio: hid-sensors: Convert units and exponent') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-06Merge branch 'imx-drm-fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm ↵Greg Kroah-Hartman
into staging-next imx-drm fixes from Russell
2014-05-05Merge tag 'iio-for-3.16b' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Second set of IIO new drivers, cleanups and functionality for the 3.16 cycle. This set contains a change to the ABI for the hid-sensors drivers to bring them in line with the long published documentation. Unfortunately, rather than reporting true scale and offset values via sysfs they were reporting some magic numbers that could only be converted to anything useful using the HID sensors specification. I missed this entirely through the introduction of a number of drivers, only picking up on it recently. Srinivas has had user feedback about this as well. The patch set is too large to go as a fix at this stage in the cycle and is not a regression fix as this was never right and so will have to wait for the next merge window. Srinivas assures me that there are relatively few pieces of hardware out there and he has had a number of people contact him to point out that the drivers did not obey the ABI. Hence hopefully the fallout of this, if any will be minor. If we don't fix it now, it will only get worse going forward. There is no sensible way of maintaining the incorrect ABI as it is simply returning the wrong values through the standard interfaces. Non IIO elements * Introduce devm_kmemdup. Does what it says on the tin. New drivers: * hid-sensors rotation devices (output as quaternion) * Freescale MPL115A2 presure and temperature sensor. * Melexis mlx90614 contactless infrared sensor. * Freescale MMA8452Q 3-axis accelerometer. New functionality: * Addition of multiple element callback to allow for sysfs interfaces to access elements such as quaternions which have no useful meaning if all 4 elements are not presented together. Other future usecases for this include rotation matrices. * Support for multiple element buffer entries for exactly the same uses as the sysfs related elements described above. * Quaternion support via the quaternion IIO modifier. * TEMP_AMBIENT and TEMP_OBJECT modifiers to distinguish cases with thermopile devices. * hid-sensors gain sysfs access to the sensor readings. Previously these drivers used the buffered interface only. This change involves some additional hid-sensors core support to read poll values back from the devices to allow the drivers to know roughly how long to wait for a result when polling the sensor. There is also an associated hid-sensors abi to allow the devices to be turned off between reads and powered up on demand. Cleanups and fixes * Hid sensors fix as described above. Result is to make the _scale and _offset attributes applicable in the same way as for all other IIO drivers. * Some additional documentation - mostly covering stuff that graduated from staging without managing to take it's ABI docs with it. * A series of little tidy ups to the exynos_adc driver that make the code nicer to read and improve handling of some corner cases. * A tidy up to mag3110 (logical fix rather than a real one ;). Also enable user offset calibration for this device. * Drop some left over IS_ERR() checks from ad799x that snuck through during the cleanup in the last IIO patch set. * Fix a naming issue from clashing patches in ak8975 - note the clash only occured in the last IIO patch set, hence the fix needs to go through this tree. * A format string missmatch fix in ad7280.c. Unlikely to have ever had an impact so not worth rushing through.
2014-05-05iio: hid-sensors: Pressure: Raw read supportSrinivas Pandruvada
Added support for raw reading of channel. If the sensor is powered off, it will turn on for reading value. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: Inclinometer 3D: Raw read supportSrinivas Pandruvada
Added support for raw reading of channel. If the sensor is powered off, it will turn on for reading value. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: Compass 3D: Raw read supportSrinivas Pandruvada
Added support for raw reading of channel. If the sensor is powered off, it will turn on for reading value Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: Proximity: Raw read supportSrinivas Pandruvada
Added support for raw reading of channel. If the sensor is powered off, it will turn on for reading value. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: ALS: Raw read supportSrinivas Pandruvada
Added support for raw reading of channel. If the sensor is powered off, it will turn on for reading value. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: Gyro 3D: Raw read supportSrinivas Pandruvada
Added support for raw reading of channel. If the sensor is powered off, it will turn on for reading value. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: Accelerometer 3D: Raw read supportSrinivas Pandruvada
Added support for raw reading of channel. If the sensor is powered off, it will turn on for reading value. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: Add API to power on/offSrinivas Pandruvada
Added an API to allow client drivers to turn ON and OFF sensors for quick read. Added data_read as counting varaible instead of boolean, so that sensor is powered off only when last user released it. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: Pressure: adjust scale and offsetSrinivas Pandruvada
Using units and unit exponent to calculate scale which is compliant to IIO ABI. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: Inclinometer 3D: adjust scale and offsetSrinivas Pandruvada
Using units and unit exponent to calculate scale which is compliant to IIO ABI. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: Compass 3D: adjust scale and offsetSrinivas Pandruvada
Using units and unit exponent to calculate scale which is compliant to IIO ABI. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: ALS: adjust scale and offsetSrinivas Pandruvada
Using units and unit exponent to calculate scale which is compliant to IIO ABI. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: Gyro 3D : adjust scale and offsetSrinivas Pandruvada
Using units and unit exponent to calculate scale which is compliant to IIO ABI. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: Accelerometer 3D: adjust scale and offsetSrinivas Pandruvada
Using units and unit exponent to calculate scale which is compliant to IIO ABI. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: Add api to get poll valueSrinivas Pandruvada
Added interface to get poll value in milli-seconds. This value is changed by changing sampling frequency. This API allows clients to wait for at least some poll milli seconds before reading a new sample. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: Convert units and exponentSrinivas Pandruvada
HID sensor hub specify a default unit and alternative units. This along with unit exponent can be used adjust scale. This change change HID sensor data units to IIO defined units for each sensor type. So in this way user space can use a simply use: "(data + offset) * scale" to get final result. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-03staging: rtl8188eu: Remove 'u8 *pbuf' from struct recv_bufnavin patidar
Instead of using pbuf to pass sbk data pointer to usb_fill_bulk_urb(), we can use precvbuf->pskb->data to do that. Signed-off-by: navin patidar <navin.patidar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: rtl8188eu: Remove rtl8188eu_init_recvbuf() functionnavin patidar
rtl8188eu_init_recvbuf() function definition is empty now, so remove it. Signed-off-by: navin patidar <navin.patidar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: rtl8188eu: Remove 'u32 ref_cnt' from struct recv_bufnavin patidar
Driver isn't making any use of value stored in variable ref_cnt. Signed-off-by: navin patidar <navin.patidar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: rtl8188eu: Remove 'u32 len' from struct recv_bufnavin patidar
Remove unused variable 'u32 len'. Signed-off-by: navin patidar <navin.patidar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: rtl8188eu: Remove 'alloc_sz' from struct recv_bufnavin patidar
Driver isn't making any use of value stored in alloc_sz variable. Signed-off-by: navin patidar <navin.patidar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: rtl8188eu: Remove 'pallocated_buf' from struct recv_bufnavin patidar
pallocated_buf is not being used by driver. Signed-off-by: navin patidar <navin.patidar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: rtl8188eu: Remove 'irp_pending' from struct recv_bufnavin patidar
irp_pending is initialized to false inside rtw_os_recvbuf_resource_alloc() and value of irq_pending never changed after that, so 'if (!precvbuf->irp_pending)' inside rtw_os_read_port() function will be always true. Signed-off-by: navin patidar <navin.patidar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: rtl8188eu: Remove pdata, phead, ptail and pend from struct recv_bufnavin patidar
Driver is not making use of value stored in removed variables. Signed-off-by: navin patidar <navin.patidar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: rtl8188eu: Remove 'int transfer_len' from struct recv_bufnavin patidar
Driver is not making any use of value stored in this variable. Signed-off-by: navin patidar <navin.patidar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: rtl8188eu: Remove 'dma_addr_t dma_transfer_addr' from struct recv_bufnavin patidar
Remove unused variable dma_transfer_addr. Signed-off-by: navin patidar <navin.patidar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: rtl8188eu: Remove 'spinlock_t recvbuf_lock' from struct recv_bufnavin patidar
recvbuf_lock is initialized inside rtl8188eu_init_recv_priv() but never used. Signed-off-by: navin patidar <navin.patidar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: rtl8188eu: Remove 'struct list_head list' from struct recv_bufnavin patidar
Users of 'struct list_head list' variable e.g. rtw_enqueue_recvbuf(), rtw_enqueue_recvbuf_to_head() and rtw_dequeue_recvbuf() are already removed. Signed-off-by: navin patidar <navin.patidar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: rtl8188eu: Remove function rtw_enqueue_recvbuf()navin patidar
rtw_enqueue_recvbuf() is not being used by driver. Signed-off-by: navin patidar <navin.patidar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: rtl8188eu: Remove function rtw_enqueue_recvbuf_to_head()navin patidar
rtw_enqueue_recvbuf_to_head() is not being used by driver. Signed-off-by: navin patidar <navin.patidar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: rtl8188eu: Remove function rtw_dequeue_recvbuf()navin patidar
rtw_dequeue_recvbuf() is not being used by driver. Signed-off-by: navin patidar <navin.patidar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03rtl8821ae: fixed defined-not-used warningJan Moskyto Matejka
by cleaning up BT_AUTO_REPORT_ONLY_8192E_2ANT (always set to 0, never used as constant) halbtc8192e2ant_iswifi_status_changed was called only from the unused code Signed-off-by: Jan Moskyto Matejka <mq@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: rtl8192u: fix checkpatch braces warningRui Miguel Silva
fix some code style related to the use of braces in a one statement block Signed-off-by: Rui Miguel Silva <rmfrfs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging/rtl8192e: Erroneous return codes (types and values)Dominique van den Broeck
This function returns a bool, that is supposed to be false when something goes wrong. It's assumed this way by its lone calling function (which is SetRFPowerState8190(), line 1445 of rtl8192e/rtl8192e/r8192E_phy.c) Despite of this, this procedure returns non-null enumerations values or negative codes instead. This patch fixes this. Signed-off-by: Dominique van den Broeck <domdevlin@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: rtl8188eu: Use USB subsystem functions to check endpoint typenavin patidar
Use inline functions provided by USB subsystem to check endpoint type, instead of inline functions implemented by driver to do the same. Signed-off-by: navin patidar <navin.patidar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: rtl8188eu: Remove debugging messages from usb_dvobj_init()navin patidar
Unnecessary debugging messages are removed from usb_dvobj_init(). Signed-off-by: navin patidar <navin.patidar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: serqt_usb2: Clean up initializations of variablesThomas Vegas
Use a more common kernel coding style. Signed-off-by: Thomas Vegas <thomas_75@safe-mail.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: serqt_usb2: Add blank line after declarationThomas Vegas
Use a more common kernel coding style. Signed-off-by: Thomas Vegas <thomas_75@safe-mail.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: serqt_usb2: Remove useless variableThomas Vegas
Use a more common kernel coding style. Signed-off-by: Thomas Vegas <thomas_75@safe-mail.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: comedi: remove async parameter from resize_async_buffer()Ian Abbott
The `struct comedi_async *async` parameter of `resize_async_buffer()` is redundant as its value can be easily derived from the `struct comedi_subdevice *s` parameter as `s->async`. Remove the parameter. 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>
2014-05-03staging: comedi: remove redundant pointer dereference in comedi_poll()Ian Abbott
`s->async->subdevice` in `comedi_poll()` points to the same `struct comedi_subdevice` as `s`, so the double pointer reference is redundant. Just use `s`. (`s->async->subdevice` is initialized by `__comedi_device_postconfig_async()` in "drivers/staging/comedi/drivers.c" and doesn't change.) 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>
2014-05-03staging: comedi: amplc_dio200_common: correct bound on counter modeIan Abbott
For the mode configured by the `INSN_CONFIG_SET_COUNTER_MODE` comedi instruction for the counter subdevice channels supported by this module, the upper bound should be `I8254_MODE5 | I8254_BCD` ((5 << 1) | 1) rather than `I8254_MODE5 | I8254_BINARY` ((5 << 1) | 0). Fix it. Reported-by: Hartley Sweeten <HartleyS@visionengravers.com> 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>
2014-05-03staging: comedi: drivers: correct mode check for i8254_set_mode()Ian Abbott
The upper bound check on the `mode` parameter of `i8254_set_mode()` and `i8254_mm_set_mode()` is incorrect. The `mode` parameter value consists of a mode number in the range 0 to 5 in bits 3..1 {represented by the constants `I8254_MODE0` (0 << 1) through to `I8254_MODE5` (2 << 1)} ORed with a BCD/binary flag in bit 0 {represented by the constants `I8254_BINARY` (0) and `I8254_BCD` (1)}. The maximum allowed value ought to be `I8254_MODE5 | I8254_BCD` ((5 << 1) | 1), but is currently `I8254_MODE5 | I8254_BINARY` ((5 << 1) | 0). Fix it. None of the comedi drivers use `I8254_BCD` but some of the low-level drivers allow user-space to configure the counter mode, so all legal values ought to be allowed. However, it's pretty unlikely anyone would want to set the counters to count in BCD (binary coded decimal) so the bug is not that significant. Reported-by: Hartley Sweeten <HartleyS@visionengravers.com> 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>
2014-05-03staging: comedi: fix checkpatch warningsLuca Ellero
Signed-off-by: Luca Ellero <luca.ellero@brickedbrain.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: comedi: das16: clarify 8254 timer programmingH Hartley Sweeten
Refactor the 8254 timer programming to use the i8254_set_mode() and i8254_write() helpers instead of i8254_load(). This allows us to use the I8254_MODE* defines to clarify the code. 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>
2014-05-03staging: comedi: das16m1: clarify 8254 timer programmingH Hartley Sweeten
Refactor the 8254 timer programming to use the i8254_set_mode() and i8254_write() helpers instead of i8254_load(). This allows us to use the I8254_MODE* defines to clarify the code. 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>
2014-05-03staging: comedi: ni_at_a2150: clarify 8254 timer programmingH Hartley Sweeten
Refactor the 8254 timer programming to use the i8254_set_mode() and i8254_write() helpers instead of i8254_load(). This allows us to use the I8254_MODE* defines to clarify the code. 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>