Greg Kroah-Hartman [Thu, 19 Jan 2017 09:40:44 +0000 (10:40 +0100)]
Merge tag 'iio-for-4.11a' of git://git./linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
First round of new device support, features and cleanups for IIO in the 4.11 cycle.
It's shaping to be another fairly busy cycle. Lots more on the way!
New device support
* ads7950
- new driver supporting ads7950, ads7951, ads7952, ads7953, ads7954,
ads7955, ads7956, ads7957, ads7958, ads7959, ads7960, and ads7961 ADCs.
* cm3605
- New driver for this light sensor and proximity sensor which is an
analog part with some additional digital controls.
* hx711
- New driver.
Core new stuff
* Gravity sensor type. This is a processed datastream in which the device
will try to work out which way is down.
* Split the buffer.h file into two parts. One provides the interface to 'use'
a buffer, the second provides the internals of the buffer functionality as
needed by implementations of buffers.
- Move documentation inline so as to allow use of private: tag when
generating documentation.
- Add some utility functions for the few things that are directly done
with the buffers.
- Stop exporting functions that no-one uses outside of the core code.
- Push docs down by the code in the c file where they should have always
been.
- Fix typo in kernel-doc for buffer.
- push down some includes that were previously happening implicitly.
- stop enabling the timestamp of the dummy device.
Features and cleanups
* ad5592r
- ACPI support
* ad5593r
-ACPI support.
* ad5933
- Fix a false comment about size of a particular register.
* ad7150
- replace S_IRUGO | S_IWUSR with 0644. I'm not that keen on these patches
in general, but as it was nicely presented I took this one anyway. As a
general rule will only take these as part of a larger driver cleanup.
- don't eat an error but rather reutnr it in the write_event_config callback.
* ad7606
- replace non standard range attibute with _scale
*
ade7753
- use usleep_range for short sleeps
*
ade7754
- use usleep_range for short sleeps
*
ade7758
- use usleep_range for short sleeps
*
ade7759
- use usleep_range for short sleeps
*
ade7854
- use usleep_range for short sleeps
* adis16201
- fix description
* adis16203
- fix description
- fix copyright year
* adis16209
- fix description
* adt7316
- Add braces to arms of if else statement (for consistency)
- Alignment fixes.
* axp288
- Fix up an issue with accidental overwrites of data.
* bmi160
- add deivce tables for i2c and spi to support correctly identifying the
full dt name (including manufacturer).
- device tree binding.
* bmp280
- use usleep_range for short sleeps.
* cm3232
- return error from cm3232_reg_init rather than eating it if the last write
fails.
* dummy driver
- remove a semicolor found at end of a function defintition.
* exynos-adc
- use usleep_range for short sleeps.
* hid-sensor (accel)
- Add timestamp support. The hardware can provide timestamps so lets support
them. If not fall back to timestamps estimated in kernel.
* hid-sensor (light)
- Add a duplicate ID for the light channels so as to keep existing interface
whilst also using the more standard IIO interface.
* hts221
- acpi probing
* imx25-gcq
- Add a macro call to allow this driver to be automatically loaded.
* isl29028
- reorganise code to avoid deep nesting of if statements.
- move chip test and default regs into a function suitable or sharing with
power management code.
- tidy up some code alignment.
* lidar-lite-v3
- introduce compatible strings that make it clear Garmin have consideral
friends.
* mma8452
- avoid returning signed value when unsigned is appropriate
* spmi-vadc
- Update function for generic voltage conversion to take into account that
different channels on this device should be handled differently.
- Rework code to allow per channel voltage scaling and support the standard
options for this hardware.
- Fixup three minor issues with the above patches for this part. These all
effect test builds rather than the native builds for the part, but good to
clean them up anyway.
* st_sensors
- support device matching from the ACPI DST tables.
- acpi based probing for accelerometers
- acpi based probing for pressure sensors
- Allow pressure sensors to read negative values.
- Export sampling frequency for lps25h and lps331ap.
- Add support for the old DT bindings from the period when these deivces
were often supported through windows.
Docs fixup:
* typo in sysfs-bus-iio
Ivan Safonov [Thu, 12 Jan 2017 09:16:57 +0000 (12:16 +0300)]
staging:r8188eu: remove unused rx_head member of struct recv_frame
Value of rx_head member of struct recv_frame does not used. Remove it.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ivan Safonov [Thu, 12 Jan 2017 09:16:56 +0000 (12:16 +0300)]
staging:r8188eu: remove unnecessary trace output in rtw_recv_indicatepkt()
Trace output for each received packet in rtw_recv_indicatepkt() is redudant.
Remove it.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ivan Safonov [Thu, 12 Jan 2017 09:16:55 +0000 (12:16 +0300)]
staging:r8188eu: remove unused struct wifidirect_info and all corresponding code
wifidirect_info structure is unused.
Big amount of another definitions used only for wifidirect_info definition.
Remove all.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ivan Safonov [Thu, 12 Jan 2017 09:16:54 +0000 (12:16 +0300)]
staging:r8188eu: remove unused get_rxmem()
get_rxmem() is not unused, remove it.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ivan Safonov [Thu, 12 Jan 2017 09:16:53 +0000 (12:16 +0300)]
staging:r8188eu: remove unused EOR macro
EOR macro is not unused, remove it.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ivan Safonov [Thu, 12 Jan 2017 09:16:52 +0000 (12:16 +0300)]
staging:r8188eu: remove unused WPA_(GET|PUT)_(BE|LE)_xx macro
WPA_(GET|PUT)_(BE|LE)_xx macros are unused, remove it.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ivan Safonov [Thu, 12 Jan 2017 09:16:51 +0000 (12:16 +0300)]
staging:r8188eu: remove unused (GET|PUT)U32 macros
(GET|PUT)U32 macros are unused, remove it.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bogdan Purcareata [Thu, 12 Jan 2017 22:01:56 +0000 (00:01 +0200)]
staging: android/ion: Use variable names in header
Populate header function signatures with variable names as well, not
just variable types.
Signed-off-by: Bogdan Purcareata <bogdan.purcareata@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bogdan Purcareata [Thu, 12 Jan 2017 22:01:55 +0000 (00:01 +0200)]
staging: android/ion: Align comment mark
Fix missing space right before multiple line comment closing.
Signed-off-by: Bogdan Purcareata <bogdan.purcareata@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bogdan Purcareata [Thu, 12 Jan 2017 22:01:54 +0000 (00:01 +0200)]
staging: android/ion: Don't use return in void function
Return statements are superfluous in void functions, and checkpatch
complains about them too.
Remove offending return.
Signed-off-by: Bogdan Purcareata <bogdan.purcareata@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bogdan Purcareata [Thu, 12 Jan 2017 22:01:53 +0000 (00:01 +0200)]
staging: android/ion: Split function call
Fix checkpatch error of line exceeding 80 characters.
Signed-off-by: Bogdan Purcareata <bogdan.purcareata@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Thu, 12 Jan 2017 03:38:38 +0000 (21:38 -0600)]
staging:wilc1000:wilc_sdio.c Deleted un-needed blank lines
Fixes checkpatch CHECK:
Blank lines aren't necessary before a close brace '}'
Please don't use multiple blank lines
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Thu, 12 Jan 2017 03:38:37 +0000 (21:38 -0600)]
staging:wilc1000:wilc_sdio.c Aligns code match open parenthesis
Fixes checkpatch CHECK: Alignment should match open parenthesis
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Thu, 12 Jan 2017 03:38:36 +0000 (21:38 -0600)]
staging:wilc1000:wilc_debugfs.c Removes multiple blank lines
Fixes checkpatch CHECK: Please don't use multiple blank lines
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Thu, 12 Jan 2017 03:38:35 +0000 (21:38 -0600)]
staging:wilc1000:wilc_debugfs.c Aligns code to match open parenthesis
Fixes checkpatch CHECK: Alignment should match open parenthesis
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Thu, 12 Jan 2017 03:38:34 +0000 (21:38 -0600)]
staging:wilc1000:linux_wlan.c Align code to match open parenthesis
Fixes checkpatch CHECK: Alignment should match open parenthesis
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Thu, 12 Jan 2017 03:38:33 +0000 (21:38 -0600)]
staging:wilc1000:host_interface.c Added braces {} on else statemement
Fixes checkpatch warning: braces {} should be used on all arms of
this statement
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Thu, 12 Jan 2017 03:38:32 +0000 (21:38 -0600)]
staging:wlan-ng:cfg80211.c Aligned code with open parenthesis
Fixed Alignment should match open parenthesis checkpatch CHECK.
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Shyam Saini [Sun, 15 Jan 2017 12:51:46 +0000 (18:21 +0530)]
staging: rtl8192e: rtl8192e: Remove NULL test before vfree
vfree frees the virtually continuous block of memory beginning at addr.
If addr is NULL, no operation is performed. So, NULL test is not needed
before vfree.
Signed-off-by: Shyam Saini <mayhs11saini@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Kartikey Singh [Sun, 15 Jan 2017 12:03:45 +0000 (17:33 +0530)]
drivers: staging: rtl8188eu: include: wifi: Removed unnecessary defined macros
Removed macros not in use.
Signed-off-by: Kartikey Singh <dr.kartikeynrc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Derek Robson [Sun, 15 Jan 2017 07:16:38 +0000 (20:16 +1300)]
Drivers: staging: rtl8192e: style fix, octal file permissions
Changed file permissions to octal.
Found with checkpatch.
Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Wed, 11 Jan 2017 04:34:17 +0000 (22:34 -0600)]
staging:vt6656:mac.c Aligned to match open parenthesis
Fixes checkpatch warning: Alignment should match open parenthesis
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Eric Salem [Wed, 11 Jan 2017 04:48:51 +0000 (22:48 -0600)]
staging: wlan-ng: Fix sparse warnings about endianness
Fixed sparse warnings about endianness. E.g.:
warning: cast to restricted __le16
Signed-off-by: Eric Salem <ericsalem@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Arnd Bergmann [Wed, 11 Jan 2017 14:53:08 +0000 (15:53 +0100)]
staging: rtl: fix possible NULL pointer dereference
gcc-7 detects that wlanhdr_to_ethhdr() in two drivers calls memcpy() with
a destination argument that an earlier function call may have set to NULL:
staging/rtl8188eu/core/rtw_recv.c: In function 'wlanhdr_to_ethhdr':
staging/rtl8188eu/core/rtw_recv.c:1318:2: warning: argument 1 null where non-null expected [-Wnonnull]
staging/rtl8712/rtl871x_recv.c: In function 'r8712_wlanhdr_to_ethhdr':
staging/rtl8712/rtl871x_recv.c:649:2: warning: argument 1 null where non-null expected [-Wnonnull]
I'm fixing this by adding a NULL pointer check and returning failure
from the function, which is hopefully already handled properly.
This seems to date back to when the drivers were originally added,
so backporting the fix to stable seems appropriate. There are other
related realtek drivers in the kernel, but none of them contain a
function with a similar name or produce this warning.
Cc: stable@vger.kernel.org
Fixes:
1cc18a22b96b ("staging: r8188eu: Add files for new driver - part 5")
Fixes:
2865d42c78a9 ("staging: r8712u: Add the new driver to the mainline kernel")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Javier Rodriguez [Wed, 11 Jan 2017 21:59:06 +0000 (22:59 +0100)]
staging: rtl8192u: Removed multiple white lines.
Remove one unnecessary white line.
Signed-off-by: Javier Rodriguez <jrodbar@yahoo.es>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Javier Rodriguez [Wed, 11 Jan 2017 21:59:05 +0000 (22:59 +0100)]
staging: rtl8192u: Add character '*' in all lines of the block comments.
Correct code style error. Add a character in every line of the
comment block.
Signed-off-by: Javier Rodriguez <jrodbar@yahoo.es>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Derek Robson [Sun, 15 Jan 2017 00:53:58 +0000 (13:53 +1300)]
Staging: media: davinci_vpfe: style fix, using octal file permissions
Change file permissions to octal style.
Found using checkpatch.
Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Wittman [Sat, 14 Jan 2017 23:26:07 +0000 (17:26 -0600)]
staging: ks7010: Fix brace style issue in ks_wlan_net.c
This change fixes a checkpatch error for "that open brace { should be
on the previous line" as well as a related spacing warning.
Signed-off-by: David Wittman <dwittman@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Omri Arad [Sat, 14 Jan 2017 16:58:02 +0000 (18:58 +0200)]
drivers: staging: rts5208: fix endianness handling
'cb' and 'sgb' were assigned __le values but were not marked as such,
this fixes the following sparse warnings:
drivers/staging/rts5208/rtsx_transport.c:220:34: warning: incorrect type in assignment (different base types)
drivers/staging/rts5208/rtsx_transport.c:220:34: expected unsigned int [unsigned] [usertype] <noident>
drivers/staging/rts5208/rtsx_transport.c:220:34: got restricted __le32 [usertype] <noident>
drivers/staging/rts5208/rtsx_transport.c:319:44: warning: incorrect type in assignment (different base types)
drivers/staging/rts5208/rtsx_transport.c:319:44: expected unsigned long long [unsigned] [long] [long long] [usertype] <noident>
drivers/staging/rts5208/rtsx_transport.c:319:44: got restricted __le64 [usertype] <noident>
drivers/staging/rts5208/rtsx_transport.c:319:44: warning: incorrect type in assignment (different base types)
drivers/staging/rts5208/rtsx_transport.c:319:44: expected unsigned long long [unsigned] [long] [long long] [usertype] <noident>
drivers/staging/rts5208/rtsx_transport.c:319:44: got restricted __le64 [usertype] <noident>
Signed-off-by: Omri Arad <omriarad3@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philip Thiemann [Thu, 12 Jan 2017 13:00:26 +0000 (14:00 +0100)]
staging: vme: vme_user.c: fix warning 'line over 80 characters'
Removed checkpatch.pl warning 'line over 80 characters' by inserting a
linebreak in the comment line 50.
Signed-off-by: Philip Thiemann <philip.thiemann@fau.de>
Signed-off-by: Fabian Arnold <fabian.arnold@fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Eric Salem [Wed, 11 Jan 2017 01:38:35 +0000 (19:38 -0600)]
staging: most: hdm-usb: Fix mismatch between types used in sizeof operator
Fixed mismatch between types used in sizeof operator.
Signed-off-by: Eric Salem <ericsalem@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Roman Sommer [Fri, 13 Jan 2017 20:54:51 +0000 (21:54 +0100)]
staging: greybus: fix checkpatch unsigned warnings
Fix checkpatch warnings for parameter type unsigned in greybus.
Note that this patch does not fix all checkpatch warnings for the
affected files.
Signed-off-by: Christian Bewermeyer <christian.bewermeyer@fau.de>
Signed-off-by: Roman Sommer <roman.sommer@fau.de>
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Abdul Rauf [Wed, 11 Jan 2017 00:55:59 +0000 (00:55 +0000)]
staging: greybus: fix checkpatch braces not necessary warning
Fix the following warnings:
braces {} are not necessary for any arm of this statement
Signed-off-by: Abdul Rauf <abdulraufmujahid@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Abdul Rauf [Wed, 11 Jan 2017 01:29:36 +0000 (01:29 +0000)]
staging: greybus: loopback_test: fix checkpatch bad function definition error
Fix the following Errors:
Bad function definition - void abort() should probably be void abort(void)
Signed-off-by: Abdul Rauf <abdulraufmujahid@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Derek Robson [Thu, 12 Jan 2017 04:59:40 +0000 (17:59 +1300)]
Staging: greybus: style fix, permissions as octal
Changed permissions to be in octal style.
Found by checkpatch.
Signed-off-by: Derek Robson <robsonde@gmail.com>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Sun, 15 Jan 2017 08:14:07 +0000 (11:14 +0300)]
staging: lustre: ptlrpc: silence a shift wrapping warning
"svcpt->scp_hist_seq" is a u64 so static checkers complain that 1U
should be 1ULL. I looked at REQS_SEQ_SHIFT() a little and it seems to
be capped by the number of CPUs online and the amount of memory, but I
think it could go above 32 possibly.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jonathan Cameron [Sun, 8 Jan 2017 19:52:25 +0000 (19:52 +0000)]
iio:adc:qcom-spmi-vadc: use div64_s64 instead of direct 64 bit division.
Another one of these that we missed previously which prevents test builds
of this driver on 32 bit platforms as it gives an undefined __divdi3 warning.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Jonathan Cameron [Fri, 30 Dec 2016 18:25:50 +0000 (18:25 +0000)]
iio:adc:qcom-spmi-vadc silence a long constant warning.
It is meant to be long and is only added to an s64.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Cc: Rama Krishna Phani A <rphani@codeaurora.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Jonathan Cameron [Fri, 30 Dec 2016 18:25:49 +0000 (18:25 +0000)]
iio:adc:qcom-spmi-vadc : fix undefined __divdi3
A simple do_div call works here as all the signed 64 bit is
actually small and unsigned at this point, and the numerator is
u32.
Introduce a temporary u64 variable to avoid type comparison warnings
on some architectures.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Rama Krishna Phani A <rphani@codeaurora.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Andreas Klinger [Thu, 5 Jan 2017 17:51:57 +0000 (18:51 +0100)]
iio: adc: hx711: Add IIO driver for AVIA HX711
This is the IIO driver for AVIA HX711 ADC which is mostly used in weighting
cells.
The protocol is quite simple and using GPIOs:
One GPIO is used as clock (SCK) while another GPIO is read (DOUT)
The raw value read from the chip is delivered.
To get a weight one needs to subtract the zero offset and scale it.
Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Andreas Klinger [Thu, 5 Jan 2017 17:51:36 +0000 (18:51 +0100)]
iio: adc: hx711: Add DT binding for avia,hx711
Add DT bindings for avia,hx711
Add vendor avia to vendor list
Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Hans de Goede [Wed, 14 Dec 2016 13:55:25 +0000 (14:55 +0100)]
iio: adc: axp288: Drop bogus AXP288_ADC_TS_PIN_CTRL register modifications
For some reason the axp288_adc driver was modifying the
AXP288_ADC_TS_PIN_CTRL register, changing bits 0-1 depending on
whether the GP_ADC channel or another channel was written.
These bits control when a bias current is send to the TS_PIN, the
GP_ADC has its own pin and a separate bit in another register to
control the bias current.
Not only does changing when to enable the TS_PIN bias current
(always or only when sampling) when reading the GP_ADC make no sense
at all, the code is modifying these bits is writing the entire register,
assuming that all the other bits have their default value.
So if the firmware has configured a different bias-current for either
pin, then that change gets clobbered by the write, likewise if the
firmware has set bit 2 to indicate that the battery has no thermal sensor,
this will get clobbered by the write.
This commit fixes all this, by simply removing all writes to the
AXP288_ADC_TS_PIN_CTRL register, they are not needed to read the
GP_ADC pin, and can actually be harmful.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Scott Matheina [Wed, 4 Jan 2017 01:50:24 +0000 (19:50 -0600)]
staging:iio:addac:adt7316 Fixes Alignment should match open parenthesis
Fixes style issue where Alignment doesn't match open parenthesis
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Javier Martinez Canillas [Mon, 2 Jan 2017 12:45:45 +0000 (09:45 -0300)]
iio: adc: imx25-gcq: Fix module autoload
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.
Export the module alias information using the MODULE_DEVICE_TABLE() macro.
Before this patch:
$ modinfo drivers/iio/adc/fsl-imx25-gcq.ko | grep alias
$
After this patch:
$ modinfo drivers/iio/adc/fsl-imx25-gcq.ko | grep alias
alias: of:N*T*Cfsl,imx25-gcqC*
alias: of:N*T*Cfsl,imx25-gcq
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Jonathan Cameron [Mon, 2 Jan 2017 19:28:34 +0000 (19:28 +0000)]
iio:buffer.h - split into buffer.h and buffer_impl.h
buffer.h supplies everything needed for devices using buffers.
buffer_impl.h supplies access to the internals as needed to write
a buffer implementation.
This was really motivated by the mess that turned up in the
kernel-doc documentation pulled in by the new sphinx docs.
It made it clear that our logical separations in headers were
generally terrible. The buffer case was easy to sort out without
greatly effecting drivers so here it is.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Jonathan Cameron [Mon, 2 Jan 2017 19:28:33 +0000 (19:28 +0000)]
iio:dummy: Stop enabling timestamp by default.
It's bad practice and only done in this fake driver + it breaks my
attempt to take struct buffer opaque. Not worth an access function
as it shouldn't be done anyway.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Jonathan Cameron [Mon, 2 Jan 2017 19:28:32 +0000 (19:28 +0000)]
iio:buffer: Push implementation of iio_device_attach_buffer into .c file
This is a precursor to the splitting of buffer.h into parts relevant
to buffer implementation vs those for devices using buffers.
struct buffer is about to become opaque as far as the header is
concerned.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Jonathan Cameron [Mon, 2 Jan 2017 19:28:31 +0000 (19:28 +0000)]
iio:buffer.h include pushdown into buffer implementations
These were only getting access to the internals of struct iio_dev via
the include of iio.h within buffer.h. This should always have been
explicitly included by the buffer implementations themselves.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Jonathan Cameron [Mon, 2 Jan 2017 19:28:30 +0000 (19:28 +0000)]
iio:kfifo_buf header include push down.
As a precursor to splitting buffer.h, lets make sure all drivers
include the relevant headers rather than relying on picking them
up from kfifo_buf.h.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Jonathan Cameron [Mon, 2 Jan 2017 19:28:29 +0000 (19:28 +0000)]
iio:buffer:iio_push_to_buffers_with_timestamp fix kernel-doc.
Wrong start of kernel doc comment /* -> /**
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Jonathan Cameron [Mon, 2 Jan 2017 19:28:28 +0000 (19:28 +0000)]
iio:buffers: Push some docs down into the .c file.
Ancient legacy of me doing it wrong which it is nice to clear
up whilst we are here.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Jonathan Cameron [Mon, 2 Jan 2017 19:28:27 +0000 (19:28 +0000)]
iio:buffer: Stop exporting iio_scan_mask_query
Nothing uses it outside of core code.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Jonathan Cameron [Mon, 2 Jan 2017 19:28:26 +0000 (19:28 +0000)]
iio:buffer: Introduced a function to assign the buffer specific attrs.
This is a necessary step in taking the buffer implementation
opaque.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Jonathan Cameron [Mon, 2 Jan 2017 19:28:25 +0000 (19:28 +0000)]
iio:buffer.h Reformat structure comments to be inline.
This should make it easier to see how the structure is split into
public and private parts - reflected in the generated documentation.
Deliberately use /* instead of /** for the private elements to avoid
warnings when kernel-doc script runs.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Jonathan Cameron [Mon, 2 Jan 2017 19:28:24 +0000 (19:28 +0000)]
iio:buffer: Stop exporting iio_update_demux
Nothing outside of indiustrialio-buffer.c should be using this.
Requires a large amount of juggling of functions to avoid a
forward definition.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Linus Walleij [Thu, 5 Jan 2017 13:32:33 +0000 (14:32 +0100)]
iio: accel: st_accel: handle deprecated bindings
The earlier deployed LIS3LV02DL driver had already defined a few
DT bindings that need to be supported by the new more generic
driver and listed as compatible but deprecated bindings in the
documentation.
After this we can start to activate the new driver with the old
systems where applicable.
As part of this enablement: make us depend on the old drivers
not being in use so we don't get a kernel with two competing
drivers.
Cc: devicetree@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Scott Matheina [Tue, 10 Jan 2017 04:42:53 +0000 (22:42 -0600)]
staging:vt6656:main_usb.c Removed un-needed blank lines
Fixed the following checkpatch warnings by deleting blank lines
Blank lines aren't necessary before a close brace '}'
Blank lines aren't necessary after an open brace '{'
Please don't use multiple blank lines
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Tue, 10 Jan 2017 04:42:52 +0000 (22:42 -0600)]
staging:vt6656:main_usb.c Aligned code to match open parenthesis
Fixed Alignment should match open parenthesis from checkpatch
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Tue, 10 Jan 2017 04:42:51 +0000 (22:42 -0600)]
staging:vt6656:mac.c Aligned code to match open parenthesis
Fixed Alignment should match open parenthesis checkpatch CHECK
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Tue, 10 Jan 2017 04:42:50 +0000 (22:42 -0600)]
staging:vt6656:key.c Aligned code with open parenthesis
Fixed Alignment should match open parenthesis checkpatch CHECK
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sun, 8 Jan 2017 18:15:18 +0000 (18:15 +0000)]
staging: vc04_services: Fix space issues
This fixes the space coding styles issues complained by checkpatch.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sun, 8 Jan 2017 18:15:17 +0000 (18:15 +0000)]
staging: vc04_services: Fix indentation
This should fix the indentation issues found by checkpatch.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sun, 8 Jan 2017 18:15:16 +0000 (18:15 +0000)]
staging: vc04_services: Drop vchiq_2835.h
There is no need for a vchiq_2835.h with its 2 local defines.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sun, 8 Jan 2017 18:15:15 +0000 (18:15 +0000)]
staging: vc04_services: Improve readability of kthread names
This patch tries to make the kernel thread names of vchiq a little
bit more self explaining and look closer to the existing ones:
slot handler: VCHIQ-%d -> vchiq-slot/%d
recycle thread: VCHIQr-%d -> vchiq-recy/%d
sync thread: VCHIQs-%d -> vhciq-sync/%d
keep-alive thread: VCHIQka-%d -> vchiq-keep/%d
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sun, 8 Jan 2017 18:15:14 +0000 (18:15 +0000)]
staging: vc04_services: Use preferred kernel types
This patch fixes issues reported by checkpatch.pl about preferred
kernel types.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sun, 8 Jan 2017 18:15:13 +0000 (18:15 +0000)]
staging: vchiq_core: make local spinlock static
The quota_spinlock is only local. So make it static.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sun, 8 Jan 2017 18:15:11 +0000 (18:15 +0000)]
staging: vchiq_core: remove unused variable type
This variable is assigned a value, but never used. So remove it.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sun, 8 Jan 2017 18:15:12 +0000 (18:15 +0000)]
staging: vc04_services: make local functions static
The functions vchiq_dump_shared_state() and vchiq_is_connected() are only
used locally. So make them static.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sun, 8 Jan 2017 18:15:10 +0000 (18:15 +0000)]
staging: vchiq_arm: remove vchiq_platform_check_resume
This function is never used, so we could remove it.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Yamanappagouda Patil [Sat, 7 Jan 2017 14:55:42 +0000 (20:25 +0530)]
staging: rtl8188eu: fixed 'braces are not necessary for single statement blocks'.
Fixed checkpatch.pl warnings in rtl8188eu module core folder files.
Signed-off-by: Yamanappagouda Patil <goudapatilk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Tue, 10 Jan 2017 02:23:27 +0000 (20:23 -0600)]
staging:sm750fb:ddk750_chip.c removes un-necessary blank lines
Fixes checkpatch warning - Please don't use multiple blank lines
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Tue, 10 Jan 2017 02:23:26 +0000 (20:23 -0600)]
staging:sm750fb:ddk750_chip.c Adds braces to last arm of statement
Fixes absence of braces on last arm of statement, identified by
checkpatch
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Tue, 10 Jan 2017 02:10:00 +0000 (20:10 -0600)]
staging:rtl8192u:r819xU_cmdpkt.c Removes un-necessary blank lines
Fixes checkpatch.pl warning - Blank lines aren't necessary before a
close brace '}' & Please don't use multiple blank lines
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Tue, 10 Jan 2017 02:09:59 +0000 (20:09 -0600)]
staging:rtl8192u:r819xU_cmdpkt.c Fix Alignment should match open parenthesis
Fixes Alignment should match open parenthesis in checkpatch
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Emmanuil Chatzipetru [Sun, 8 Jan 2017 13:37:07 +0000 (14:37 +0100)]
staging: olpc_dcon: olpc_dcon_xo_1_5: Remove multiple blank lines.
This issue is caught by checkpatch.pl and is related to the following
warning:
- CHECK: Please don't use multiple blank lines
Signed-off-by: Emmanuil Chatzipetru <chatzi.emanuel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Emmanuil Chatzipetru [Sun, 8 Jan 2017 13:37:06 +0000 (14:37 +0100)]
staging: olpc_dcon: olpc_dcon: Fix spaces between operator and variables.
This issue is caught by checkpatch.pl and is related to the following
warning:
- CHECK: spaces preferred around that '/' (ctx:VxV)
Signed-off-by: Emmanuil Chatzipetru <chatzi.emanuel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Emmanuil Chatzipetru [Sun, 8 Jan 2017 13:37:05 +0000 (14:37 +0100)]
staging: olpc_dcon: olpc_dcon_xo_1_5: Remove redundant return statement.
dcon_was_irq(); should return a boolean value if PMIO_Rx50[6] is either
set or unset, which is evaluated in the first return statement. Therefore,
the following return statement is redundant and thus, removed.
Signed-off-by: Emmanuil Chatzipetru <chatzi.emanuel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Emmanuil Chatzipetru [Sun, 8 Jan 2017 13:37:04 +0000 (14:37 +0100)]
staging: olpc_dcon: olpc_dcon: Fix open parenthesis alignment.
This issue is caught by checkpatch.pl and is related to the following
warning:
- CHECK: Alignment should match open parenthesis
Signed-off-by: Emmanuil Chatzipetru <chatzi.emanuel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Abdul Rauf [Sun, 8 Jan 2017 02:45:59 +0000 (02:45 +0000)]
staging: sm750fb: fix checkpatch 80 characters warning
Fix the following warnings:
line over 80 characters
Signed-off-by: Abdul Rauf <abdulraufmujahid@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Abdul Rauf [Sun, 8 Jan 2017 02:45:22 +0000 (02:45 +0000)]
staging: sm750fb: fix checkpatch multiple blank lines check
Fix the following checks:
Please don't use multiple blank lines
Signed-off-by: Abdul Rauf <abdulraufmujahid@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cheah Kok Cheong [Sat, 7 Jan 2017 11:13:12 +0000 (19:13 +0800)]
Staging: comedi: comedi_fops: Remove unused stat.h header
Unused after commit
6e3029397698 ("staging: comedi: comedi_fops:
coding style fixes") - Fixed coding style in comedi_fops.c
Symbolic to octal permission.
Anyway it's included in module.h
Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cheah Kok Cheong [Sat, 7 Jan 2017 11:13:11 +0000 (19:13 +0800)]
Staging: comedi: comedi_fops: Remove unused vmalloc.h header
Unused after commit
d18431325be0 ("staging: comedi:
deprecate loading firmware with comedi_config").
Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cheah Kok Cheong [Sat, 7 Jan 2017 11:13:10 +0000 (19:13 +0800)]
Staging: comedi: comedi_fops: Remove redundant init.h header
After commit
0fd972a7d91d ("module: relocate module_init
from init.h to module.h"), including module.h will do and
init.h is also thrown in.
Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cheah Kok Cheong [Sat, 7 Jan 2017 11:13:09 +0000 (19:13 +0800)]
Staging: comedi: comedi_fops: Remove unused kmod.h header
Unused after commit
f30f2c2d417b ("staging: comedi:
remove check for CONFIG_KMOD").
Anyway it's included in module.h
Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 4 Jan 2017 10:55:47 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: use pci_id_table 'driver_data'
The driver's COMEDI "auto-attach" handler `db2k_auto_attach()` calls
`db2k_find_boardinfo()` to find an element of our board information
array `db2k_boardtypes[]` that matches the probed PCI device. The
driver's PCI device table matches several boards in the DaqBoard/2000
series that match a single PCI vendor and device ID combination.
`db2k_find_boardinfo()` uses the probed PCI device's subvendor and
subdevice IDs to find the matching board information, returning `NULL`
for no match.
Change the driver's PCI device table `db2k_pci_table[]` to match
supported PCI vendor, device, subvendor and subdevice IDs, and set the
`.driver_data` member of each element to the index of the matching
element of `db2k_boardtypes[]`. That index gets passed through to the
COMEDI auto-attach handler `db2k_auto_attach()`. Use it to index
directly into `db2k_boardtypes[]` instead of calling
`db2k_find_boardinfo()` to find the match.
Use array index designators in the initializer of `db2k_boardtypes[]`.
Use enumerated constants defined by new type `enum db2k_boardids` to
name the board type indices.
The `id` member of `struct db2k_boardtype` is no longer used, so remove
it. Also remove the subdevice ID macros `DB2K_SUBSYSTEM_IDS2` and
`DB2K_SUBSYSTEM_IDS4` as the subdevice IDs are now specified as numbers
in the PCI device table. Remove `db2k_find_boardinfo()` as it is no
longer used.
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>
Ian Abbott [Wed, 4 Jan 2017 10:55:46 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: change COMEDI device names
The COMEDI device name strings are currently set to "ids2" for the
DaqBoard/2000, and to "ids4" for the DaqBoard/2001. Change them to
"daqboard2000" and "daqboard2001" respectively. (The COMEDI driver name
string is also "daqboard2000".)
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>
Ian Abbott [Wed, 4 Jan 2017 10:55:45 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: support 4 AO channels
The driver supports DaqBoard/2000 and DaqBoard/2001. DaqBoard/2000 has 2
AO channels, but DaqBoard/2001 has 4 AO channels. The driver currently
only supports 2 AO channels, but supporting 4 channels is just a case of
setting the `n_chan` member of the COMEDI subdevice to 4 instead of 2.
Add a new boolean flag member `has_2_ao` to `struct db2k_boardtype` to
be set to `true` if the board only has 2 AO channels. Set this to
`true` in the element of `db2k_boardtypes[]` that corresponds to the
DaqBoard/2000. Use it in `db2k_auto_attach()` to initialize the number
of AO channels to 2 or 4, as appropriate.
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>
Ian Abbott [Wed, 4 Jan 2017 10:55:44 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: use designated initializers
Replace the undesignated initializers for each element of
`db2k_boardtypes[]` with an equivalent designated initializer for ease
of future maintenance.
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>
Ian Abbott [Wed, 4 Jan 2017 10:55:43 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: use shorter, consistent prefix
Use a consistent prefix of `db2k_` or `DB2K_` for identifiers. The
existing prefixes `DAQBOARD2000_` and `daqboard2000_` are a bit on the
lengthy side.
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>
Ian Abbott [Wed, 4 Jan 2017 10:55:42 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: remove unused 'card' member
The `card` member of `struct daqboard2000_private` and the enumerated
constant `card_daqboard_2000` are not used. Remove them.
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>
Ian Abbott [Wed, 4 Jan 2017 10:55:41 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: check CPLD status before writing firmware data
According to an old GPL'ed driver at
<ftp://ftp.mccdaq.com/downloads/iotech_software/DaqBoard_1000_2000_Series/Linux_driver_kernelv2.4.x/>,
The CPLD status register can be checked to make sure that it is ready to
accept the next 16-bit word of FPGA firmware data, but that doesn't work
on older versions of the CPLD, where a simple delay should be used
between successive writes. The current version of the Comedi driver
just uses a delay between successive writes. Change it to check for the
newer CPLD in the `daqboard2000_load_firmware()`, and change the
firmware word writing function `daqboard2000_write_cpld()` to wait for
the status bit (`DB2K_CPLD_STATUS_TXREADY`, previously called
`DB2K_CPLD_TXDONE`) to be set for newer CPLD, or just delay for older CPLD.
Return an error if it times out waiting for the status bit.
The wait for the `DB2K_CPLD_STATUS_TXREADY` status bit to be set is
performed by new function `daqboard2000_wait_cpld_txready()`, which
returns 0 if the status bit is set within 100 microseconds, or
`-ETIMEDOUT` if not.
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>
Ian Abbott [Wed, 4 Jan 2017 10:55:40 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: check result of FPGA programming
According to an old, GPL'ed Linux driver at
<ftp://ftp.mccdaq.com/downloads/iotech_software/DaqBoard_1000_2000_Series/Linux_driver_kernelv2.4.x/>,
after programming the FPGA, the General Purpose Input (USERI) of the PLX
PCI-9080 should go high shortly after a valid FPGA bitstream has been
loaded. Add a new function `daqboard2000_wait_fpga_programmed()` to
wait for that, performing up to 200 checks over a 20 ms period (this is
loosely based on `pollFPGADone()` in the above-mentioned old driver).
Return 0 if the FPGA appears to have loaded successfully, or
`-ETIMEDOUT` if it runs out of checks. Call it from the firmware
loading callback `daqboard2000_load_firmware()` after writing the
firmware to the FPGA to check it is programmed successfully.
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>
Ian Abbott [Wed, 4 Jan 2017 10:55:39 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: change daqboard2000_write_cpld() return value
`daqboard2000_write_cpld()` currently returns 1 on success, or 0 on
failure. Change it to return 0 on success, or `-EIO` on failure.
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>
Ian Abbott [Wed, 4 Jan 2017 10:55:38 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: replace daqboard2000_poll_cpld()
`daqboard2000_poll_cpld()` waits for a specified status bit in the CPLD
status register to be set, giving up after 50 tries over a period of
about 5 milliseconds. It returns 1 if the status bit is set, otherwise
0. It is only ever called to check the "INIT" status bit. Replace it
with new function `daqboard2000_wait_cpld_init()`, which returns 0 if
the "INIT" status bit becomes set within 50 tries, or `-ETIMEDOUT` if
not set within 50 tries. The firmware loading callback
`daqboard2000_load_firmware()` may return the error result from
`daqboard2000_wait_cpld_init()` if it has used up all its firmware
loading attempts and that was the last error.
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>
Ian Abbott [Wed, 4 Jan 2017 10:55:37 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: check firmware length
Firmware files for DAQBoard/2000 have a header, which is skipped,
followed by a sequence of FPGA configuration bytes to be programmed in
pairs. The FPGA configuration bytes start with the sequence 0xff, 0x20.
Make the firmware loading callback function
`daqboard2000_load_firmware()` return an error `-EINVAL` if the FPGA
start sequence is not found, or the remaining length is not a multiple
of 2.
The firmware loading callback tries to program the FPGA up to 3 times
until it succeeds or it has tried too many times. Currently, it
searches for the FPGA start sequence in the firmware data each time
through the retry loop. Change it to adjust the start position and
length before entering the loop.
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>
Ian Abbott [Wed, 4 Jan 2017 10:55:36 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: use type 'u16' for CPLD data and status
The CPLD status and data registers used to load firmware are 16 bits
wide. Use the type `u16` to represent data and status values instead of
`int`.
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>
Ian Abbott [Wed, 4 Jan 2017 10:55:35 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: define macros for CPLD registers
The Daqboard/2000 uses a write-only data register and a read-only status
register in a pre-programmed CPLD device to program the main firmware on
the board. Both registers are at offset 0x1000 from PCI BAR 2. Define
macros for the register offsets. Rename the existing macros for the
status register values for consistency. (Two status bits are defined,
but the driver code only seems to use one of them.)
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>
Ian Abbott [Wed, 4 Jan 2017 10:55:34 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: use macros from "plx9080.h"
The Daqboard/2000 uses a PLX PCI-9080 chip to interface with the PCI
bus. The "daqboard2000" driver uses the PCI-9080 "CNTRL" register to
perform various tasks, but defines its own macros for the register
values. Use the macros from "plx9080.h" instead. The various functions
that change the CNTRL register just wiggle individual bits up and down,
but they ignore the current register value - the old macros defined the
full value to be written to the register. Change them to read and
modify the register value.
Also remove a read of the CNTRL register in `daqboard2000_auto_attach()`
where the value is just thrown away, as it seems to serve no purpose
there (such as flushing PCI writes).
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>
Markus Buettner [Mon, 9 Jan 2017 16:43:31 +0000 (17:43 +0100)]
staging: wlan-ng: remove unnecessary blank lines
checkpatch.pl complained about two unnecessary blank lines after an
opening '{' in prism2mib.c. Those were removed in order to get rid
of those warnings.
There are more issues pointed out by checkpatch.pl. Those require
additional work to be done.
Signed-off-by: Markus Buettner <markus.buettner@fau.de>
Signed-off-by: Artur Wasinger <artur.wasinger@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>