platform/kernel/linux-starfive.git
4 years agoMerge tag 'iio-for-5.5a-take3' of https://git.kernel.org/pub/scm/linux/kernel/git...
Greg Kroah-Hartman [Sun, 13 Oct 2019 08:59:05 +0000 (10:59 +0200)]
Merge tag 'iio-for-5.5a-take3' of https://git./linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

First set of IIO new device support, cleanups and features for the 5.5 cycle

Third version with the adis rework set dropped as better to just have
a fresh version of that at some future date.

The usual mixed backs of new device support being added to drivers,
long term reworks continuing and little per driver cleanups and
features.

Also a few trivial counter subsystem tidy ups on behalf of William.

Core new feature
* Device label support.  A long requested feature no one got around to
  implementing before.  Allows DT based provision of a 'label' that
  identifies a device uniquely within a system.  This differs from existing
  'name' which is meant to be the part number.
New device support
* ingenic-adc
  - Support for the JZ4770 SoC ADC including bindings.
* inv_mpu6050
  - Add support for magnetometer in MPU925x parts.
    Fiddly to do as this is actually a separate device sitting inside the
    package, but with the master device being able to schedule reads etc.
    Will only run if the auxiliary bus is not in use for any other devices.

Features
* ad7192
  - Userspace calibration controls to do zero and full scale.
* st_lsm6dsx
  - Enable latched interrupts by default for sensors events with related clear.
  - Motion events and related wakeup source.  This needed quite a bit of
    refactoring as well.

Cleanups and minor features
* ad7192
  - sysfs ABI docs
* ad7949
  - Remove code to readback configuration word as driver never actually enabled
    it.
  - Fix incorrect xfer length.  Not actually known to cause problems other
    than wasted bus usage.
* adis16080
  - Replace core mlock usage with local lock with more appropriate scope.
* adis16130
  - Remove pointless mlock usage.
* adis16240
  - Remove include of gpio.h as no gpio usage.
* atlas-ph-sensor
  - Improve logical ordering of buffer predisable / postenable functions.
    This is part of a longer term rework Alexandru is driving towards.
* bh1750
  - Fix up a static compiler warning and make the code more readable.
  - yaml conversion of binding + MAINTAINERS entry.
* bmp280
  - Drop a stray newline.
* cm36651
  - Drop a redundant assignment
* itg3200
  - Alignment cleanup.
* max31856
  - Add missing of_node and parent references, useful to identify the device.
* sc27xx_adc
  - Use devm_hwspin_lock_request_specific rather than local rolled version.
* stm32-lptimer counter
  - kernel-doc warning.
* stm32-timer counter
  - kernel-doc warning.
  - Alignment cleanup.
* sx9500
  - Improve logical ordering of buffer predisable / postenable functions.
    This is part of a longer term rework Alexandru is driving towards.
* tcs3414
  - Improve logical ordering of buffer predisable / postenable functions.
    This is part of a longer term rework Alexandru is driving towards.

* tag 'iio-for-5.5a-take3' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (41 commits)
  iio: pressure: bmp280: remove stray newline
  iio: adc: sc27xx: Use devm_hwspin_lock_request_specific() to simplify code
  iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position
  iio: gyro: clean up indentation issue
  counter: stm32: clean up indentation issue
  iio: proximity: sx9500: fix iio_triggered_buffer_{predisable,postenable} positions
  iio: core: Add optional symbolic label to device attributes
  dt-binding: iio: Add optional label property
  iio: gyro: adis16080: replace mlock with own lock
  counter: stm32-lptimer-cnt: fix a kernel-doc warning
  counter: stm32-timer-cnt: fix a kernel-doc warning
  iio: gyro: adis16130: remove mlock usage
  MAINTAINERS: add entry for ROHM BH1750 driver
  dt-bindings: iio: light: bh1750: convert bindings to yaml
  iio: imu: st_lsm6dsx: add motion report function and call from interrupt
  iio: imu: st_lsm6dsx: always enter interrupt thread
  iio: imu: st_lsm6dsx: add wakeup-source option
  iio: imu: st_lsm6dsx: add motion events
  iio: imu: st_lsm6dsx: move interrupt thread to core
  iio: imu: inv_mpu6050: add fifo support for magnetometer data
  ...

4 years agostaging: rtl8723bs: Remove comparison to NULL
Wambui Karuga [Thu, 10 Oct 2019 13:20:58 +0000 (16:20 +0300)]
staging: rtl8723bs: Remove comparison to NULL

Remove comparison to NULL in drivers/staging/rtl8723bs/core/rtw_ap.c:1449.
Issue found by checkpatch.pl

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Link: https://lore.kernel.org/r/20191010132058.20887-1-wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: fbtft: fbtft-core: Fix last line displayed on fbcon
Michael Hennerich [Fri, 11 Oct 2019 11:24:41 +0000 (14:24 +0300)]
staging: fbtft: fbtft-core: Fix last line displayed on fbcon

For the special case when fbtft_mkdirty() is called with with -1 for the y
coordinate, the height is truncated by 1.

This isn't required, and causes the last line to not update.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20191011112441.31003-1-alexandru.ardelean@analog.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: vc04_services: place the AND operator at the end of the previous line
Jules Irenge [Sat, 12 Oct 2019 15:18:05 +0000 (16:18 +0100)]
staging: vc04_services: place the AND operator at the end of the previous line

Place the AND logical operator at the end of the previous line;
to fix warning of "Logical continuations should be on the previous line".
 Issue detected by checkpatch tool.

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Link: https://lore.kernel.org/r/20191012151805.17988-1-jbi.octave@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoiio: pressure: bmp280: remove stray newline
Bartosz Golaszewski [Wed, 2 Oct 2019 08:57:58 +0000 (10:57 +0200)]
iio: pressure: bmp280: remove stray newline

Remove a stray newline from the probe callback.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: sc27xx: Use devm_hwspin_lock_request_specific() to simplify code
Baolin Wang [Fri, 27 Sep 2019 02:41:19 +0000 (10:41 +0800)]
iio: adc: sc27xx: Use devm_hwspin_lock_request_specific() to simplify code

Change to use devm_hwspin_lock_request_specific() to help to simplify the
cleanup code for drivers requesting one hwlock.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position
Alexandru Ardelean [Fri, 20 Sep 2019 07:31:22 +0000 (10:31 +0300)]
iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position

The iio_triggered_buffer_{predisable,postenable} functions attach/detach
the poll functions.

The iio_triggered_buffer_predisable() should be called last, to detach the
poll func after the devices has been suspended.

The position of iio_triggered_buffer_postenable() is correct.

Note this is not stable material. It's a fix in the logical
model rather fixing an actual bug.  These are being tidied up
throughout the subsystem to allow more substantial rework that
was blocked by variations in how things were done.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agostaging: isdn: remove assignment in if conditionals
Wambui Karuga [Fri, 11 Oct 2019 07:20:44 +0000 (10:20 +0300)]
staging: isdn: remove assignment in if conditionals

Remove variable assignment in if statements in
drivers/staging/isdn/avm/b1.c.
Issues reported by checkpatch.pl as:
ERROR: do not use assignment in if condition

Also refactor code around some if statements to remove comparisons
to NULL and unnecessary braces in single statement blocks.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Link: https://lore.kernel.org/r/20191011072044.7022-1-wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: qlge: fix comparison to NULL warning
Jules Irenge [Thu, 10 Oct 2019 21:40:06 +0000 (22:40 +0100)]
staging: qlge: fix comparison to NULL warning

Fix comparison to NULL by replacing with !ptr instead.
 Issue detected by checkpatch.

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Link: https://lore.kernel.org/r/20191010214006.23677-4-jbi.octave@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: qlge: add space to fix check warning
Jules Irenge [Thu, 10 Oct 2019 21:40:05 +0000 (22:40 +0100)]
staging: qlge: add space to fix check warning

Add space to fix warning of preferred space near the division operator
 issue detected by checkpatch.

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Link: https://lore.kernel.org/r/20191010214006.23677-3-jbi.octave@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: qlge: Fix multiple assignments warning by replacing integer variables to...
Jules Irenge [Thu, 10 Oct 2019 21:40:04 +0000 (22:40 +0100)]
staging: qlge: Fix multiple assignments warning by replacing integer variables to bool

Fix multiple assignments warning " check
 issue detected by checkpatch tool:
"CHECK: multiple assignments should be avoided".

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Link: https://lore.kernel.org/r/20191010214006.23677-2-jbi.octave@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: qlge: fix "alignment should match open parenthesis" checks
Jules Irenge [Thu, 10 Oct 2019 21:40:03 +0000 (22:40 +0100)]
staging: qlge: fix "alignment should match open parenthesis" checks

Fix "alignment should mactch open parenthesis" checks
 issued by checkpatch.pl tool:
"CHECK: Alignment should match open parenthesis".

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Link: https://lore.kernel.org/r/20191010214006.23677-1-jbi.octave@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: qlge: correct a misspelled word
Jules Irenge [Thu, 10 Oct 2019 17:21:14 +0000 (18:21 +0100)]
staging: qlge: correct a misspelled word

Fix a misspelling of "several" detected by checkpatch

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Link: https://lore.kernel.org/r/20191010172114.12345-1-jbi.octave@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove unnecessary null check
YueHaibing [Thu, 10 Oct 2019 15:33:25 +0000 (23:33 +0800)]
staging: rtl8723bs: Remove unnecessary null check

Null check before kfree is redundant, so remove it.
This is detected by coccinelle.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20191010153325.16836-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove unnecessary blank lines
Wambui Karuga [Thu, 10 Oct 2019 13:15:32 +0000 (16:15 +0300)]
staging: rtl8723bs: Remove unnecessary blank lines

Remove multiple blank lines in
drivers/staging/rtl8723bs/core/rtw_mlme.c.
Issues reported by checkpatch.pl as:
CHECK: Please don't use multiple blank lines

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Link: https://lore.kernel.org/r/50abec172689dfa413437589745032d678b82d04.1570712632.git.wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove comparisons to booleans in conditionals.
Wambui Karuga [Thu, 10 Oct 2019 13:15:31 +0000 (16:15 +0300)]
staging: rtl8723bs: Remove comparisons to booleans in conditionals.

Remove comparisons to true and false in multiple if statements in
drivers/staging/rtl8723bs/core/rtw_mlme.c
Issues reported by checkpatch.pl as:
CHECK: Using comparison to false is error prone
CHECK: Using comparison to true is error prone

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Link: https://lore.kernel.org/r/d97eaa803566c15a2658df10cf2ca77acddea7fb.1570712632.git.wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove unnecessary braces for single statements
Wambui Karuga [Thu, 10 Oct 2019 13:15:30 +0000 (16:15 +0300)]
staging: rtl8723bs: Remove unnecessary braces for single statements

Clean up multiple unnecessary braces around single statement blocks in
drivers/staging/rtl8723bs/core/rtw_mlme.c
Issues reported by checkpatch.pl as:
WARNING: braces {} are not necessary for single statement blocks or
WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Link: https://lore.kernel.org/r/c459741e8dc51dc2283fc69f07ed947e2994d0e9.1570712632.git.wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove comparisons to NULL in conditionals
Wambui Karuga [Thu, 10 Oct 2019 13:15:29 +0000 (16:15 +0300)]
staging: rtl8723bs: Remove comparisons to NULL in conditionals

Remove most comparisons to NULL in conditionals in
drivers/staging/rtl8723bs/core/rtw_mlme.c
Issues reported by checkpatch.pl as:
CHECK: Comparison to NULL could be written

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Link: https://lore.kernel.org/r/f4752d3a49e02193ed7b47a353e18e56d94b5a68.1570712632.git.wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: fix spelling mistake "non existant" -> "non-existent"
Colin Ian King [Thu, 10 Oct 2019 09:57:48 +0000 (10:57 +0100)]
staging: wfx: fix spelling mistake "non existant" -> "non-existent"

There is a spelling mistake in a dev_warn message. Fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20191010095748.17047-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: vc04_services: Avoid NULL comparison
Nachammai Karuppiah [Wed, 9 Oct 2019 02:44:15 +0000 (19:44 -0700)]
staging: vc04_services: Avoid NULL comparison

Remove NULL comparison. Issue found using checkpatch.pl

Signed-off-by: Nachammai Karuppiah <nachukannan@gmail.com>
Link: https://lore.kernel.org/r/1570589056-14386-1-git-send-email-nachukannan@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: emxx_udc: use devm_platform_ioremap_resource() to simplify code
YueHaibing [Wed, 9 Oct 2019 15:05:35 +0000 (23:05 +0800)]
staging: emxx_udc: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20191009150535.6412-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: clocking-wizard: use devm_platform_ioremap_resource() to simplify code
YueHaibing [Wed, 9 Oct 2019 15:04:27 +0000 (23:04 +0800)]
staging: clocking-wizard: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20191009150427.10852-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: octeon: Fix incorrect type in assignment
Wambui Karuga [Thu, 10 Oct 2019 04:38:15 +0000 (07:38 +0300)]
staging: octeon: Fix incorrect type in assignment

Fix the following warning generated by sparse in
drivers/staging/octeon/ethernet-tx.c:

drivers/staging/octeon/ethernet-tx.c:563:50: warning: incorrect type in assignment (different base types)
drivers/staging/octeon/ethernet-tx.c:563:50:    expected unsigned short [usertype] hw_chksum
drivers/staging/octeon/ethernet-tx.c:563:50:    got restricted __wsum [usertype] csum

Warning generated by running:
make C=2 CF="-D__CHECK_ENDIAN__" drivers/staging/octeon/

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Link: https://lore.kernel.org/r/20191010043815.14027-1-wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8712: Align function arguments with opening paranthesis
Wambui Karuga [Tue, 8 Oct 2019 19:53:50 +0000 (22:53 +0300)]
staging: rtl8712: Align function arguments with opening paranthesis

Fixes checkpatch.pl "CHECK Alignment should match open parenthesis"
on drivers/staging/rtl8712/rtl8712_recv.c:122

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Link: https://lore.kernel.org/r/20191008195350.20544-1-wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Fix style in definitions
Javier F. Arias [Thu, 10 Oct 2019 02:16:49 +0000 (21:16 -0500)]
staging: rtl8723bs: Fix style in definitions

Fix the style in definitions where commented code was previously
removed for an improved code readability.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/fc488562c0ddf3fa8a59e86be9b33506496ccd0c.1570672544.git.jarias.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove space before tabs
Javier F. Arias [Thu, 10 Oct 2019 02:16:29 +0000 (21:16 -0500)]
staging: rtl8723bs: Remove space before tabs

Remove space before tabs to fix checkpatch warning.
Issue found by checkpatch.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/120800f884986092ca757235781d9ddc740ec832.1570672544.git.jarias.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove duplicate blank lines
Javier F. Arias [Thu, 10 Oct 2019 02:16:07 +0000 (21:16 -0500)]
staging: rtl8723bs: Remove duplicate blank lines

Remove duplicate blank lines.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/cdc1899acadc436c2f0247ded9ec2a8b3423350e.1570672544.git.jarias.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove commented code
Javier F. Arias [Thu, 10 Oct 2019 02:14:47 +0000 (21:14 -0500)]
staging: rtl8723bs: Remove commented code

Remove commented code for a cleaner file.
Issue found by checkpatch.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/132126f0d04d5ca1129e9d682dfe9a535ec7bb39.1570672544.git.jarias.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Fix incorrect type in declaration
Javier F. Arias [Wed, 9 Oct 2019 23:19:56 +0000 (18:19 -0500)]
staging: rtl8723bs: Fix incorrect type in declaration

Fix incorrect type in declaration to solve the warnings 'incorrect
type in argument 2' in the rtw_get_wpa_ie and rtw_get_wpa_ie function
calls, as both expect the same variable in argument 2 with the
type int *.
Issue found by Sparse.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/20191009231953.GA8774@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Add space between elements
Javier F. Arias [Wed, 9 Oct 2019 00:25:45 +0000 (19:25 -0500)]
staging: rtl8723bs: Add space between elements

Concatenated strings should use spaces between elements.
Issue found by checkpatch.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/a2387d4c10c2ed0cbca9d5c7ded424892452178f.1570577926.git.jarias.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Fix function call wrapping style
Javier F. Arias [Wed, 9 Oct 2019 00:25:05 +0000 (19:25 -0500)]
staging: rtl8723bs: Fix function call wrapping style

Fix the wrapping style used for the function call.
Issue found by checkpatch.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/f43f9295d7412d610e278be608fba6f2cc14cac9.1570577926.git.jarias.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Fix line over 80 characters
Javier F. Arias [Wed, 9 Oct 2019 00:24:36 +0000 (19:24 -0500)]
staging: rtl8723bs: Fix line over 80 characters

Break last two function call arguments into two separate lines.
Issue found by checkpatch.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/9a8f7b026780b3a7387c29f1d67a7c23d4b159eb.1570577926.git.jarias.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove File operation APIs
Hans de Goede [Wed, 9 Oct 2019 12:32:23 +0000 (14:32 +0200)]
staging: rtl8723bs: Remove File operation APIs

rtl8723bs had 2 private file operation helpers:

rtw_is_file_readable()
rtw_retrive_from_file()

These were only used by the removed phy_Config*WithParaFile() functions,
so they can be removed now.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20191009123223.163241-5-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove rtw_merge_string() function
Hans de Goede [Wed, 9 Oct 2019 12:32:22 +0000 (14:32 +0200)]
staging: rtl8723bs: Remove rtw_merge_string() function

The phy_Config*WithParaFile() functions were the only user of this
function.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20191009123223.163241-4-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove phy_Config*WithParaFile() configuration leftovers
Hans de Goede [Wed, 9 Oct 2019 12:32:21 +0000 (14:32 +0200)]
staging: rtl8723bs: Remove phy_Config*WithParaFile() configuration leftovers

Now that the phy_Config*WithParaFile() functions have been removed nothing
is using these module-parameters and defines anymore.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20191009123223.163241-3-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove phy_Config*WithParaFile() functions
Hans de Goede [Wed, 9 Oct 2019 12:32:20 +0000 (14:32 +0200)]
staging: rtl8723bs: Remove phy_Config*WithParaFile() functions

These are no longer used, so remove them and also remove various
struct definitions only used by these functions.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20191009123223.163241-2-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove phy_Config*With*ParaFile() calls
Hans de Goede [Wed, 9 Oct 2019 12:32:19 +0000 (14:32 +0200)]
staging: rtl8723bs: Remove phy_Config*With*ParaFile() calls

The rtl8723bs driver tries to load various parameters from disk,
circumventing the standard firmware loader mechanism and using DIY
code for this.

No devices which run the mainline kernel ship with these files and even
if these files were present then they still would not be loaded without
additional module parameters. To be precise the following 3 conditions
must all 3 be true for on disk parameters to be used:

1) The rtw_load_phy_file modparam must contain the mask for the type, this
   defaults to(LOAD_BB_PG_PARA_FILE | LOAD_RF_TXPWR_LMT_PARA_FILE) so with
   the default settings this condition is only true for:
   phy_ConfigBBWithPgParaFile()
   PHY_ConfigRFWithPowerLimitTableParaFile(); and
2) rtw_phy_file_path modparam must be set to say "/lib/firmware/"; and
3) Store a /lib/firmware/rtl8723b/XXX file in the expected format.

In practice all 3 being true never happens, so the
phy_Config*With*ParaFile() calls are nops, remove them.

The actual code implementing them will be removed in a separate patch.

Note the ODM_ConfigRFWithHeaderFile() and ODM_ConfigBBWithHeaderFile()
functions always return HAL_STATUS_SUCCESS, this patch makes use of this
to simplify the new code without the phy_Config*With*ParaFile() calls.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20191009123223.163241-1-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove set but not used variable 'i'
zhengbin [Tue, 8 Oct 2019 23:55:05 +0000 (07:55 +0800)]
staging: rtl8723bs: Remove set but not used variable 'i'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/rtl8723bs/core/rtw_xmit.c: In function update_attrib:
drivers/staging/rtl8723bs/core/rtw_xmit.c:680:7: warning: variable i set but not used [-Wunused-but-set-variable]

It is not used since commit 554c0a3abf21 ("staging:
Add rtl8723bs sdio wifi driver")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Link: https://lore.kernel.org/r/1570578905-95675-1-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove space before tab
Javier F. Arias [Tue, 8 Oct 2019 21:16:00 +0000 (16:16 -0500)]
staging: rtl8723bs: Remove space before tab

Fix warning by removing space before tab.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/20191008211557.iv3hdpbklgaddlt3@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Replace string with identifier
Javier F. Arias [Tue, 8 Oct 2019 21:48:53 +0000 (16:48 -0500)]
staging: rtl8723bs: Replace string with identifier

Replace the hardcoded function name with its predefined identifier.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/20191008214851.p4w7cbpuldnwkne4@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: core: Remove typecast in call to kfree
Nachammai Karuppiah [Tue, 8 Oct 2019 20:17:38 +0000 (13:17 -0700)]
staging: rtl8723bs: core: Remove typecast in call to kfree

Remove typecast in the call to kfree as it is not needed.
Issue found using the below coccinelle script with options -I and
--recursive-includes,

@@
type t1;
expression *e;
@@

-kfree((t1 *)e);
+kfree(e);

Signed-off-by: Nachammai Karuppiah <nachukannan@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/1570565858-91737-1-git-send-email-nachukannan@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: Make some functions static in sta.c
zhengbin [Wed, 9 Oct 2019 13:50:30 +0000 (21:50 +0800)]
staging: wfx: Make some functions static in sta.c

Fix sparse warnings:

drivers/staging/wfx/sta.c:269:6: warning: symbol 'wfx_update_filtering_work' was not declared. Should it be static?
drivers/staging/wfx/sta.c:475:6: warning: symbol 'wfx_event_handler_work' was not declared. Should it be static?
drivers/staging/wfx/sta.c:521:6: warning: symbol 'wfx_bss_loss_work' was not declared. Should it be static?
drivers/staging/wfx/sta.c:528:6: warning: symbol 'wfx_bss_params_work' was not declared. Should it be static?
drivers/staging/wfx/sta.c:539:6: warning: symbol 'wfx_set_beacon_wakeup_period_work' was not declared. Should it be static?
drivers/staging/wfx/sta.c:732:6: warning: symbol 'wfx_unjoin_work' was not declared. Should it be static?
drivers/staging/wfx/sta.c:794:6: warning: symbol 'wfx_set_cts_work' was not declared. Should it be static?
drivers/staging/wfx/sta.c:1234:6: warning: symbol 'wfx_set_tim_work' was not declared. Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/1570629030-29888-4-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: Make function 'wfx_tx_queue_get' static
zhengbin [Wed, 9 Oct 2019 13:50:29 +0000 (21:50 +0800)]
staging: wfx: Make function 'wfx_tx_queue_get' static

Fix sparse warnings:

drivers/staging/wfx/queue.c:218:16: warning: symbol 'wfx_tx_queue_get' was not declared. Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/1570629030-29888-3-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: Make function 'sram_write_dma_safe', 'load_firmware_secure' static
zhengbin [Wed, 9 Oct 2019 13:50:28 +0000 (21:50 +0800)]
staging: wfx: Make function 'sram_write_dma_safe', 'load_firmware_secure' static

Fix sparse warnings:

drivers/staging/wfx/fwio.c:83:5: warning: symbol 'sram_write_dma_safe' was not declared. Should it be static?
drivers/staging/wfx/fwio.c:229:5: warning: symbol 'load_firmware_secure' was not declared. Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/1570629030-29888-2-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: fix swapped arguments in memset call
Colin Ian King [Wed, 9 Oct 2019 09:46:02 +0000 (10:46 +0100)]
staging: wfx: fix swapped arguments in memset call

The memset appears to have the 2nd and 3rd arguments in the wrong
order, fix this by swapping these around into the correct order.

Addresses-Coverity: ("Memset fill truncated")
Fixes: 4f8b7fabb15d ("staging: wfx: allow to send commands to chip")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191009094602.19663-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: kpc2000: Remove unnecessary return variable
Wambui Karuga [Wed, 9 Oct 2019 17:07:03 +0000 (20:07 +0300)]
staging: kpc2000: Remove unnecessary return variable

Remove unnecessary variable `val` in kp_spi_read_reg() that only holds
the return value from readq().
Issue found by coccinelle using the script:

@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/20191009170703.GA2869@wambui
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: comedi: Remove set but not used variable 'aref'
zhengbin [Tue, 8 Oct 2019 07:41:55 +0000 (15:41 +0800)]
staging: comedi: Remove set but not used variable 'aref'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/comedi/drivers/dt3000.c: In function dt3k_ai_insn_read:
drivers/staging/comedi/drivers/dt3000.c:511:27: warning: variable aref set but not used [-Wunused-but-set-variable]

It is not used since commit 2e310235ca8f ("staging:
comedi: dt3000: rename dt3k_ai_insn()")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://lore.kernel.org/r/1570520515-2186-7-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: vchiq: don't print pointless kernel address
Matteo Croce [Tue, 8 Oct 2019 12:33:46 +0000 (14:33 +0200)]
staging: vchiq: don't print pointless kernel address

Since commit ad67b74d2469d9b8 ("printk: hash addresses printed with %p"),
an obfuscated kernel pointer is printed at boot:

    vchiq: vchiq_init_state: slot_zero = (____ptrval____)

Remove the the print completely, as it's useless without the address.

Signed-off-by: Matteo Croce <mcroce@redhat.com>
Link: https://lore.kernel.org/r/20191008123346.3931-1-mcroce@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: sm750fb: Remove set but not used variable 'actual_mx_clk'
zhengbin [Tue, 8 Oct 2019 07:41:52 +0000 (15:41 +0800)]
staging: sm750fb: Remove set but not used variable 'actual_mx_clk'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/sm750fb/ddk750_chip.c: In function set_chip_clock:
drivers/staging/sm750fb/ddk750_chip.c:59:15: warning: variable actual_mx_clk set but not used [-Wunused-but-set-variable]

It is not used since commit f0977109a577 ("staging:
sm750fb: lower case to fix camelcase checkpatch warning")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/1570520515-2186-4-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: sm750fb: Remove set but not used variable 'uiActualPixelClk'
zhengbin [Tue, 8 Oct 2019 07:41:51 +0000 (15:41 +0800)]
staging: sm750fb: Remove set but not used variable 'uiActualPixelClk'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/sm750fb/ddk750_mode.c: In function ddk750_setModeTiming:
drivers/staging/sm750fb/ddk750_mode.c:212:15: warning: variable uiActualPixelClk set but not used [-Wunused-but-set-variable]

It is not used since commit 81dee67e215b ("staging:
sm750fb: add sm750 to staging")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/1570520515-2186-3-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: bcm2835-audio: Need to judge the return value of vchi_msg_dequeue in audio_v...
zhengbin [Tue, 8 Oct 2019 07:41:50 +0000 (15:41 +0800)]
staging: bcm2835-audio: Need to judge the return value of vchi_msg_dequeue in audio_vchi_callback

If vchi_msg_dequeue return -1, variable m is not assigined,
need to return.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/1570520515-2186-2-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging/octeon: Use stubs for MIPS && !CAVIUM_OCTEON_SOC
Paul Burton [Mon, 7 Oct 2019 23:18:06 +0000 (23:18 +0000)]
staging/octeon: Use stubs for MIPS && !CAVIUM_OCTEON_SOC

When building for a non-Cavium MIPS system with COMPILE_TEST=y, the
Octeon ethernet driver hits a number of issues due to use of macros
provided only for CONFIG_CAVIUM_OCTEON_SOC=y configurations. For
example:

  drivers/staging/octeon/ethernet-rx.c:190:6: error:
    'CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE' undeclared (first use in this function)
  drivers/staging/octeon/ethernet-rx.c:472:25: error:
    'OCTEON_IRQ_WORKQ0' undeclared (first use in this function)

These come from various asm/ headers that a non-Octeon build will be
using a non-Octeon version of.

Fix this by using the octeon-stubs.h header for non-Cavium MIPS builds,
and only using the real asm/octeon/ headers when building a Cavium
Octeon kernel configuration.

This requires that octeon-stubs.h doesn't redefine XKPHYS_TO_PHYS, which
is defined for MIPS by asm/addrspace.h which is pulled in by many other
common asm/ headers.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
URL: https://lore.kernel.org/linux-mips/CAMuHMdXvu+BppwzsU9imNWVKea_hoLcRt9N+a29Q-QsjW=ip2g@mail.gmail.com/
Fixes: 171a9bae68c7 ("staging/octeon: Allow test build on !MIPS")
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: David S. Miller <davem@davemloft.net>
Link: https://lore.kernel.org/r/20191007231741.2012860-1-paul.burton@mips.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: os_dep: Remove typecast in kfree
Nachammai Karuppiah [Tue, 8 Oct 2019 05:09:13 +0000 (22:09 -0700)]
staging: rtl8723bs: os_dep: Remove typecast in kfree

Remove typecast in the call to kfree as it is not needed.
Issue found using the below coccinelle script,

@@
type t1;
expression e;
@@

-kfree((t1 *)e);
+kfree(e);

Signed-off-by: Nachammai Karuppiah <nachukannan@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/1570511353-64646-1-git-send-email-nachukannan@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove commented code
Javier F. Arias [Tue, 8 Oct 2019 02:52:23 +0000 (21:52 -0500)]
staging: rtl8723bs: Remove commented code

Remove commented code for a cleaner file. Issue found by checkpatch.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/20191008025221.q4j4igctqjowur2s@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: fix typo of "mechanism" in comment
Antonio Borneo [Mon, 7 Oct 2019 15:43:03 +0000 (17:43 +0200)]
staging: rtl8723bs: fix typo of "mechanism" in comment

Fix typo s/mechansim/mechanism/

Signed-off-by: Antonio Borneo <antonio.borneo@st.com>
Link: https://lore.kernel.org/r/20191007154306.95827-2-antonio.borneo@st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: octeon: Remove typedef declaration
Wambui Karuga [Tue, 8 Oct 2019 04:09:43 +0000 (07:09 +0300)]
staging: octeon: Remove typedef declaration

Fixes checkpatch.pl warning: do not add new typedefs in
drivers/staging/octeon/octeon-stubs.h:41

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Link: https://lore.kernel.org/r/20191008040943.9283-1-wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: fix spelling mistake "hexdecimal" -> "hexadecimal"
Colin Ian King [Tue, 8 Oct 2019 08:22:05 +0000 (09:22 +0100)]
staging: wfx: fix spelling mistake "hexdecimal" -> "hexadecimal"

There is a spelling mistake in the documentation and a module parameter
description. Fix these.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20191008082205.19740-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: avoid namespace contamination
Jérôme Pouiller [Tue, 8 Oct 2019 09:43:01 +0000 (09:43 +0000)]
staging: wfx: avoid namespace contamination

tx_policy_init() was already defined in driver cw1200. So, compilation
failed when wfx and cw1200 were both built-in.

In order to keep a coherent naming scheme, this patch prefixes all
"tx_policy_*" functions with "wfx_".

Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191008094232.10014-8-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: drop calls to BUG_ON()
Jérôme Pouiller [Tue, 8 Oct 2019 09:43:01 +0000 (09:43 +0000)]
staging: wfx: drop calls to BUG_ON()

Most of calls to BUG_ON() could replaced by WARN().

By the way, this patch also try to favor WARN() (that include a comment
about the problem) instead of WARN_ON().

Reported-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191008094232.10014-7-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: fix copy_{to,from}_user() usage
Jérôme Pouiller [Tue, 8 Oct 2019 09:43:00 +0000 (09:43 +0000)]
staging: wfx: fix copy_{to,from}_user() usage

On error, copy_to_user() returns number of bytes remaining. Driver
should return -EFAULT.

Fixes: 4f8b7fabb15d ("staging: wfx: allow to send commands to chip")
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191008094232.10014-6-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: correctly cast data on big-endian targets
Jérôme Pouiller [Tue, 8 Oct 2019 09:43:00 +0000 (09:43 +0000)]
staging: wfx: correctly cast data on big-endian targets

When built for a big-endian target, original code caused error:

    include/uapi/linux/swab.h:242:29: note: expected '__u32 * {aka unsigned int *}' but argument is of type 'struct hif_mib_protected_mgmt_policy *'

Fixes: f95a29d40782 ("staging: wfx: add HIF commands helpers")
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191008094232.10014-5-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: le16_to_cpus() takes a reference as parameter
Jérôme Pouiller [Tue, 8 Oct 2019 09:42:59 +0000 (09:42 +0000)]
staging: wfx: le16_to_cpus() takes a reference as parameter

Original code caused an (100% reproducible) invalid memory access on
big-endian targets.

Fixes: b0998f0c040d "staging: wfx: add IRQ handling"
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191008094232.10014-4-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: remove misused call to cpu_to_le16()
Jérôme Pouiller [Tue, 8 Oct 2019 09:42:59 +0000 (09:42 +0000)]
staging: wfx: remove misused call to cpu_to_le16()

Indeed, hif_msg->id is a uint8_t, so use of cpu_to_le16() is a madness.

Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191008094232.10014-3-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: simplify memory allocation in wfx_update_filtering()
Jérôme Pouiller [Tue, 8 Oct 2019 09:42:58 +0000 (09:42 +0000)]
staging: wfx: simplify memory allocation in wfx_update_filtering()

Original code did not handle case where kmalloc failed. By the way, it
is more convenient to allocate and build HIF message in
hif_set_beacon_filter_table() instead of to ask to caller function to
build it.

Fixes: 40115bbc40e2 ("staging: wfx: implement the rest of mac80211 API")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191008094232.10014-2-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoiio: gyro: clean up indentation issue
Colin Ian King [Wed, 25 Sep 2019 12:32:53 +0000 (13:32 +0100)]
iio: gyro: clean up indentation issue

There is a return statement that is indented incorrectly, add in
the missing tab.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agocounter: stm32: clean up indentation issue
Colin Ian King [Wed, 25 Sep 2019 09:51:26 +0000 (10:51 +0100)]
counter: stm32: clean up indentation issue

There is an if statement that is indented one level too deeply,
remove the extraneous tabs.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: proximity: sx9500: fix iio_triggered_buffer_{predisable,postenable} positions
Alexandru Ardelean [Fri, 20 Sep 2019 08:35:13 +0000 (11:35 +0300)]
iio: proximity: sx9500: fix iio_triggered_buffer_{predisable,postenable} positions

The iio_triggered_buffer_predisable() should be called last, to detach the
poll func after the devices has been suspended.

This change re-organizes things a bit so that the postenable & predisable
are symmetrical. It also converts the preenable() to a postenable().

Not stable material as there is no known problem with the current
code, it's just not consistent with the form we would like all the
IIO drivers to adopt so as to allow subsystem wide changes.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: core: Add optional symbolic label to device attributes
Phil Reid [Thu, 19 Sep 2019 14:36:08 +0000 (22:36 +0800)]
iio: core: Add optional symbolic label to device attributes

If a label is defined in the device tree for this device add that
to the device specific attributes. This is useful for userspace to
be able to identify an individual device when multiple identical
chips are present in the system.

Tested-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agostaging: wlan-ng: p80211wep.c: use lib/crc32
Thomas Meyer [Sun, 6 Oct 2019 14:07:45 +0000 (16:07 +0200)]
staging: wlan-ng: p80211wep.c: use lib/crc32

Use lib/crc32 instead of another implementation.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Link: https://lore.kernel.org/r/20191006140745.9952-1-thomas@m3y3r.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: vc04_services: make use of devm_platform_ioremap_resource
Hariprasad Kelam [Sun, 6 Oct 2019 09:16:21 +0000 (14:46 +0530)]
staging: vc04_services: make use of devm_platform_ioremap_resource

fix below issue reported by coccicheck
drivers/staging//vc04_services/interface/vchiq_arm/vchiq_2835_arm.c:139
WARNING: Use devm_platform_ioremap_resource for g_regs

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Link: https://lore.kernel.org/r/1570353394-9991-1-git-send-email-hariprasad.kelam@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove set but not used variable 'adapter'
zhengbin [Sun, 6 Oct 2019 09:09:59 +0000 (17:09 +0800)]
staging: rtl8723bs: Remove set but not used variable 'adapter'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/rtl8723bs/core/rtw_mlme.c: In function rtw_select_roaming_candidate:
drivers/staging/rtl8723bs/core/rtw_mlme.c:2007:18: warning: variable adapter set but not used [-Wunused-but-set-variable]

It is not used since commit 554c0a3abf21 ("staging:
Add rtl8723bs sdio wifi driver")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Link: https://lore.kernel.org/r/1570352999-45790-6-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove set but not used variables 'ppp', 'type', 'data'
zhengbin [Sun, 6 Oct 2019 09:09:58 +0000 (17:09 +0800)]
staging: rtl8723bs: Remove set but not used variables 'ppp', 'type', 'data'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/rtl8723bs/core/rtw_recv.c: In function validate_80211w_mgmt:
drivers/staging/rtl8723bs/core/rtw_recv.c:1415:8: warning: variable ppp set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/core/rtw_recv.c: In function validate_80211w_mgmt:
drivers/staging/rtl8723bs/core/rtw_recv.c:1403:5: warning: variable type set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/core/rtw_recv.c: In function recvframe_defrag:
drivers/staging/rtl8723bs/core/rtw_recv.c:1713:6: warning: variable data set but not used [-Wunused-but-set-variable]

They are not used since commit 554c0a3abf21 ("staging:
Add rtl8723bs sdio wifi driver")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Link: https://lore.kernel.org/r/1570352999-45790-5-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove set but not used variable 'prwskeylen'
zhengbin [Sun, 6 Oct 2019 09:09:57 +0000 (17:09 +0800)]
staging: rtl8723bs: Remove set but not used variable 'prwskeylen'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/rtl8723bs/core/rtw_security.c: In function rtw_tkip_encrypt:
drivers/staging/rtl8723bs/core/rtw_security.c:660:6: warning: variable prwskeylen set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/core/rtw_security.c: In function rtw_tkip_decrypt:
drivers/staging/rtl8723bs/core/rtw_security.c:768:6: warning: variable prwskeylen set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/core/rtw_security.c: In function rtw_aes_encrypt:
drivers/staging/rtl8723bs/core/rtw_security.c:1528:6: warning: variable prwskeylen set but not used [-Wunused-but-set-variable]

It is not used since commit 554c0a3abf21 ("staging:
Add rtl8723bs sdio wifi driver")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Link: https://lore.kernel.org/r/1570352999-45790-4-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove set but not used variable 'tmp_aid'
zhengbin [Sun, 6 Oct 2019 09:09:56 +0000 (17:09 +0800)]
staging: rtl8723bs: Remove set but not used variable 'tmp_aid'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/rtl8723bs/core/rtw_sta_mgt.c: In function rtw_alloc_stainfo:
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c:190:7: warning: variable tmp_aid set but not used [-Wunused-but-set-variable]

It is not used since commit 554c0a3abf21 ("staging:
Add rtl8723bs sdio wifi driver")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Link: https://lore.kernel.org/r/1570352999-45790-3-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8712: align arguments with open parenthesis in file rtl8712_led.c
Gabriela Bittencourt [Mon, 7 Oct 2019 00:39:02 +0000 (21:39 -0300)]
staging: rtl8712: align arguments with open parenthesis in file rtl8712_led.c

Cleans up checks of "Alignment should match open parenthesis"

Signed-off-by: Gabriela Bittencourt <gabrielabittencourt00@gmail.com>
Link: https://lore.kernel.org/r/20191007003902.21911-1-gabrielabittencourt00@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Switch constant place in test
Javier F. Arias [Mon, 7 Oct 2019 03:32:05 +0000 (22:32 -0500)]
staging: rtl8723bs: Switch constant place in test

Switch constant place as it should be on the right side of the test.
Issue found by checkpatch.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/20191007033202.45czxuochtylkddf@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: vt6656: reorganize characters so the lines are under 80 ch
Gabriela Bittencourt [Sun, 6 Oct 2019 19:40:30 +0000 (16:40 -0300)]
staging: vt6656: reorganize characters so the lines are under 80 ch

Cleans up warnings of "line over 80 characters"

Signed-off-by: Gabriela Bittencourt <gabrielabittencourt00@gmail.com>
Link: https://lore.kernel.org/r/20191006194030.8854-1-gabrielabittencourt00@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove unnecessary braces
Javier F. Arias [Sun, 6 Oct 2019 23:03:30 +0000 (18:03 -0500)]
staging: rtl8723bs: Remove unnecessary braces

Remove braces that are not necessary for any arm of this statement.
Issue found by checkpatch.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/20191006230327.GA4168@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: vt6656: remove duplicated blank line
Gabriela Bittencourt [Sun, 6 Oct 2019 19:58:54 +0000 (16:58 -0300)]
staging: vt6656: remove duplicated blank line

Cleans up checks of "don't use multiple blank line"

Signed-off-by: Gabriela Bittencourt <gabrielabittencourt00@gmail.com>
Reviewed-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk>
Link: https://lore.kernel.org/r/20191006195854.9843-1-gabrielabittencourt00@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: mt7621-pci: add quirks for 'E2' revision using 'soc_device_attribute'
Sergio Paracuellos [Sun, 6 Oct 2019 18:10:32 +0000 (20:10 +0200)]
staging: mt7621-pci: add quirks for 'E2' revision using 'soc_device_attribute'

Depending on revision of the chip, reset lines are inverted. Make code
more readable making use of 'soc_device_match' in driver probe function.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20191006181032.19112-1-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8192u: Fix indentation for cleaner code
Sumera Priyadarsini [Sun, 6 Oct 2019 10:53:00 +0000 (16:23 +0530)]
staging: rtl8192u: Fix indentation for cleaner code

Fixes indentation for if condition in the file r8190_rtl8256.c for
better readability as suggested by Dan Carpenter.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sumera Priyadarsini <sylphrenadin@gmail.com>
Link: https://lore.kernel.org/r/20191006105300.10181-1-sylphrenadin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove set but not used variable 'oldcnt'
zhengbin [Sun, 6 Oct 2019 09:33:02 +0000 (17:33 +0800)]
staging: rtl8723bs: Remove set but not used variable 'oldcnt'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/rtl8723bs/hal/sdio_ops.c: In function sdio_read_port:
drivers/staging/rtl8723bs/hal/sdio_ops.c:430:6: warning: variable oldcnt set but not used [-Wunused-but-set-variable]

It is not used since commit dedf215bd1c7 ("staging:
rtl8723bs: remove unused code")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Link: https://lore.kernel.org/r/1570354382-86879-1-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8188eu: remove unnecessary asignment and initialization
Michael Straube [Sat, 5 Oct 2019 14:18:52 +0000 (16:18 +0200)]
staging: rtl8188eu: remove unnecessary asignment and initialization

Variable badworden is asigned in two subsequent lines. So the first
asignment is useless and not needed. Also the initialization to zero
is not needed. Remove the first asignment and the initialization.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191005141852.88712-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wilc1000: don't use wdev while setting tx power
Adham Abozaeid [Fri, 4 Oct 2019 21:40:22 +0000 (21:40 +0000)]
staging: wilc1000: don't use wdev while setting tx power

WILC doesn't support per-vif tx power, and hence, wdev will always be
null in calls to set_tx_power.
Instead, wiphy should be used to execute the operation

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Link: https://lore.kernel.org/r/20191004214011.7623-1-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove unnecessary braces
Javier F. Arias [Sun, 6 Oct 2019 13:30:19 +0000 (08:30 -0500)]
staging: rtl8723bs: Remove unnecessary braces

Remove unnecessary braces for single statement block.
Issue found by checkpatch.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/20191006133016.GA22297@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agodt-binding: iio: Add optional label property
Phil Reid [Thu, 19 Sep 2019 14:36:07 +0000 (22:36 +0800)]
dt-binding: iio: Add optional label property

This optional property defines a symbolic name for the device.
This helps to distinguish between more than one iio device
of the same type.

Suggested-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Phil Reid <preid@electromag.com.au>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: gyro: adis16080: replace mlock with own lock
Alexandru Ardelean [Thu, 19 Sep 2019 13:23:03 +0000 (16:23 +0300)]
iio: gyro: adis16080: replace mlock with own lock

The lock is used to protect the buffer during reads. Though the spi
routines have their own locks, it may be the case that the buffer needs to
be protected before it's stored and passed to the IIO read hooks.

indio_dev's mlock was used before.
This change replaces it with the driver's own lock.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agocounter: stm32-lptimer-cnt: fix a kernel-doc warning
Fabrice Gasnier [Wed, 18 Sep 2019 12:22:41 +0000 (14:22 +0200)]
counter: stm32-lptimer-cnt: fix a kernel-doc warning

Fix the following warnings when documentation is built:
drivers/counter/stm32-lptimer-cnt.c:354: warning: cannot understand
function prototype: 'enum stm32_lptim_cnt_function'

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Fixes: 597f55e3f36c ("counter: stm32-lptimer: add counter device")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agocounter: stm32-timer-cnt: fix a kernel-doc warning
Fabrice Gasnier [Wed, 18 Sep 2019 12:22:03 +0000 (14:22 +0200)]
counter: stm32-timer-cnt: fix a kernel-doc warning

Fix the following warning when documentation is built:
drivers/counter/stm32-timer-cnt.c:37: warning: cannot understand function
prototype: 'enum stm32_count_function'

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Fixes: ad29937e206f ("counter: Add STM32 Timer quadrature encoder")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: gyro: adis16130: remove mlock usage
Alexandru Ardelean [Tue, 17 Sep 2019 16:10:23 +0000 (19:10 +0300)]
iio: gyro: adis16130: remove mlock usage

The use of indio_dev's mlock is discouraged. The driver already defines
it's own `bus_lock` in `adis16130_spi_read()`, so using the mlock is
redundant.

The parts supported by this chip are obsoleted anyway, so for now we just
remove mlock as part of a general cleanup, until the driver gets removed.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoMAINTAINERS: add entry for ROHM BH1750 driver
Tomasz Duszynski [Mon, 16 Sep 2019 19:00:24 +0000 (21:00 +0200)]
MAINTAINERS: add entry for ROHM BH1750 driver

Add myself as a ROHM BH1750 ambient light sensor driver maintainer.

Signed-off-by: Tomasz Duszynski <tduszyns@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: iio: light: bh1750: convert bindings to yaml
Tomasz Duszynski [Mon, 16 Sep 2019 19:00:23 +0000 (21:00 +0200)]
dt-bindings: iio: light: bh1750: convert bindings to yaml

Convert existing device tree bindings to yaml.

Signed-off-by: Tomasz Duszynski <tduszyns@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: add motion report function and call from interrupt
Sean Nyekjaer [Mon, 16 Sep 2019 13:56:30 +0000 (15:56 +0200)]
iio: imu: st_lsm6dsx: add motion report function and call from interrupt

Report iio motion events to iio subsystem and filter motion events.
Wakeup will still be on all channels as it's not possible to do the filtering
in hw.

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Reviewed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: always enter interrupt thread
Sean Nyekjaer [Mon, 16 Sep 2019 13:56:29 +0000 (15:56 +0200)]
iio: imu: st_lsm6dsx: always enter interrupt thread

The interrupt source can come from multiple sources,
fifo and wake interrupts.
Enter interrupt thread to check which interrupt that has fired.

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Reviewed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: add wakeup-source option
Sean Nyekjaer [Mon, 16 Sep 2019 13:56:28 +0000 (15:56 +0200)]
iio: imu: st_lsm6dsx: add wakeup-source option

This add ways for the SoC to wake from accelerometer wake events.

In the suspend function we skip disabling the sensor if wakeup-source
and events are activated.

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Reviewed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: add motion events
Sean Nyekjaer [Mon, 16 Sep 2019 13:56:27 +0000 (15:56 +0200)]
iio: imu: st_lsm6dsx: add motion events

Add event channels that controls the creation of motion events.
Tested on ISM330DLC

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Reviewed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: move interrupt thread to core
Sean Nyekjaer [Mon, 16 Sep 2019 13:56:26 +0000 (15:56 +0200)]
iio: imu: st_lsm6dsx: move interrupt thread to core

This prepares the interrupt to be used for other stuff than
fifo reading + event readings.

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: inv_mpu6050: add fifo support for magnetometer data
Jean-Baptiste Maneyrol [Mon, 16 Sep 2019 09:42:09 +0000 (09:42 +0000)]
iio: imu: inv_mpu6050: add fifo support for magnetometer data

Put read magnetometer data by mpu inside the fifo.

Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: inv_mpu6050: add MPU925x magnetometer support
Jean-Baptiste Maneyrol [Mon, 16 Sep 2019 09:42:07 +0000 (09:42 +0000)]
iio: imu: inv_mpu6050: add MPU925x magnetometer support

Add support of driving MPU9250 magnetometer connected on i2c
auxiliary bus using the MPU i2c master.

Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: inv_mpu6050: helpers for using i2c master on auxiliary bus
Jean-Baptiste Maneyrol [Mon, 16 Sep 2019 09:42:05 +0000 (09:42 +0000)]
iio: imu: inv_mpu6050: helpers for using i2c master on auxiliary bus

Add helper functions to use the i2c auxiliary bus with the MPU i2c
master block.

Support only register based chip, reading and 1 byte writing. These
will be useful for initializing magnetometers inside MPU9x50 chips.

Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>