Commit graph

442310 commits

Author SHA1 Message Date
Srinivas Pandruvada 1eef062042 iio: hid-sensors: Proximity: Raw read support
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-05 10:59:51 +01:00
Srinivas Pandruvada 371a12339a iio: hid-sensors: ALS: Raw read support
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-05 10:59:51 +01:00
Srinivas Pandruvada 0964f706dc iio: hid-sensors: Gyro 3D: Raw read support
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-05 10:59:50 +01:00
Srinivas Pandruvada c639945323 iio: hid-sensors: Accelerometer 3D: Raw read support
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-05 10:59:49 +01:00
Srinivas Pandruvada 56ff6be608 iio: hid-sensors: Add API to power on/off
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-05 10:59:49 +01:00
Srinivas Pandruvada a269b9a0a2 iio: hid-sensors: Pressure: adjust scale and offset
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-05 10:59:48 +01:00
Srinivas Pandruvada be8e48d67e iio: hid-sensors: Inclinometer 3D: adjust scale and offset
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-05 10:59:48 +01:00
Srinivas Pandruvada 92463fdab5 iio: hid-sensors: Compass 3D: adjust scale and offset
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-05 10:59:47 +01:00
Srinivas Pandruvada 36783d09f1 iio: hid-sensors: ALS: adjust scale and offset
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-05 10:59:46 +01:00
Srinivas Pandruvada 6c7db77e40 iio: hid-sensors: Gyro 3D : adjust scale and offset
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-05 10:59:46 +01:00
Srinivas Pandruvada 73a2498820 iio: hid-sensors: Accelerometer 3D: adjust scale and offset
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-05 10:59:45 +01:00
Srinivas Pandruvada 9030924510 iio: hid-sensors: Add api to get poll value
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-05 10:59:45 +01:00
Srinivas Pandruvada 5d02edfc39 iio: hid-sensors: Convert units and exponent
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-05 10:59:44 +01:00
navin patidar 09c3fbba88 staging: rtl8188eu: Remove 'u8 *pbuf' from struct recv_buf
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-03 20:30:11 -04:00
navin patidar acfd19e707 staging: rtl8188eu: Remove rtl8188eu_init_recvbuf() function
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-03 20:30:11 -04:00
navin patidar a1f3b3fdba staging: rtl8188eu: Remove 'u32 ref_cnt' from struct recv_buf
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-03 20:30:11 -04:00
navin patidar 74e250e479 staging: rtl8188eu: Remove 'u32 len' from struct recv_buf
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-03 20:30:11 -04:00
navin patidar 1b2a4fc7a5 staging: rtl8188eu: Remove 'alloc_sz' from struct recv_buf
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-03 20:30:11 -04:00
navin patidar f0f4499d70 staging: rtl8188eu: Remove 'pallocated_buf' from struct recv_buf
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-03 20:30:11 -04:00
navin patidar e205cae24d staging: rtl8188eu: Remove 'irp_pending' from struct recv_buf
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-03 20:30:10 -04:00
navin patidar c11f3fff32 staging: rtl8188eu: Remove pdata, phead, ptail and pend from struct recv_buf
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-03 20:30:10 -04:00
navin patidar afdd36ef9c staging: rtl8188eu: Remove 'int transfer_len' from struct recv_buf
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-03 20:30:10 -04:00
navin patidar 498562560a staging: rtl8188eu: Remove 'dma_addr_t dma_transfer_addr' from struct recv_buf
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-03 20:30:10 -04:00
navin patidar 4337ff2f8f staging: rtl8188eu: Remove 'spinlock_t recvbuf_lock' from struct recv_buf
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-03 20:30:10 -04:00
navin patidar 9a4429ea62 staging: rtl8188eu: Remove 'struct list_head list' from struct recv_buf
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-03 20:30:10 -04:00
navin patidar 5fe2f910f4 staging: rtl8188eu: Remove function rtw_enqueue_recvbuf()
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-03 20:29:10 -04:00
navin patidar 0521a2a6f9 staging: rtl8188eu: Remove function rtw_enqueue_recvbuf_to_head()
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-03 20:29:09 -04:00
navin patidar d27ab0b9df staging: rtl8188eu: Remove function rtw_dequeue_recvbuf()
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-03 20:29:09 -04:00
Jan Moskyto Matejka b9fb433072 rtl8821ae: fixed defined-not-used warning
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-03 20:24:27 -04:00
Rui Miguel Silva 2930d0b977 staging: rtl8192u: fix checkpatch braces warning
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-03 20:22:43 -04:00
Dominique van den Broeck 7626e3d0d4 staging/rtl8192e: Erroneous return codes (types and values)
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-03 20:21:59 -04:00
navin patidar 73fbfbfecb staging: rtl8188eu: Use USB subsystem functions to check endpoint type
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-03 20:20:17 -04:00
navin patidar 213351448f staging: rtl8188eu: Remove debugging messages from usb_dvobj_init()
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-03 20:20:16 -04:00
Thomas Vegas 5f888cb7b1 staging: serqt_usb2: Clean up initializations of variables
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-03 20:16:39 -04:00
Thomas Vegas f5a7856ec9 staging: serqt_usb2: Add blank line after declaration
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-03 20:16:38 -04:00
Thomas Vegas c46e961e5a staging: serqt_usb2: Remove useless variable
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-03 20:16:38 -04:00
Ian Abbott 482f0a2190 staging: comedi: remove async parameter from resize_async_buffer()
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-03 20:12:17 -04:00
Ian Abbott 0ce016d098 staging: comedi: remove redundant pointer dereference in comedi_poll()
`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-03 20:12:17 -04:00
Ian Abbott 6e2954e801 staging: comedi: amplc_dio200_common: correct bound on counter mode
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-03 20:08:57 -04:00
Ian Abbott 7d52477ef5 staging: comedi: drivers: correct mode check for i8254_set_mode()
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-03 20:08:56 -04:00
Luca Ellero a1f6c2afed staging: comedi: fix checkpatch warnings
Signed-off-by: Luca Ellero <luca.ellero@brickedbrain.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03 20:07:45 -04:00
H Hartley Sweeten 8383b8c4a9 staging: comedi: das16: clarify 8254 timer programming
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-03 20:06:35 -04:00
H Hartley Sweeten bef74ba884 staging: comedi: das16m1: clarify 8254 timer programming
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-03 20:06:35 -04:00
H Hartley Sweeten 22e09dff08 staging: comedi: ni_at_a2150: clarify 8254 timer programming
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-03 20:06:35 -04:00
H Hartley Sweeten e74e98993d staging: comedi: ni_labpc: fix 8254 timer programming
As pointed out by Ian Abbott, the i8254_load() function does not
use the I8254_MODE* values to specify the "mode".

The labpc_counter_load() function in this driver is passed an
I8254_MODE* value so we need to use the i8254_set_mode() and
i8254_write() helpers instead of i8254_load() to program the
timers.

The calls to labpc_counter_load() will not fail so change the
return to void and remove all the unnecessary error handling.

Similarly, change the return type of labpc_counter_set_mode() to
void and remove the unnecessary error handling.

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-03 20:06:35 -04:00
H Hartley Sweeten 52c9e62cf3 staging: comedi: das800: clarify 8254 timer programming
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.

The das800_set_frequency() function will not fail. For aesthetics
change the return to a void and remove the error handling.

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-03 20:06:35 -04:00
H Hartley Sweeten 90c32ce300 staging: comedi: amplc_pci244: clarify 8254 timer programming
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-03 20:06:35 -04:00
H Hartley Sweeten e72f7ad46e staging: comedi: me4000: fix 8254 timer programming
As pointed out by Ian Abbott, the i8254_load() function does not
use the I8254_MODE* values to specify the "mode".

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.

Also, use the CR_CHAN() macro to make sure the only the channel is
used in the insh->chanspec to specify the counter number.

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-03 20:06:34 -04:00
H Hartley Sweeten 4f161fc756 staging: comedi: ni_at_ao: fix 8254 timer programming
As pointed out by Ian Abbott, the i8254_load() function does not
use the I8254_MODE* values to specify the "mode".

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-03 20:06:34 -04:00
H Hartley Sweeten d7c0dcb65a staging: comedi: pcl711: fix 8254 timer programming
As pointed out by Ian Abbott, the i8254_load() function does not
use the I8254_MODE* values to specify the "mode".

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.

For aesthetics, factor the timer programming out as a separate
function.

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-03 20:06:34 -04:00