summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * staging:iio: Fix scan mask updateLars-Peter Clausen2011-12-081-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When updating the scan mask we have to check the actual scan mask for if the channel is already enabled, not the matching scan mask from the available scan masks. The bit will already be set there and as a result the actual scan mask will not get updated and the channel stays disabled. Also fix the return value of iio_scan_el_store which would return 1 instead of the number of bytes written if the channel was already active in the scan mask. Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | Merge branch 'work-next' into staging-nextGreg Kroah-Hartman2011-12-082-36/+24
|\ \ | |/
| * staging:iio: Fix sw_ring memory corruptionLars-Peter Clausen2011-12-081-35/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sw_ring does not properly handle the case where the write pointer already has wrapped around, the read pointer has not and the remaining buffer space at the end is enough to fill the read buffer: +-----------------------------------+ | | |##data##| | +-----------------------------------+ write_p read_p In this case the current code will copy all available data to the buffer and as a result will write beyond the bounds of the buffer and cause a memory corruption. To address this issue this patch adds code to calculate the available buffer space and makes sure that the number of bytes to copy does not exceed this number. This allows the code which copies the data around to be simplified as it only has to consider two cases: Read wraps around and read does not wrap around. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * staging:iio: Fix typoLars-Peter Clausen2011-12-081-1/+1
| | | | | | | | | | | | | | Fix a small typo in the iio_modifer enum. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | staging:iio:buffer.h update struct buffer docs.Jonathan Cameron2011-12-081-0/+6
| | | | | | | | | | | | | | These docs have lagged recent developments. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | staging:iio:buffer struct iio_buffer doesn't need an indio_dev pointer.Jonathan Cameron2011-12-088-34/+33
| | | | | | | | | | | | | | | | In all existing cases, the calls are coming from a location where the indio_dev is already available. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | staging:iio:buffer scrap to_iio_buffer as it no longer has meaning.Jonathan Cameron2011-12-081-3/+0
| | | | | | | | | | | | | | Now buffers do not have a specific dev structure, this is garbage. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | staging:iio:buffer stop allowing for read_last callback.Jonathan Cameron2011-12-081-2/+0
| | | | | | | | | | | | | | | | No longer needed now we don't allow sysfs acccess to buffer data. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | staging:iio:ring_sw don't provide read last function.Jonathan Cameron2011-12-081-33/+0
|/ | | | | | | | | No longer needed as we don't have drivers providing sysfs access to buffered data. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:adc:max1363 stop reading from buffer for sysfs accessJonathan Cameron2011-12-083-73/+21
| | | | | | | | No known use case and makes in kernel interface work more complex. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:adc:ad799x stop reading from buffer for sysfs accessesJonathan Cameron2011-12-083-38/+1
| | | | | | | | No known use case and makes in kernel interface work more complex. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:adc:ad7887 stop reading from buffer for sysfs access.Jonathan Cameron2011-12-083-40/+1
| | | | | | | | No known use case and complicates in kernel interface work. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:adc:ad7993 stop reading from buffer for sysfs raw read.Jonathan Cameron2011-12-081-21/+1
| | | | | | | | No known usecase and makes in kernel interface work more complex. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:adc:ad7606 remove buffer access to data from sysfs read.Jonathan Cameron2011-12-083-26/+1
| | | | | | | | No known use case and complicates in kernel interface work. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:adc:ad7606 remove buffer access for sysfs interfaces.Jonathan Cameron2011-12-083-30/+1
| | | | | | | | No known use case and complicates in kernel interface work. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:adc:ad7476 scrap read from buffer for sysfs access.Jonathan Cameron2011-12-083-40/+2
| | | | | | | | No known use case and complicates in kernel interface work. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:adc:ad7192 scrap read from buffer for sysfs access.Jonathan Cameron2011-12-081-21/+1
| | | | | | | | No known use case and complicates in kernel interface work. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:accel:lis3l02dq scrap reading from buffer for sysfs access.Jonathan Cameron2011-12-083-50/+3
| | | | | | | | No obvious usecase and complicates in kernel interface work. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:buffer remove unused owner field from struct iio_bufferJonathan Cameron2011-12-0811-12/+0
| | | | | | | | Legacy of having multiple chrdevs that never got cleaned up. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio: scrap scan_count and ensure all drivers use active_scan_maskJonathan Cameron2011-12-0819-77/+100
| | | | | | | | | Obviously drivers should only use this for pushing to buffers. They need buffer->scan_mask for pulling from them post demux. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:buffer move setup ops from buffer instance to iio_devJonathan Cameron2011-12-0823-46/+46
| | | | | | | | | These callbacks should not be buffer instance specific. Hence move them out of the buffer. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio: remove userspace access to bytes per datum.Jonathan Cameron2011-12-084-28/+0
| | | | | | | | | There are no known reasons why userspace should want this value. It can be established from the buffer description anyway. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:buffer drop bpe field.Jonathan Cameron2011-12-0812-16/+0
| | | | | | | | Has no remaining users. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:adc:max1363 add datasheet_name entries.Jonathan Cameron2011-12-081-0/+2
| | | | | | | | Kind of obvious for this device but useful for testing purposes. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio: core: add datasheet_name to chan_specJonathan Cameron2011-12-081-0/+5
| | | | | | | | | | | This allows for matching against the name given on a datasheet, however silly/inconsistent it might be. Useful for in kernel interfaces. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:adc:max1363 correctly set channels as big endian.Jonathan Cameron2011-12-081-2/+12
| | | | | | | Also, the differential channels should always have been signed. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:adc:max1363 use new demuxing support.Jonathan Cameron2011-12-083-40/+26
| | | | | Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio: add demux optionally to path from device to bufferJonathan Cameron2011-12-082-4/+157
| | | | | | | | | | | | | | This gives you only what you ask for which is handy for some devices with weird scan combinations. Routes all data flow through a core utility function. That and this demuxing support will be needed to do demuxing to multiple destinations in kernel. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio: make iio_sw_buffer_preenable much more general.Jonathan Cameron2011-12-082-26/+39
| | | | | | | | | | | Also introduces active_scan_mask storage to tell the core what is really being currently captured from the device (different from what is desired as often has bonus channels). Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio: add hook to allow core to perform scan related config.Jonathan Cameron2011-12-081-1/+2
| | | | | Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:buffer add a cache of the timestamp scan index.Jonathan Cameron2011-12-082-0/+4
| | | | | | | Basically avoids looking it up lots of times. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:find iio channel from scan index util functionJonathan Cameron2011-12-082-0/+19
| | | | | | | Useful for getting to the channel based on scan mask alone. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio: Remove redundant spi driver bus initializationLars-Peter Clausen2011-12-0813-13/+0
| | | | | | | | | | | | | | | | | | | | | | In ancient times it was necessary to manually initialize the bus field of an spi_driver to spi_bus_type. These days this is done in spi_register_driver() so we can drop the manual assignment. The patch was generated using the following coccinelle semantic patch: // <smpl> @@ identifier _driver; @@ struct spi_driver _driver = { .driver = { - .bus = &spi_bus_type, }, }; // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:dac: Add AD5380 driverLars-Peter Clausen2011-12-083-0/+690
| | | | | | | | | | This patch adds support for the Analog Devices D5380, AD5381, AD5382, AD5383, AD5384, AD5390, AD5391, AD5392 multi-channel Digital to Analog Converters. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:dac: Add AD5764 driverLars-Peter Clausen2011-12-083-0/+404
| | | | | | | | | This patch adds support for the Analog Devices AD5764, AD5764R, AD5744, AD5744R quad channel analog-to-digital converter. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:adc:max1363 actually make timestamp controllableJonathan Cameron2011-12-081-3/+2
| | | | | | | Previously timestamps were always on in this driver. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:generic_buffer example - handle endian differencesJonathan Cameron2011-12-082-1/+14
| | | | | Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:Documentation: cleanup properly in buffer handling codeJonathan Cameron2011-12-081-3/+15
| | | | | | | Eating the endian description for now. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* iio: light sensor: Improve granularity of tsl2583 lux values.Bryan Freed2011-12-081-3/+14
| | | | | | | | | | When illuminance0_calibbias gets 4000 (for a 4x multiplier), we see lux granularity of 4. Reversing the order of the right shift and multiplication retains the precision of the unadjusted lux value. Signed-off-by: Bryan Freed <bfreed@chromium.org> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: iio/accel: Added a range check for val in store_measurement_mode()Andreas Ruprecht2011-12-081-0/+4
| | | | | | | | | | | | | In sca3000_store_measurement_mode() we use val to and it with a mask. This mask is only two bits long (as we are only interested in the lowest two bits), so a value bigger than 3 was silently ignored so far. Now this function will return -EINVAL, if val is bigger than 3. Signed-off-by: Andreas Ruprecht <rupran@einserver.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: iio/accel: Changed data type of mask in store_measurement_mode() to u8Andreas Ruprecht2011-12-081-1/+1
| | | | | | | | | | | | | In sca3000_store_measurement_mode() we parse a value from a string buffer via kstrtou8, and store the parsed value into a u8 after and-ing it with mask. As we are only interested in the lowest two bits here and mask is initialized with a fixed value 0x03, mask may as well be a u8. Signed-off-by: Andreas Ruprecht <rupran@einserver.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: hv: update TODO fileGreg Kroah-Hartman2011-12-011-2/+1
| | | | | | | | Hank is no longer at Microsoft, so remove his email address as it bounces. Cc: KY Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: hv: remove hv_mouse driver as it's now in the hid directoryGreg Kroah-Hartman2011-12-013-609/+0
| | | | | | | | | This removes the hv_mouse driver as it's now in Jiri's HID tree in the "proper" place. Cc: KY Srinivasan <kys@microsoft.com> Cc: Jiri Kosina <jikos@jikos.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: VME: Remove typedefsMartyn Welch2011-12-017-130/+107
| | | | | | | The use of typedefs is discouraged, remove them. Signed-off-by: Martyn Welch <martyn.welch@ge.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: hv: storvsc: Implement per device memory poolsK. Y. Srinivasan2011-12-011-44/+62
| | | | | | | | | | | | The current code implemented a per-HBA memory pool mechanism. For IDE disks managed by this driver, there is a one to one correspondance between the block device and the associated virtual HBA and since currently only IDE devices can be the boot device, this addressed the deadlock issues that were raised during the review process. This patch implements a per-lun memory pool mechanism. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: hv: storvsc: Fix a bug in copy_from_bounce_buffer()K. Y. Srinivasan2011-12-011-2/+22
| | | | | | | | Fix a bug in copy_from_bounce_buffer(). Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: hv: storvsc: Fix a bug in storvsc_command_completion()K. Y. Srinivasan2011-12-011-3/+2
| | | | | | | | | Fix a bug in storvsc_command_completion() that leaks memory when scatter/gather lists are used on the "write" side. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: hv: storvsc: Cleanup storvsc_device_alloc()K. Y. Srinivasan2011-12-011-5/+0
| | | | | | | | | | The code in storvsc_device_alloc() is not needed as this would be done by default. Get rid of it. We still keep the function as we use this hook to allocate per-LUN memory pools in a later patch. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: hv: storvsc: Disable clusteringK. Y. Srinivasan2011-12-011-17/+1
| | | | | | | | | | | | Disable clustering, since the host side on Hyper-V requires that each I/O element not exceed the page size. As part of this cleanup, get rid of the function to merge bvecs, as the primary reason for this function was to avoid having an element exceed the page size. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* net/hyperv: Add support for promiscuous mode settingHaiyang Zhang2011-12-013-25/+68
| | | | | | | | | Add code to accept promiscuous mode setting, and pass it to RNDIS filter. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
OpenPOWER on IntegriCloud