platform/kernel/linux-starfive.git
3 years agostaging: wfx: uniformize naming rules in hif_tx_mib.c
Jérôme Pouiller [Mon, 7 Sep 2020 10:15:19 +0000 (12:15 +0200)]
staging: wfx: uniformize naming rules in hif_tx_mib.c

hif_tx_mib.c contains functions that format data to be sent to the
hardware. In this file, sometime the struct to be sent is named 'arg',
sometime 'val'. In some other function 'val' is used for the argument of
the function.

This patch uniformize the things and choose to call all the data in
destination to the hardware 'arg' (note this choice is only dictated by
the number of lines to change in the code)

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-30-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: fix spaces
Jérôme Pouiller [Mon, 7 Sep 2020 10:15:18 +0000 (12:15 +0200)]
staging: wfx: fix spaces

There is no reason to place two spaces between the field tx_conf_payload
and its type.

In the same vein, remove duplicate empty lines between declarations.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-29-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: fix naming of hif_tx_rate_retry_policy
Jérôme Pouiller [Mon, 7 Sep 2020 10:15:17 +0000 (12:15 +0200)]
staging: wfx: fix naming of hif_tx_rate_retry_policy

In the wfx driver, the prefix 'hif_mib_' is normally used for structures
that represent a hardware message. hif_mib_tx_rate_retry_policy does not
fall in this category. So, rename it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-28-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop macro API_SSID_SIZE
Jérôme Pouiller [Mon, 7 Sep 2020 10:15:16 +0000 (12:15 +0200)]
staging: wfx: drop macro API_SSID_SIZE

The maximum length of a SSID is defined by 802.11 specification. It is
already defined in mac80211: IEEE80211_MAX_SSID_LEN. Therefore, use this
generic definition.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-27-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop struct hif_ie_tlv
Jérôme Pouiller [Mon, 7 Sep 2020 10:15:15 +0000 (12:15 +0200)]
staging: wfx: drop struct hif_ie_tlv

This struct hif_ie_tlv is definitively an Information Element (IE). This
struct is defined by 802.11 specification and already exists in
mac80211. Reuse this definition instead of struct hif_ie_tlv.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-26-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop useless union hif_indication_data
Jérôme Pouiller [Mon, 7 Sep 2020 10:15:14 +0000 (12:15 +0200)]
staging: wfx: drop useless union hif_indication_data

The union hif_indication_data is never used in the driver. So, it is not
necessary to declare it separately from hif_ind_generic.

In add, drop prefix 'indication_' from the names 'indication_type' and
'indication_data' since it is redundant with the name of the struct.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-25-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop useless union hif_event_data
Jérôme Pouiller [Mon, 7 Sep 2020 10:15:13 +0000 (12:15 +0200)]
staging: wfx: drop useless union hif_event_data

The union hif_event_data is never used in the driver. So, it is
not necessary to declare it separately from hif_ind_event.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-24-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop useless union hif_privacy_key_data
Jérôme Pouiller [Mon, 7 Sep 2020 10:15:12 +0000 (12:15 +0200)]
staging: wfx: drop useless union hif_privacy_key_data

The union hif_privacy_key_data is never used in the driver. So, it is
not necessary to declare it separately from hif_req_add_key.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-23-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop useless structs only used in hif_ind_startup
Jérôme Pouiller [Mon, 7 Sep 2020 10:15:11 +0000 (12:15 +0200)]
staging: wfx: drop useless structs only used in hif_ind_startup

The structs hif_capabilities, hif_otp_regul_sel_mode_info and
hif_otp_phy_info have no real reasons to exist. Drop them and simplify
access to fields of struct hif_ind_startup.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-22-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop useless stricts only used in hif_req_start_scan_alt
Jérôme Pouiller [Mon, 7 Sep 2020 10:15:10 +0000 (12:15 +0200)]
staging: wfx: drop useless stricts only used in hif_req_start_scan_alt

The structs hif_scan_type, hif_scan_flags and hif_auto_scan_param have
no real reasons to exist (apart maybe defining namespaces). Moreover,
the names of the fields within these structs are not all meaningful.

Drop the structs and rename the fields.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-21-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop useless structs only used in hif_req_tx
Jérôme Pouiller [Mon, 7 Sep 2020 10:15:09 +0000 (12:15 +0200)]
staging: wfx: drop useless structs only used in hif_req_tx

The structs hif_queue, hif_data_flags, hif_tx_flags and
hif_ht_tx_parameters have no real reasons to exist. Drop them and
simplify access to fields of struct hif_req_tx.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-20-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop useless struct hif_tx_result_flags
Jérôme Pouiller [Mon, 7 Sep 2020 10:15:08 +0000 (12:15 +0200)]
staging: wfx: drop useless struct hif_tx_result_flags

Struct hif_tx_result_flags has no reason to exist. Drop it and simplify
access to struct hif_cnf_tx.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-19-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop useless struct hif_rx_flags
Jérôme Pouiller [Mon, 7 Sep 2020 10:15:07 +0000 (12:15 +0200)]
staging: wfx: drop useless struct hif_rx_flags

Struct hif_rx_flags has no reason to exist. Drop it and simplify access
to struct hif_ind_rx.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-18-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop useless struct hif_pm_mode
Jérôme Pouiller [Mon, 7 Sep 2020 10:15:06 +0000 (12:15 +0200)]
staging: wfx: drop useless struct hif_pm_mode

Struct hif_pm_mode has no reason to exist. Drop it and simplify access
to struct hif_req_set_pm_mode.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-17-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop useless struct hif_suspend_resume_flags
Jérôme Pouiller [Mon, 7 Sep 2020 10:15:05 +0000 (12:15 +0200)]
staging: wfx: drop useless struct hif_suspend_resume_flags

Struct hif_suspend_resume_flags has no reason to exist. Drop it and
simplify access to struct hif_ind_suspend_resume_tx.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-16-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop useless struct hif_map_link_flags
Jérôme Pouiller [Mon, 7 Sep 2020 10:15:04 +0000 (12:15 +0200)]
staging: wfx: drop useless struct hif_map_link_flags

Struct hif_map_link_flags has no reason to exist. Drop it and simplify
access to struct hif_req_map_link.

Also rename the field 'map_direction' in 'unmap'. It is more
meaningful and allows to drop enum hif_sta_map_direction.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-15-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop useless struct hif_bss_flags
Jérôme Pouiller [Mon, 7 Sep 2020 10:15:03 +0000 (12:15 +0200)]
staging: wfx: drop useless struct hif_bss_flags

Struct hif_bss_flags has no reason to exist. In add, it is never used.
Drop it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-14-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop useless struct hif_join_flags
Jérôme Pouiller [Mon, 7 Sep 2020 10:15:02 +0000 (12:15 +0200)]
staging: wfx: drop useless struct hif_join_flags

Struct hif_join_flags has no reason to exist. Drop it and simplify
access to struct hif_req_join.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-13-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop useless struct hif_ie_flags
Jérôme Pouiller [Mon, 7 Sep 2020 10:15:01 +0000 (12:15 +0200)]
staging: wfx: drop useless struct hif_ie_flags

Struct hif_ie_flags has no reason to exist. Drop it and simplify
access to struct hif_req_update_ie.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-12-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop useless struct hif_reset_flags
Jérôme Pouiller [Mon, 7 Sep 2020 10:15:00 +0000 (12:15 +0200)]
staging: wfx: drop useless struct hif_reset_flags

Struct hif_reset_flags has no reason to exist. Drop it and simplify
access to struct hif_req_reset.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-11-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop useless union hif_commands_ids
Jérôme Pouiller [Mon, 7 Sep 2020 10:14:59 +0000 (12:14 +0200)]
staging: wfx: drop useless union hif_commands_ids

Union hif_commands_ids is unused.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-10-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop useless enum hif_beacon
Jérôme Pouiller [Mon, 7 Sep 2020 10:14:58 +0000 (12:14 +0200)]
staging: wfx: drop useless enum hif_beacon

Enum hif_beacon is not used. Moreover, it is just another definition of
a boolean. Absolutely useless.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-9-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop useless function
Jérôme Pouiller [Mon, 7 Sep 2020 10:14:57 +0000 (12:14 +0200)]
staging: wfx: drop useless function

Since the code for multicast filtering has been dropped, the function
hif_set_data_filtering() is only called to disable multicast filtering.
In fact, the multicast filtering is already disabled by default. So,
this function is useless and can be dropped.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-8-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop multicast filtering
Jérôme Pouiller [Mon, 7 Sep 2020 10:14:56 +0000 (12:14 +0200)]
staging: wfx: drop multicast filtering

The device allows to filter multicast frames. The driver has the
necessary code to take advantage of this feature. However, some bugs
has been reported on this feature. So, it was temporary disabled.

Finally, the things work well as-is for more than one year now. So there
is no plan to enable this feature in near future.

Since we dislike to maintain dead code, drop it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-7-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: drop 'secure link' feature
Jérôme Pouiller [Mon, 7 Sep 2020 10:14:55 +0000 (12:14 +0200)]
staging: wfx: drop 'secure link' feature

The Secure Link (slk) feature allows to encrypt (and authenticate) the
traffic between the host and the device. The official implementation of
this feature relies on mbedTLS. For that reason, this implementation is
not included in the current driver. To be included, the implementation
has to rely on kernel crypto API instead of mbedTLS.

So, for now, the driver contained stub functions waiting for the new
implementation based on kernel crypto API.

This new implementation represent a bunch of work and it is unlikely to
be done in near future.  Moreover, we strongly dislike to maintain
useless code. So, drop all the code related to secure link.

Whoever wants to implement secure link should revert this patch before
starting to work on it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-6-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: keep API error list up-to-date
Jérôme Pouiller [Mon, 7 Sep 2020 10:14:54 +0000 (12:14 +0200)]
staging: wfx: keep API error list up-to-date

A new kind of error has appeared in API 3.4.

The Linux driver is not concerned by this new error, but let's keep the
API in sync with the firmware.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-5-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: simplify hif_set_association_mode()
Jérôme Pouiller [Mon, 7 Sep 2020 10:14:53 +0000 (12:14 +0200)]
staging: wfx: simplify hif_set_association_mode()

The file hif_tx_mib.c expects to contain functions that format messages
for the hardware. It is unexpected to find function that manipulate
RCU and structures from mac80211.

Keep hif_set_association_mode() with the code necessary for message
formatting and relocate the smart part in wfx_join_finalize().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-4-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: relocate wfx_join() beside wfx_join_finalize()
Jérôme Pouiller [Mon, 7 Sep 2020 10:14:52 +0000 (12:14 +0200)]
staging: wfx: relocate wfx_join() beside wfx_join_finalize()

wfx_join() and wfx_join_finalize() are the two halves of the association
process. Group them.

In addition, for better uniformity of the code, rename wfx_do_join() in
wfx_join().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-3-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: improve readability of association processing
Jérôme Pouiller [Mon, 7 Sep 2020 10:14:51 +0000 (12:14 +0200)]
staging: wfx: improve readability of association processing

The statements in wfx_bss_info_changed() has no particular order.

For better readability, group and sort the statements relative to the
association processing.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-2-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agodrivers: staging: octeon-usb: fixed codestyle check warning
Naveen Panwar [Tue, 8 Sep 2020 03:02:39 +0000 (08:32 +0530)]
drivers: staging: octeon-usb: fixed codestyle check warning

Fixed line cannot end with '(' check.

Signed-off-by: Naveen Panwar <naveen.panwar27@gmail.com>
Link: https://lore.kernel.org/r/20200908030239.10131-1-naveen.panwar27@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: qlge: fix quoted string split across lines
Ross Schmidt [Tue, 8 Sep 2020 03:07:57 +0000 (22:07 -0500)]
staging: qlge: fix quoted string split across lines

Fixed a coding style issue by merging split quoted strings in qlge_main.c
to fix checkpatch warnings.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20200908030757.101278-1-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: emxx_udc: Remove misplaced debugging aid
Mikhail Gusarov [Fri, 11 Sep 2020 21:33:51 +0000 (23:33 +0200)]
staging: emxx_udc: Remove misplaced debugging aid

emxx_udc.h contained a #if 0 block with debugging macros. These should
be supplied via command line or Kconfig.

Fixes checkstyle's
WARNING: Consider removing the code enclosed by this #if 0 and its #endif

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Link: https://lore.kernel.org/r/20200911213350.15914-1-dottedmag@dottedmag.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: vt6655: Add spaces around arithmetic operators
Sebastian Fuentes [Sat, 12 Sep 2020 05:23:57 +0000 (22:23 -0700)]
staging: vt6655: Add spaces around arithmetic operators

This addresses the checkpatch.pl warning "spaces preferred around that
'+/-/*'"

Signed-off-by: Sebastian Fuentes <sefu1789@gmail.com>
Link: https://lore.kernel.org/r/20200912052357.GA4707@ubuntu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rts5208: rtsx_transport.c: Fix lines ending with parentheses
Sebastian Fuentes [Sat, 12 Sep 2020 06:07:41 +0000 (23:07 -0700)]
staging: rts5208: rtsx_transport.c: Fix lines ending with parentheses

Addresses checkpatch.pl check "Lines should not end with '('"

Signed-off-by: Sebastian Fuentes <sefu1789@gmail.com>
Link: https://lore.kernel.org/r/20200912060741.GA6274@ubuntu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: fwserial: Remove repeated word and
Abheek Dhawan [Sat, 12 Sep 2020 06:41:23 +0000 (01:41 -0500)]
staging: fwserial: Remove repeated word and

Remove unnecessary repeated word and

Signed-off-by: Abheek Dhawan <adawesomeguy222@gmail.com>
Link: https://lore.kernel.org/r/20200912064123.411656-1-adawesomeguy222@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agodrivers: most: add character device interface driver
Christian Gromm [Thu, 20 Aug 2020 11:23:15 +0000 (13:23 +0200)]
drivers: most: add character device interface driver

This patch adds the character device (cdev) driver source file
most_cdev.c and modifies the Makefiles and Kconfigs accordingly.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Link: https://lore.kernel.org/r/1597922595-27493-1-git-send-email-christian.gromm@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wlan-ng: Remove repeated word our
Abheek Dhawan [Sat, 5 Sep 2020 05:34:14 +0000 (00:34 -0500)]
staging: wlan-ng: Remove repeated word our

Removed unnecessary repeater word on line 274

Signed-off-by: Abheek Dhawan <adawesomeguy222@gmail.com>
Link: https://lore.kernel.org/r/20200905053414.405674-1-adawesomeguy222@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: clean up whitespace in wpa_set_encryption()
Michael Straube [Sat, 5 Sep 2020 11:53:58 +0000 (13:53 +0200)]
staging: rtl8188eu: clean up whitespace in wpa_set_encryption()

Clean up unnecessary whitespace in wpa_set_encryption() by removing
extra spaces and replacing tabs with spaces. Clears a checkpatch error.

ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200905115358.10278-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: replace enum rtw_ieee80211_spectrum_mgmt_actioncode with ieee80211_...
Ivan Safonov [Sun, 6 Sep 2020 13:32:37 +0000 (16:32 +0300)]
staging: r8188eu: replace enum rtw_ieee80211_spectrum_mgmt_actioncode with ieee80211_spectrum_mgmt_actioncode

Enum rtw_ieee80211_spectrum_mgmt_actioncode is a duplication
of ieee80211_spectrum_mgmt_actioncode from include/linux/ieee80211.h.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Link: https://lore.kernel.org/r/20200906133236.556427-1-insafonov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoMerge tag 'iio-for-5.10a-take2' of https://git.kernel.org/pub/scm/linux/kernel/git...
Greg Kroah-Hartman [Sun, 6 Sep 2020 15:47:45 +0000 (17:47 +0200)]
Merge tag 'iio-for-5.10a-take2' of https://git./linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

First set of new device support, features and cleanup for IIO in 5.10 cycle, take 2

A few changes to how I write this cover letter.
* Started to use manufacturer prefixes to group changes better.
* Stop list minor formatting etc changes.
* Whilst I appreciate those changes, we don't need to call them out here.

New device support:
* adi,adxrs290
  - New driver for this gyroscope with dt bindings. One fix follows.
* ams,as73211
  - New driver for this colour sensor with dt bindings. Also includes
    docs for XYZ modifiers as used for the CIE colour space. Sysfs docs.
* atlas,atlas-ezo-sensor
  - Support O_2 sensor, includes new modifier for concentration.
  - Support humidity sensor.
* ti,hdc2010
  - New driver support hdc2010 and hdc2080 humidity sensors. Includes dt
    bindings.

Cleanup, minor fixes and features
* core
  - Make the trigger related stub functions static inline, avoiding some build
   warnings.
  - buffer-dmaengine. Allow adjusting bytes_used with residue info.
* dev_error_probe to replace open coded equivalent in many drivers.
* docs and comment fixes
  - Fix some typos, doubled words, capitalisation and punctuation.
* dt binding conversions to yaml
  - lltc,ltc2497
  - lltc,ltc2632
  - maxim,max11100
  - maxim,max1118
  - maxim,max9611
  - microchip,mcp3201
  - microchip,mcp342x (add to trivial devices)
  - ti,adc0832
  - ti,adc108s102
  - ti,adc128s052
  - ti,adc161s626
  - ti,ads8344
  - ti,tlc4541 (includes adding an accidentally dropped original binding doc)
* adi,adi-axi-adc
  - Use kobj_to_dev instead of open coding.
* adi,ad5686
  - Constify iio_chan_spec
* adi,ad8366
  - Add HMC1119 to kconfig help text as the driver supports it.
* adi,ad9523
  - Use devm for reset of probe and drop remove.
* adi,adxl372
  - Tidy up alignment
  - Add OF table
  - Add peak mode support with some docs.
* bosch,bma220 (general tidy up)
  - Fix some return codes.
  - Use read_avail callback rather than open coding attrs.
  - Use dev_get_drvdata rather than dance via to_spi_device()
  - Mark PM functions as __maybe_unused rather than #ifdef fun.
  - Drop ACPI_PTR protections and ifdefs.
  - Tidy up header ordering.
  - BIT and GENMASK
* broadcom,bcm_iproc
  - Drop of_match_ptr protection and switch to mod_devicetable.h
    Part of general move to get this anti-pattern out of IIO.
* melexis,mlx90614
  - Simplify some calculations.
  - Add some kernel_doc
  - Use regmap poll loop rather than open coding.
  - Add extended calibration option.
* sensortec,sx9310, wide ranging set of fixes and cleanups.
  - Document dt-binding.
  - Rename some macros to align better with spec sheet
  - Fix some issues with irq handling.
  - Drop of_match_ptr and ACPI_PTR macros to avoid unused warnings etc.
  - Switch to probe_new
  - Fix memory alignment for iio_push_to_buffers_with_timestamp()
  - Use long for bitmaps to allow use of for_each_bit_set()
  - Use regmap_read_poll instead of opencoding.
  - Simplify error paths
  - Enabled regulators at probe.
  - Use trigger flags from firmware rather than forcing them in the driver.
* ti,adc081c
  - Drop ACPI IDs that are not likely to be official ones and we don't believe
    anyone is using.
* ti,adc108s102
  - Drop CONFIG_OF and of_match_ptr protections.
* ti,adc128s052
  - Drop of_match_ptr protection and include mod_devicetable.h
* ti,dac5571
  - Support powerdown for mutlichannel usecases.
* xpowers,axp20x
  - Convert from OF to generic fw / device properties. Unlikely anyone will
    use this with anything other than devicetree, but this is part of a
    general move across IIO.

* tag 'iio-for-5.10a-take2' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (96 commits)
  drivers/iio/humidity/hdc2010.c:305:2-3: Unneeded semicolon
  iio: accel: bma220: Remove unneeded blank lines
  iio: accel: bma220: Use BIT() and GENMASK() macros
  iio: accel: bma220: Group IIO headers together
  iio: accel: bma220: Drop ACPI_PTR() and accompanying ifdeffery
  iio: accel: bma220: Mark PM functions as __maybe_unused
  iio: accel: bma220: Use dev_get_drvdata() directly
  iio: accel: bma220: Convert to use ->read_avail()
  iio: accel: bma220: Fix returned codes from bma220_init(), bma220_deinit()
  dt-bindings: iio: adc: microchip,mcp3201 yaml conversion.
  iio: buffer-dmaengine: adjust `bytes_used` with residue info
  dt-bindings: iio: adc: ti,tlc4541 binding conversion
  dt-bindings: iio: adc: tlc4541 - recover accidentally dropped binding doc
  dt-bindings: iio: adc: ti,ads8344 yaml conversion
  dt-bindings: iio: adc: ti,adc128s052 yaml conversion.
  dt-bindings: iio: adc: ti,adc0832 yaml conversion.
  dt-bindings: iio: adc: ti,adc161s626 yaml conversion.
  dt-bindings: iio: adc: lltc,ltc2497 yaml conversion.
  dt-bindings: iio: adc: ti,adc108s102 yaml conversion
  dt-bindings: trivial-devices: Add mcp342x ADCs and drop separate binding doc.
  ...

3 years agodrivers/iio/humidity/hdc2010.c:305:2-3: Unneeded semicolon
kernel test robot [Tue, 1 Sep 2020 18:30:07 +0000 (19:30 +0100)]
drivers/iio/humidity/hdc2010.c:305:2-3: Unneeded semicolon

Remove unneeded semicolon.

Generated by: scripts/coccinelle/misc/semicolon.cocci

Fixes: 0115a63c9993 ("iio: humidity: Add TI HDC20x0 support")
CC: Eugene Zaikonnikov <ez@norphonic.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agostaging: tegra-vde: fix common struct sg_table related issues
Marek Szyprowski [Fri, 4 Sep 2020 13:17:07 +0000 (15:17 +0200)]
staging: tegra-vde: fix common struct sg_table related issues

The Documentation/DMA-API-HOWTO.txt states that the dma_map_sg() function
returns the number of the created entries in the DMA address space.
However the subsequent calls to the dma_sync_sg_for_{device,cpu}() and
dma_unmap_sg must be called with the original number of the entries
passed to the dma_map_sg().

struct sg_table is a common structure used for describing a non-contiguous
memory buffer, used commonly in the DRM and graphics subsystems. It
consists of a scatterlist with memory pages and DMA addresses (sgl entry),
as well as the number of scatterlist entries: CPU pages (orig_nents entry)
and DMA mapped pages (nents entry).

It turned out that it was a common mistake to misuse nents and orig_nents
entries, calling DMA-mapping functions with a wrong number of entries or
ignoring the number of mapped entries returned by the dma_map_sg()
function.

To avoid such issues, lets use a common dma-mapping wrappers operating
directly on the struct sg_table objects and use scatterlist page
iterators where possible. This, almost always, hides references to the
nents and orig_nents entries, making the code robust, easier to follow
and copy/paste safe.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20200904131711.12950-27-m.szyprowski@samsung.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: pi433: break long lines
Bryan Brattlof [Wed, 2 Sep 2020 19:22:05 +0000 (19:22 +0000)]
staging: pi433: break long lines

scripts/checkpatch.pl is warning about some lines exceeding 100
charecters. This will cleanup the warnings.

Signed-off-by: Bryan Brattlof <hello@bryanbrattlof.com>
Link: https://lore.kernel.org/r/87y2lsrnl8.fsf@bryanbrattlof.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: os_dep: added blank line to fix coding style issue
Ross Schmidt [Wed, 2 Sep 2020 19:20:44 +0000 (14:20 -0500)]
staging: rtl8723bs: os_dep: added blank line to fix coding style issue

Fixed a coding style issue by adding a blank line after declarations in
sdio_intf.c to fix a checkpatch warning.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20200902192044.19143-1-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoiio: accel: bma220: Remove unneeded blank lines
Andy Shevchenko [Mon, 31 Aug 2020 09:08:13 +0000 (12:08 +0300)]
iio: accel: bma220: Remove unneeded blank lines

There are few blank lines that split structure definitions
with their users. Remove them to increase readability.

While here, update copyright year.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200831090813.78841-8-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bma220: Use BIT() and GENMASK() macros
Andy Shevchenko [Mon, 31 Aug 2020 09:08:12 +0000 (12:08 +0300)]
iio: accel: bma220: Use BIT() and GENMASK() macros

Code is better to read when numbers of bit are explicitly used.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200831090813.78841-7-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bma220: Group IIO headers together
Andy Shevchenko [Mon, 31 Aug 2020 09:08:11 +0000 (12:08 +0300)]
iio: accel: bma220: Group IIO headers together

Group IIO headers together and follow the common pattern of header inclusion,
i.e. more generic first.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200831090813.78841-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bma220: Drop ACPI_PTR() and accompanying ifdeffery
Andy Shevchenko [Mon, 31 Aug 2020 09:08:10 +0000 (12:08 +0300)]
iio: accel: bma220: Drop ACPI_PTR() and accompanying ifdeffery

The driver is quite likely used only on ACPI based platforms and
rarely build with CONFIG_ACPI=n. Even though, the few dozens of bytes
is better than ugly ifdeffery and inclusion of heavy header.

As a result, replace acpi.h with mod_devicetable.h.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200831090813.78841-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bma220: Mark PM functions as __maybe_unused
Andy Shevchenko [Mon, 31 Aug 2020 09:08:09 +0000 (12:08 +0300)]
iio: accel: bma220: Mark PM functions as __maybe_unused

Instead of using ugly ifdeffery, mark PM functions as __maybe_unused.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200831090813.78841-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bma220: Use dev_get_drvdata() directly
Andy Shevchenko [Mon, 31 Aug 2020 09:08:08 +0000 (12:08 +0300)]
iio: accel: bma220: Use dev_get_drvdata() directly

Instead of using to_spi_dev() + spi_get_drvdata(),
use dev_get_drvdata() to make code simpler.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200831090813.78841-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bma220: Convert to use ->read_avail()
Andy Shevchenko [Mon, 31 Aug 2020 09:08:07 +0000 (12:08 +0300)]
iio: accel: bma220: Convert to use ->read_avail()

Convert to use ->read_avail() instead of open-coded attribute handling.

While here, fix the typo in array definition and append comma in case of
the future extension.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200831090813.78841-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bma220: Fix returned codes from bma220_init(), bma220_deinit()
Andy Shevchenko [Mon, 31 Aug 2020 09:08:06 +0000 (12:08 +0300)]
iio: accel: bma220: Fix returned codes from bma220_init(), bma220_deinit()

Potentially bma220_init() and bma220_deinit() may return positive codes.
Fix the logic to return proper error codes instead.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200831090813.78841-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: adc: microchip,mcp3201 yaml conversion.
Jonathan Cameron [Sun, 9 Aug 2020 11:17:41 +0000 (12:17 +0100)]
dt-bindings: iio: adc: microchip,mcp3201 yaml conversion.

Drops the deprecated compatibles without the vendor name.
Whilst the driver continues to support these for old dt blobs,
any dt bindings that are actuallly verified against this document should
be fixed to add the vendor name.

Added the #io-channel-cells property to allow for consumers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Oskar Andero <oskar.andero@gmail.com>
Link: https://lore.kernel.org/r/20200809111753.156236-2-jic23@kernel.org
3 years agoiio: buffer-dmaengine: adjust `bytes_used` with residue info
Alexandru Ardelean [Wed, 26 Aug 2020 05:20:11 +0000 (07:20 +0200)]
iio: buffer-dmaengine: adjust `bytes_used` with residue info

A transfer may fall shorter than the bytes in the block.
This information is available in the residue from the DMA engine, so we can
compute actual `bytes_used` with that by subtracting the residue.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20200826052011.13348-1-lars@metafoo.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: adc: ti,tlc4541 binding conversion
Jonathan Cameron [Sun, 9 Aug 2020 11:17:53 +0000 (12:17 +0100)]
dt-bindings: iio: adc: ti,tlc4541 binding conversion

Simple binding so easy to convert.
Dropped the stated value of maximum spi bus frequency as it does
not seem to correspond to the datasheet.  The value of 200kHz
is the max sampling frequency of the ADC, not the clock frequency of
the SPI bus.

Added #io-channel-cells to allow use as a provider of channels to
other devices via the consumer binding.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-By: Phil Reid <preid@electromag.com.au>
Cc: Phil Reid <preid@electromag.com.au>
Link: https://lore.kernel.org/r/20200809111753.156236-14-jic23@kernel.org
3 years agodt-bindings: iio: adc: tlc4541 - recover accidentally dropped binding doc
Phil Reid [Sun, 9 Aug 2020 11:17:52 +0000 (12:17 +0100)]
dt-bindings: iio: adc: tlc4541 - recover accidentally dropped binding doc

JC: Seems that I messed up applying the original driver patches, and
this file never actually made it into the tree.

I have picked up original Ack and Sign-off so as to record the
history.

Signed-off-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200809111753.156236-13-jic23@kernel.org
3 years agodt-bindings: iio: adc: ti,ads8344 yaml conversion
Jonathan Cameron [Sun, 9 Aug 2020 11:17:51 +0000 (12:17 +0100)]
dt-bindings: iio: adc: ti,ads8344 yaml conversion

Simple binding so easy to convert.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200809111753.156236-12-jic23@kernel.org
3 years agodt-bindings: iio: adc: ti,adc128s052 yaml conversion.
Jonathan Cameron [Sun, 9 Aug 2020 11:17:49 +0000 (12:17 +0100)]
dt-bindings: iio: adc: ti,adc128s052 yaml conversion.

Simple binding.  Only addition to txt version is
as a provider of channels to other devices using the consumer
binding.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Link: https://lore.kernel.org/r/20200809111753.156236-10-jic23@kernel.org
3 years agodt-bindings: iio: adc: ti,adc0832 yaml conversion.
Jonathan Cameron [Sun, 9 Aug 2020 11:17:46 +0000 (12:17 +0100)]
dt-bindings: iio: adc: ti,adc0832 yaml conversion.

Simple binding conversion of this SPI ADC binding, with reference
voltage.

Added the optional property #io-channel-cells to allow for
consumers of channels if that makes sense for a given board.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Link: https://lore.kernel.org/r/20200809111753.156236-7-jic23@kernel.org
3 years agodt-bindings: iio: adc: ti,adc161s626 yaml conversion.
Jonathan Cameron [Sun, 9 Aug 2020 11:17:45 +0000 (12:17 +0100)]
dt-bindings: iio: adc: ti,adc161s626 yaml conversion.

Simple conversion for this ADC driver.  Note that I haven't put
limits on the spi-max-sampling-frequency because the adc161s626
doesn't state one clearly defined value.

Added the #io-channel-cells property to allow for consumers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Cc: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20200809111753.156236-6-jic23@kernel.org
3 years agodt-bindings: iio: adc: lltc,ltc2497 yaml conversion.
Jonathan Cameron [Sun, 9 Aug 2020 11:17:44 +0000 (12:17 +0100)]
dt-bindings: iio: adc: lltc,ltc2497 yaml conversion.

Very simple binding for this i2c device with a reference supply.

Added the #io-channel-cells property to allow for consumers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Link: https://lore.kernel.org/r/20200809111753.156236-5-jic23@kernel.org
3 years agodt-bindings: iio: adc: ti,adc108s102 yaml conversion
Jonathan Cameron [Sun, 9 Aug 2020 11:17:43 +0000 (12:17 +0100)]
dt-bindings: iio: adc: ti,adc108s102 yaml conversion

Very simple conversion of spi device with reference supply.

Added the #io-channel-cells property to allow for consumers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Link: https://lore.kernel.org/r/20200809111753.156236-4-jic23@kernel.org
3 years agodt-bindings: trivial-devices: Add mcp342x ADCs and drop separate binding doc.
Jonathan Cameron [Sun, 9 Aug 2020 11:17:42 +0000 (12:17 +0100)]
dt-bindings: trivial-devices: Add mcp342x ADCs and drop separate binding doc.

These i2c devices have simple bindings, well described by trivial-device.yaml
so rather than convert the binding doc to yaml, let us just add them to
trivial devices and drop the old binding document.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Link: https://lore.kernel.org/r/20200809111753.156236-3-jic23@kernel.org
3 years agoiio: accel: adxl372: Add additional trigger ABI docs
Alexandru Tachici [Mon, 10 Aug 2020 09:32:57 +0000 (12:32 +0300)]
iio: accel: adxl372: Add additional trigger ABI docs

Document use of additional trigger supplied by driver.

Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com>
Link: https://lore.kernel.org/r/20200810093257.65929-3-alexandru.tachici@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: adxl372: Add support for FIFO peak mode
Stefan Popa [Mon, 10 Aug 2020 09:32:56 +0000 (12:32 +0300)]
iio: accel: adxl372: Add support for FIFO peak mode

By default, if all three channels (x, y, z) are enabled, sample sets of
concurrent 3-axis data is stored in the FIFO. This patch adds the option
to configure the FIFO to store peak acceleration (x, y and z) of every
over-threshold event. When pushing to iio buffer we push only enabled
axis data.

Currently the driver configures adxl372 to work in loop mode.
The inactivity and activity timings  decide how fast the chip
will loop through the awake and waiting states and the
thresholds on x,y,z axis decide when activity or inactivity
will be detected.

This patch adds standard events sysfs entries for the inactivity
and activity timings: thresh_falling_period/thresh_rising_period
and for the in_accel_x_thresh_falling/rising_value.

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com>
Link: https://lore.kernel.org/r/20200810093257.65929-2-alexandru.tachici@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:temperature:mlx90632: Some stylefixing leftovers
Crt Mori [Tue, 18 Aug 2020 21:37:37 +0000 (23:37 +0200)]
iio:temperature:mlx90632: Some stylefixing leftovers

There is some inconsistency and whitespace cleanup performed in this
patch. It was done on top of my other patches, but I can rebase to head
of the togreg branch if it would go in sooner.

Signed-off-by: Crt Mori <cmo@melexis.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200818213737.140613-6-cmo@melexis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:temperature:mlx90632: Adding extended calibration option
Crt Mori [Tue, 18 Aug 2020 21:37:36 +0000 (23:37 +0200)]
iio:temperature:mlx90632: Adding extended calibration option

For some time the market wants medical grade accuracy in medical range,
while still retaining the declared accuracy outside of the medical range
within the same sensor. That is why we created extended calibration
which is automatically switched to when object temperature is too high.

This patch also introduces the object_ambient_temperature variable which
is needed for more accurate calculation of the object infra-red
footprint as sensor's ambient temperature might be totally different
than what the ambient temperature is at object and that is why we can
have some more errors which can be eliminated. Currently this temperature
is fixed at 25, but the interface to adjust it by user (with external
sensor or just IR measurement of the other object which acts as ambient),
will be introduced in another commit.

Signed-off-by: Crt Mori <cmo@melexis.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200818213737.140613-5-cmo@melexis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:temperature:mlx90632: Convert polling while loop to regmap
Crt Mori [Tue, 18 Aug 2020 21:37:35 +0000 (23:37 +0200)]
iio:temperature:mlx90632: Convert polling while loop to regmap

Reduce number of lines and improve readability to convert polling while
loops to regmap_read_poll_timeout.

Signed-off-by: Crt Mori <cmo@melexis.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200818213737.140613-4-cmo@melexis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:temperature:mlx90632: Add kerneldoc to the internal struct
Crt Mori [Tue, 18 Aug 2020 21:37:34 +0000 (23:37 +0200)]
iio:temperature:mlx90632: Add kerneldoc to the internal struct

Document internal/private struct for mlx90632 device.

Signed-off-by: Crt Mori <cmo@melexis.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200818213737.140613-3-cmo@melexis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:temperature:mlx90632: Reduce number of equal calulcations
Crt Mori [Tue, 18 Aug 2020 21:37:33 +0000 (23:37 +0200)]
iio:temperature:mlx90632: Reduce number of equal calulcations

TAdut4 was calculated each iteration although it did not change. In light
of near future additions of the Extended range DSP calculations, this
function refactoring will help reduce unrelated changes in that series as
well as reduce the number of new functions needed.

Signed-off-by: Crt Mori <cmo@melexis.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200818213737.140613-2-cmo@melexis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: gyro: adxrs290: Insert missing mutex initialization call
Nishant Malpani [Tue, 25 Aug 2020 12:45:52 +0000 (18:15 +0530)]
iio: gyro: adxrs290: Insert missing mutex initialization call

Insert a missing mutex_init() call during the probe that initializes
the driver's local lock to unlocked state.

Fixes: 2c8920fff145 ("iio: gyro: Add driver support for ADXRS290")
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Link: https://lore.kernel.org/r/20200825124552.11155-1-nish.malpani25@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodocs: abi: iio: Use What: consistently
Gwendal Grignou [Fri, 28 Aug 2020 23:31:55 +0000 (16:31 -0700)]
docs: abi: iio: Use What: consistently

Change "[w|W]hat[:| ]" to What: for consistency.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Link: https://lore.kernel.org/r/20200828233156.2264689-2-gwendal@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: multiplexer: iio-mux: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:26 +0000 (08:47 +0200)]
iio: multiplexer: iio-mux: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Peter Rosin <peda@axentia.se>
Link: https://lore.kernel.org/r/20200829064726.26268-18-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: magnetometer: mag3110: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:25 +0000 (08:47 +0200)]
iio: magnetometer: mag3110: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-17-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: magnetometer: ak8974: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:24 +0000 (08:47 +0200)]
iio: magnetometer: ak8974: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20200829064726.26268-16-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: light: tsl2772: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:23 +0000 (08:47 +0200)]
iio: light: tsl2772: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-15-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: light: isl29018: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:22 +0000 (08:47 +0200)]
iio: light: isl29018: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-14-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: imu: inv_mpu6050: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:21 +0000 (08:47 +0200)]
iio: imu: inv_mpu6050: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Link: https://lore.kernel.org/r/20200829064726.26268-13-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: dac: dpot-dac: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:20 +0000 (08:47 +0200)]
iio: dac: dpot-dac: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Peter Rosin <peda@axentia.se>
Link: https://lore.kernel.org/r/20200829064726.26268-12-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: chemical: scd30: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:19 +0000 (08:47 +0200)]
iio: chemical: scd30: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Tomasz Duszynski <tomasz.duszynski@octakon.com>
Link: https://lore.kernel.org/r/20200829064726.26268-11-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: amplifiers: hmc425a: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:18 +0000 (08:47 +0200)]
iio: amplifiers: hmc425a: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-10-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: afe: iio-rescale: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:17 +0000 (08:47 +0200)]
iio: afe: iio-rescale: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Peter Rosin <peda@axentia.se>
Link: https://lore.kernel.org/r/20200829064726.26268-9-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: stm32: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:16 +0000 (08:47 +0200)]
iio: adc: stm32: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-8-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: rcar-gyroadc: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:15 +0000 (08:47 +0200)]
iio: adc: rcar-gyroadc: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-7-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: meson_saradc: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:14 +0000 (08:47 +0200)]
iio: adc: meson_saradc: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-6-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: ltc2497: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:13 +0000 (08:47 +0200)]
iio: adc: ltc2497: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-5-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: exynos_adc: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:12 +0000 (08:47 +0200)]
iio: adc: exynos_adc: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-4-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: envelope-detector: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:11 +0000 (08:47 +0200)]
iio: adc: envelope-detector: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Peter Rosin <peda@axentia.se>
Link: https://lore.kernel.org/r/20200829064726.26268-3-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: mma8452: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:10 +0000 (08:47 +0200)]
iio: accel: mma8452: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-2-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bma180: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:09 +0000 (08:47 +0200)]
iio: accel: bma180: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-1-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: chemical: atlas-ezo-sensor: add humidity sensor support
Matt Ranostay [Mon, 17 Aug 2020 00:50:52 +0000 (03:50 +0300)]
iio: chemical: atlas-ezo-sensor: add humidity sensor support

Add support for atlas,hum-ezo / humidity sensor which with scaling
provides respective data in millipercent

Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: chemical: add Atlas EZO Humidity module documentation
Matt Ranostay [Mon, 17 Aug 2020 00:50:51 +0000 (03:50 +0300)]
dt-bindings: iio: chemical: add Atlas EZO Humidity module documentation

Cc: devicetree@vger.kernel.org
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: adi-axi-adc: Use kobj_to_dev() instead of container_of()
Tian Tao [Thu, 20 Aug 2020 03:01:26 +0000 (11:01 +0800)]
iio: adc: adi-axi-adc: Use kobj_to_dev() instead of container_of()

Use kobj_to_dev() instead of container_of()

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: dac: ad5686: Constify static struct iio_chan_spec
Rikard Falkeborn [Tue, 26 May 2020 21:02:21 +0000 (23:02 +0200)]
iio: dac: ad5686: Constify static struct iio_chan_spec

These are never modified and can be made const to allow the compiler to
put it in read-only memory.

Before:
   text    data     bss     dec     hex filename
   6642   12608      64   19314    4b72 drivers/iio/dac/ad5686.o

After:
   text    data     bss     dec     hex filename
  16946    2304      64   19314    4b72 drivers/iio/dac/ad5686.o

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio/dac: convert ltc2632.txt to lltc,ltc2632.yaml
Chris Ruehl [Mon, 10 Aug 2020 03:37:52 +0000 (11:37 +0800)]
iio/dac: convert ltc2632.txt to lltc,ltc2632.yaml

Conversion of the ltc2632 to yaml format and name the file to
'lltc,ltc2632.yaml'.

Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: documentation: light: Add as73211 sysfs documentation
Christian Eggers [Mon, 10 Aug 2020 05:24:47 +0000 (07:24 +0200)]
iio: documentation: light: Add as73211 sysfs documentation

The driver for the as73211 light sensor provides the following not yet
documented sysfs entries:
- in_intensity_(x|y|z)_raw
- in_intensity_(x|y|z)_scale
- in_intensity_sampling_frequency(_available)
- in_intensity_hardwaregain(_available)
- in_intensity_integration_time

Signed-off-by: Christian Eggers <ceggers@arri.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:adc:axp20x: Convert from OF to generic fw / device properties
Jonathan Cameron [Sun, 9 Aug 2020 14:13:05 +0000 (15:13 +0100)]
iio:adc:axp20x: Convert from OF to generic fw / device properties

Whilst fairly unlikely anyone will ever use this driver with anything
other than DT, we are trying to move IIO over to the generic interfaces
where easy to do so.

In this case this involved moving to generic check on presence
of fwnode, generic device_get_match_data() and dropping the of_match_ptr
protection.  Also relevant header changes to have property.h and
mod_devicetable.h only.

Also drop the casting away of a const in favour of retaining
the const throughout.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Quentin Schulz <quentin.schulz@bootlin.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
3 years agoDocumentation: ABI: iio: fix some spelling mistakes
Ahmad Fatoum [Thu, 13 Aug 2020 06:52:20 +0000 (08:52 +0200)]
Documentation: ABI: iio: fix some spelling mistakes

This fixes some typos found while browsing the documentation.

Cc: trivial@kernel.org
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: health: max30102: update author's email
Matt Ranostay [Fri, 14 Aug 2020 13:49:41 +0000 (06:49 -0700)]
iio: health: max30102: update author's email

Update email to author's current employer

Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:adc:ti-adc081c: Drop ACPI ids that seem very unlikely to be official.
Jonathan Cameron [Tue, 21 Jul 2020 17:14:41 +0000 (18:14 +0100)]
iio:adc:ti-adc081c: Drop ACPI ids that seem very unlikely to be official.

We have no known users of these in the wild.
it seems very unlikely these are real IDs having the form ADCXXXX
as that ID is owned by Achnor Datacomm not TI.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>