aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2024-05-27net: usb: smsc95xx: fix changing LED_SEL bit value updated from EEPROMParthiban Veerasooran1-4/+7
LED Select (LED_SEL) bit in the LED General Purpose IO Configuration register is used to determine the functionality of external LED pins (Speed Indicator, Link and Activity Indicator, Full Duplex Link Indicator). The default value for this bit is 0 when no EEPROM is present. If a EEPROM is present, the default value is the value of the LED Select bit in the Configuration Flags of the EEPROM. A USB Reset or Lite Reset (LRST) will cause this bit to be restored to the image value last loaded from EEPROM, or to be set to 0 if no EEPROM is present. While configuring the dual purpose GPIO/LED pins to LED outputs in the LED General Purpose IO Configuration register, the LED_SEL bit is changed as 0 and resulting the configured value from the EEPROM is cleared. The issue is fixed by using read-modify-write approach. Fixes: f293501c61c5 ("smsc95xx: configure LED outputs") Signed-off-by: Parthiban Veerasooran <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Woojung Huh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
2024-05-27ACPI: EC: Avoid returning AE_OK on errors in address space handlerArmin Wolf1-1/+3
If an error code other than EINVAL, ENODEV or ETIME is returned by acpi_ec_read() / acpi_ec_write(), then AE_OK is incorrectly returned by acpi_ec_space_handler(). Fix this by only returning AE_OK on success, and return AE_ERROR otherwise. Signed-off-by: Armin Wolf <[email protected]> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
2024-05-27ACPI: EC: Abort address space access upon errorArmin Wolf1-1/+4
When a multi-byte address space access is requested, acpi_ec_read()/ acpi_ec_write() is being called multiple times. Abort such operations if a single call to acpi_ec_read() / acpi_ec_write() fails, as the data read from / written to the EC might be incomplete. Signed-off-by: Armin Wolf <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2024-05-27ACPI: APEI: EINJ: Fix einj_dev release leakDan Williams1-1/+1
The platform driver conversion of EINJ mistakenly used platform_device_del() to unwind platform_device_register_full() at module exit. This leads to a small leak of one 'struct platform_device' instance per module load/unload cycle. Switch to platform_device_unregister() which performs both device_del() and final put_device(). Fixes: 5621fafaac00 ("EINJ: Migrate to a platform driver") Cc: 6.9+ <[email protected]> # 6.9+ Signed-off-by: Dan Williams <[email protected]> Reviewed-by: Ben Cheatham <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2024-05-27HSI: ssi_protocol: Remove unused linux/gpio.hAndy Shevchenko1-1/+0
linux/gpio.h is deprecated and subject to remove. The driver doesn't use it, simply remove the unused header. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2024-05-27platform/x86/amd/pmf: Use memdup_user()Thorsten Blum1-8/+3
Switch to memdup_user() to overwrite the allocated memory only once instead of initializing the allocated memory to zero with kzalloc() and then immediately overwriting it with copy_from_user(). Fixes the following Coccinelle/coccicheck warning reported by memdup_user.cocci: WARNING opportunity for memdup_user Signed-off-by: Thorsten Blum <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
2024-05-27Octeontx2-pf: Free send queue buffers incase of leaf to innerHariprasad Kelam1-0/+4
There are two type of classes. "Leaf classes" that are the bottom of the class hierarchy. "Inner classes" that are neither the root class nor leaf classes. QoS rules can only specify leaf classes as targets for traffic. Root / \ / \ 1 2 /\ / \ 4 5 classes 1,4 and 5 are leaf classes. class 2 is a inner class. When a leaf class made as inner, or vice versa, resources associated with send queue (send queue buffers and transmit schedulers) are not getting freed. Fixes: 5e6808b4c68d ("octeontx2-pf: Add support for HTB offload") Signed-off-by: Hariprasad Kelam <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
2024-05-27platform/x86: touchscreen_dmi: Add info for the EZpad 6s Prohmtheboy1541-0/+11
The "EZpad 6s Pro" uses the same touchscreen as the "EZpad 6 Pro B", unlike the "Ezpad 6 Pro" which has its own touchscreen. Signed-off-by: hmtheboy154 <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2024-05-27platform/x86: touchscreen_dmi: Add info for GlobalSpace SolT IVW 11.6" tablethmtheboy1541-0/+25
This is a tablet created by GlobalSpace Technologies Limited which uses an Intel Atom x5-Z8300, 4GB of RAM & 64GB of storage. Link: https://web.archive.org/web/20171102141952/http://globalspace.in/11.6-device.html Signed-off-by: hmtheboy154 <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2024-05-27platform/x86: touchscreen_dmi: Add support for setting touchscreen ↵Hans de Goede1-3/+76
properties from cmdline On x86/ACPI platforms touchscreens mostly just work without needing any device/model specific configuration. But in some cases (mostly with Silead and Goodix touchscreens) it is still necessary to manually specify various touchscreen-properties on a per model basis. touchscreen_dmi is a special place for DMI quirks for this, but it can be challenging for users to figure out the right property values, especially for Silead touchscreens where non of these can be read back from the touchscreen-controller. ATM users can only test touchscreen properties by editing touchscreen_dmi.c and then building a completely new kernel which makes it unnecessary difficult for users to test and submit properties when necessary for their laptop / tablet model. Add support for specifying properties on the kernel commandline to allow users to easily figure out the right settings. See the added documentation in kernel-parameters.txt for the commandline syntax. Cc: Gregor Riepl <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2024-05-27ata: Kconfig: Update SATA_MOBILE_LPM_POLICY default to med_power_with_dipmMario Limonciello1-1/+1
Historically this was set to "keep_firmware_settings" to prevent problems with power management on very old drives. However it's been observed that almost all modern Linux distributions either set the policy to "med_power_with_dipm" in the kernel configuration or update it to this via userspace policy changes. Update the policy default in the kernel to "med_power_with_dipm" to match that behavior as well. Changing the default was previously not a good idea, because LPM disables detection of hot plug removals, however, since commit ae1f3db006b7 ("ata: ahci: do not enable LPM on external ports"), a port marked as external will always be initialized to "keep_firmware_settings", regardless of the SATA_MOBILE_LPM_POLICY Kconfig value. Therefore, changing the default is now considered safe (external ports included). Reviewed-by: Damien Le Moal <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> [cassel: rebased and reworded commit message] Signed-off-by: Niklas Cassel <[email protected]>
2024-05-27media: mgb4: Fix double debugfs removeMartin Tůma1-3/+4
Fixes an error where debugfs_remove_recursive() is called first on a parent directory and then again on a child which causes a kernel panic. Signed-off-by: Martin Tůma <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Fixes: 0ab13674a9bd ("media: pci: mgb4: Added Digiteq Automotive MGB4 driver") Cc: <[email protected]> [hverkuil: added Fixes/Cc tags]
2024-05-27platform/x86: thinkpad_acpi: Select INPUT_SPARSEKMAP in KconfigSteven Rostedt (Google)1-0/+1
Now that drivers/platform/x86/thinkpad_acpi.c uses sparse_keymap_report_event(), it must select INPUT_SPARSEKMAP in its Kconfig option otherwise the build fails with: ld: vmlinux.o: in function `tpacpi_input_send_key': thinkpad_acpi.c:(.text+0xd4d27f): undefined reference to `sparse_keymap_report_event' ld: vmlinux.o: in function `hotkey_init': thinkpad_acpi.c:(.init.text+0x66cb6): undefined reference to `sparse_keymap_setup' Fixes: 42f7b965de9d ("platform/x86: thinkpad_acpi: Switch to using sparse-keymap helpers") Signed-off-by: Steven Rostedt (Google) <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2024-05-27platform/x86: x86-android-tablets: Add "select LEDS_CLASS"Hans de Goede1-0/+2
Since the x86-android-tablets now calls devm_led_classdev_register_ext() it needs to select LEDS_CLASS as well as LEDS_CLASS' NEW_LEDS dependency. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2024-05-27platform/x86: ISST: fix use-after-free in tpmi_sst_dev_remove()Harshit Mogalapalli1-1/+1
In tpmi_sst_dev_remove(), tpmi_sst is dereferenced after being freed. Fix this by reordering the kfree() post the dereference. Fixes: 9d1d36268f3d ("platform/x86: ISST: Support partitioned systems") Signed-off-by: Harshit Mogalapalli <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2024-05-27clk: samsung: exynos-clkout: Remove misleading ↵Marek Szyprowski1-3/+4
of_match_table/MODULE_DEVICE_TABLE Since commit 9484f2cb8332 ("clk: samsung: exynos-clkout: convert to module driver") this driver is instantiated as MFD-cell (matched by platform device name) not as a real platform device created by OF code. Remove then of_match_table and change related MODULE_DEVICE_TABLE to simple MODULE_ALIAS to avoid further confusion. Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Sam Protsenko <[email protected]> Reviewed-by: Will McVicker <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Krzysztof Kozlowski <[email protected]>
2024-05-27enic: Validate length of nl attributes in enic_set_vf_portRoded Zats1-0/+12
enic_set_vf_port assumes that the nl attribute IFLA_PORT_PROFILE is of length PORT_PROFILE_MAX and that the nl attributes IFLA_PORT_INSTANCE_UUID, IFLA_PORT_HOST_UUID are of length PORT_UUID_MAX. These attributes are validated (in the function do_setlink in rtnetlink.c) using the nla_policy ifla_port_policy. The policy defines IFLA_PORT_PROFILE as NLA_STRING, IFLA_PORT_INSTANCE_UUID as NLA_BINARY and IFLA_PORT_HOST_UUID as NLA_STRING. That means that the length validation using the policy is for the max size of the attributes and not on exact size so the length of these attributes might be less than the sizes that enic_set_vf_port expects. This might cause an out of bands read access in the memcpys of the data of these attributes in enic_set_vf_port. Fixes: f8bd909183ac ("net: Add ndo_{set|get}_vf_port support for enic dynamic vnics") Signed-off-by: Roded Zats <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
2024-05-27Merge drm/drm-next into drm-misc-nextMaxime Ripard4069-121089/+189748
Let's start the new release cycle. Signed-off-by: Maxime Ripard <[email protected]>
2024-05-27wifi: rtw89: Fix P2P behavior for WiFi 7 chipsPo-Hao Huang2-0/+14
Previously we used CCK rate when scanning for P2P on WiFi 7 chips. Fix this by explicitly setting the rate to OFDM 6Mbps. Signed-off-by: Po-Hao Huang <[email protected]> Signed-off-by: Ping-Ke Shih <[email protected]> Link: https://msgid.link/[email protected]
2024-05-27wifi: rtw89: add LDPC and STBC to rx_status and radiotap known fields for ↵Ping-Ke Shih3-1/+39
monitor mode Add LDPC and STBC to rx_status by hardware PPDU status, and set them as known fields of radiotap, so we can check these capabilities in monitor mode. Signed-off-by: Ping-Ke Shih <[email protected]> Link: https://msgid.link/[email protected]
2024-05-27wifi: rtw89: fill STBC and LDPC capabilities to TX descriptorPing-Ke Shih3-2/+14
Fill STBC and LDPC fields to get better performance when transmitting under noisy environment. Old chips like 8852AE use firmware command to enable these two capabilities, but newer chips must use TX descriptor. Signed-off-by: Ping-Ke Shih <[email protected]> Link: https://msgid.link/[email protected]
2024-05-27iio: invensense: fix odr switching to same valueJean-Baptiste Maneyrol1-1/+5
ODR switching happens in 2 steps, update to store the new value and then apply when the ODR change flag is received in the data. When switching to the same ODR value, the ODR change flag is never happening, and frequency switching is blocked waiting for the never coming apply. Fix the issue by preventing update to happen when switching to same ODR value. Fixes: 0ecc363ccea7 ("iio: make invensense timestamp module generic") Cc: [email protected] Signed-off-by: Jean-Baptiste Maneyrol <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: adc: ad7173: Remove index from temp channelDumitru Ceclan1-1/+0
Temperature channel is unique per device, index is not needed. This is breaking userspace: Include fixes tag to be released within the same rc cycle. Fixes: 76a1e6a42802 ("iio: adc: ad7173: add AD7173 driver") Signed-off-by: Dumitru Ceclan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: adc: ad7173: Add ad7173_device_info namesDumitru Ceclan1-0/+3
Add missing names from the device info struct for 3 models to ensure consistency with the rest of the models. Fixes: 76a1e6a42802 ("iio: adc: ad7173: add AD7173 driver") Signed-off-by: Dumitru Ceclan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: adc: ad7173: fix buffers enablement for ad7176-2Dumitru Ceclan1-2/+10
AD7176-2 does not feature input buffers and marks corespondent register bits as read only. Enable buffers only on supported models. Fixes: 76a1e6a42802 ("iio: adc: ad7173: add AD7173 driver") Reviewed-by: David Lechner <[email protected]> Signed-off-by: Dumitru Ceclan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: temperature: mlx90635: Fix ERR_PTR dereference in mlx90635_probe()Harshit Mogalapalli1-3/+3
When devm_regmap_init_i2c() fails, regmap_ee could be error pointer, instead of checking for IS_ERR(regmap_ee), regmap is checked which looks like a copy paste error. Fixes: a1d1ba5e1c28 ("iio: temperature: mlx90635 MLX90635 IR Temperature sensor") Reviewed-by: Crt Mori<[email protected]> Signed-off-by: Harshit Mogalapalli <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: imu: bmi323: Fix trigger notification in case of errorVasileios Amoiridis1-2/+3
In case of error in the bmi323_trigger_handler() function, the function exits without calling the iio_trigger_notify_done() which is responsible for informing the attached trigger that the process is done and in case there is a .reenable(), to call it. Fixes: 8a636db3aa57 ("iio: imu: Add driver for BMI323 IMU") Signed-off-by: Vasileios Amoiridis <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: dac: ad5592r: fix temperature channel scaling valueMarc Ferland1-1/+1
The scale value for the temperature channel is (assuming Vref=2.5 and the datasheet): 376.7897513 When calculating both val and val2 for the temperature scale we use (3767897513/25) and multiply it by Vref (here I assume 2500mV) to obtain: 2500 * (3767897513/25) ==> 376789751300 Finally we divide with remainder by 10^9 to get: val = 376 val2 = 789751300 However, we return IIO_VAL_INT_PLUS_MICRO (should have been NANO) as the scale type. So when converting the raw temperature value to the 'processed' temperature value we will get (assuming raw=810, offset=-753): processed = (raw + offset) * scale_val = (810 + -753) * 376 = 21432 processed += div((raw + offset) * scale_val2, 10^6) += div((810 + -753) * 789751300, 10^6) += 45015 ==> 66447 ==> 66.4 Celcius instead of the expected 21.5 Celsius. Fix this issue by changing IIO_VAL_INT_PLUS_MICRO to IIO_VAL_INT_PLUS_NANO. Fixes: 56ca9db862bf ("iio: dac: Add support for the AD5592R/AD5593R ADCs/DACs") Signed-off-by: Marc Ferland <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: pressure: bmp280: Fix BMP580 temperature readingAdam Rizkalla1-5/+5
Fix overflow issue when storing BMP580 temperature reading and properly preserve sign of 24-bit data. Signed-off-by: Adam Rizkalla <[email protected]> Tested-By: Vasileios Amoiridis <[email protected]> Acked-by: Angel Iglesias <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: adc: ad9467: fix scan type signDavid Lechner1-2/+2
According to the IIO documentation, the sign in the scan type should be lower case. The ad9467 driver was incorrectly using upper case. Fix by changing to lower case. Fixes: 4606d0f4b05f ("iio: adc: ad9467: add support for AD9434 high-speed ADC") Fixes: ad6797120238 ("iio: adc: ad9467: add support AD9467 ADC") Signed-off-by: David Lechner <[email protected]> Link: https://lore.kernel.org/r/20240503-ad9467-fix-scan-type-sign-v1-1-c7a1a066ebb9@baylibre.com Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: pressure: bmp280: Introduce new cleanup routinesVasileios Amoiridis1-81/+84
Introduce new linux/cleanup.h with the guard(mutex) functionality. Suggested-by: Andy Shevchenko <[email protected]> Suggested-by: Jonathan Cameron <[email protected]> Signed-off-by: Vasileios Amoiridis <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: pressure: bmp280: Refactorize reading functionsVasileios Amoiridis2-133/+224
For BMP18x, BMP28x, BME280, BMP38x the reading of the pressure value requires an update of the t_fine variable which happens through reading the temperature value. So all the bmpxxx_read_press() functions of the above sensors are internally calling the equivalent bmpxxx_read_temp() function in order to update the t_fine value. By just looking at the code this functionality is a bit hidden and is not easy to understand why those channels are not independent. This commit tries to clear these things a bit by splitting the bmpxxx_{read/compensate}_{temp/press/humid}() to the following: i. bmpxxx_read_{temp/press/humid}_adc(): read the raw value from the sensor. ii. bmpxx_calc_t_fine(): calculate the t_fine variable. iii. bmpxxx_get_t_fine(): get the t_fine variable. iv. bmpxxx_compensate_{temp/press/humid}(): compensate the adc values and return the calculated value. v. bmpxxx_read_{temp/press/humid}(): combine calls of the aforementioned functions to return the requested value. Suggested-by: Jonathan Cameron <[email protected]> Signed-off-by: Vasileios Amoiridis <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: pressure: bmp280: Use unsigned data types for raw sensor dataVasileios Amoiridis1-23/+22
The raw sensor data that have not been compensated yet cannot be signed values, so use unsigned ones. Also, compensated pressure values cannot be negative so use unsigned also there. Also, drop redundant cast of data->t_fine variable from s32 to s32. Signed-off-by: Vasileios Amoiridis <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: pressure: bmp280: Make error checks consistentVasileios Amoiridis1-20/+20
The form 'if (ret)' is used in this driver in order to check for returned error values. There are also some places that 'if (ret < 0)' is used but for no specific reason. Change them to 'if (ret)' to make the driver more consistent. Signed-off-by: Vasileios Amoiridis <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: pressure: bmp280: Remove, add and update error messagesVasileios Amoiridis1-17/+38
Remove duplicate error messages, add missing error messages and update redundant ones. Add one missing error check. Signed-off-by: Vasileios Amoiridis <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: pressure: bmp280: Remove dead error checksVasileios Amoiridis1-4/+0
The ret value is being checked already in all the previous paths which exit in case of error, so this path can never become true. Signed-off-by: Vasileios Amoiridis <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: Drop explicit initialization of struct i2c_device_id::driver_data to 0Uwe Kleine-König93-131/+131
These drivers don't use the driver_data member of struct i2c_device_id, so don't explicitly initialize this member. This prepares putting driver_data in an anonymous union which requires either no initialization or named designators. But it's also a nice cleanup on its own. While add it, also remove commas after the sentinel entries. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: pressure: bmp280: Add more intuitive name for bmp180_measure()Vasileios Amoiridis1-8/+8
The bmp180_measure() function essentially waits for the end of the current conversion in order to read the values from the sensors. The name bmp180_measure() could be misinterpreted because it could be translated as "measure sensor values" even though it was probably trying to say "measure time for eoc". Give a more intuitive name to this function to be less confusing. Signed-off-by: Vasileios Amoiridis <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: pressure: bmp280: Add identifier names in function definitionsVasileios Amoiridis1-7/+7
checkpatch.pl complained about missing identifier names in the input variables for some function definitions. Signed-off-by: Vasileios Amoiridis <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: pressure: bmp280: Use BME prefix for BME280 specificsVasileios Amoiridis3-44/+46
Change the rest of the defines and function names that are used specifically by the BME280 humidity sensor to BME280 as it is done for the rest of the BMP{0,1,3,5}80 sensors. Signed-off-by: Vasileios Amoiridis <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: pressure: bmp280: Improve indentation and line wrappingVasileios Amoiridis2-51/+61
Fix indentations that are not following the standards, remove extra white lines and add missing white lines. Signed-off-by: Vasileios Amoiridis <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: test: gts: test available times and gains sortingMatti Vaittinen1-3/+5
The iio_gts helpers build available times and scales tables based on the times and gains arrays given from the driver. The driver should be able to list all valid register values so that conversion from register valu to correct gain/time works for all supported register values. It might be more convenient for drivers to list these times and gains in the order where they're listed in the data-sheet than ascending order. However, for user who requests the supported scales / times it is more convenient to get the results in asscending order. Also, listing duplicated values is not meaning for the user. Hence the GTS heler should do sorting and deduplication of the scales and times when it builds the tables listing the available times/scales. Note, currently duplicated gain values aren't handled by GTS-helpers. Unsort the gain and time arrays in the test code, and add duplicates to time array in order to test the sorting and deduplicating works. Signed-off-by: Matti Vaittinen <[email protected]> Link: https://lore.kernel.org/r/365cc6de3c17a457db738f5fdf8dd3bd6f50d5f2.1714480171.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: Fix the sorting functionality in iio_gts_build_avail_time_tableChenyuan Yang1-2/+5
The sorting in iio_gts_build_avail_time_table is not working as intended. It could result in an out-of-bounds access when the time is zero. Here are more details: 1. When the gts->itime_table[i].time_us is zero, e.g., the time sequence is `3, 0, 1`, the inner for-loop will not terminate and do out-of-bound writes. This is because once `times[j] > new`, the value `new` will be added in the current position and the `times[j]` will be moved to `j+1` position, which makes the if-condition always hold. Meanwhile, idx will be added one, making the loop keep running without termination and out-of-bound write. 2. If none of the gts->itime_table[i].time_us is zero, the elements will just be copied without being sorted as described in the comment "Sort times from all tables to one and remove duplicates". For more details, please refer to https://lore.kernel.org/all/[email protected]. Reported-by: Chenyuan Yang <[email protected]> Suggested-by: Matti Vaittinen <[email protected]> Fixes: 38416c28e168 ("iio: light: Add gain-time-scale helpers") Signed-off-by: Chenyuan Yang <[email protected]> Co-developed-by: Matti Vaittinen <[email protected]> Signed-off-by: Matti Vaittinen <[email protected]> Link: https://lore.kernel.org/r/d501ade8c1f7b202d34c6404eda423489cab1df5.1714480171.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: imu: bmi160: add support for bmi120Danila Tikhonov3-6/+26
Add support for bmi120 low power variant of bmi160. Relax failure to match ID to a warning rather than probe fail. This allows for fallback compatibles, whilst retaining a useful debugging message if they turn out not to be so compatible due to badly behaved firmware. Signed-off-by: Danila Tikhonov <[email protected]> Co-developed-by: Barnabás Czémán <[email protected]> Signed-off-by: Barnabás Czémán <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: light: gp2ap020a00f: Remove some unused field in struct gp2ap020a00f_dataChristophe JAILLET1-1/+0
In "struct gp2ap020a00f_data", the 'pdata' field is unused. Moreover the "struct gp2ap020a00f_platform_data" is defined nowhere. Neither in this file, nor in a global .h file, so it is completely pointless. So, remove it. Found with cppcheck, unusedStructMember. Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/57e9f29c7062d1bb846064bf6dbd7a8385a855e7.1714568099.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: tmag5273: Remove some unused field in struct tmag5273_dataChristophe JAILLET1-2/+0
In "struct tmag5273_data", the 'scale' and 'vcc' fields are unused. Remove them. Found with cppcheck, unusedStructMember. Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: Gerald Loacker <[email protected]> Link: https://lore.kernel.org/r/7bd16d7fea12c64b6b3dc3cd32839cfce145bcf3.1714562912.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: multiplexer: Remove an unused field in struct muxChristophe JAILLET1-1/+0
In "struct mux", the 'indio_dev' field is unused. Remove it. Found with cppcheck, unusedStructMember. Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/7bb04abdc2815caf090a6c9ecab2a51d837792a7.1714556499.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: temperature: max30208: Remove an unused field in struct max30208_dataChristophe JAILLET1-1/+0
In "struct max30208_data", the 'indio_dev' field is unused. Remove it. Found with cppcheck, unusedStructMember. Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/73f9f540ecdc7c10e833e6fc782324ae7d34ba9c.1714555144.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: adc: ad7606: using claim_direct_scoped for code simplificationJorge Harrisonn1-11/+8
Using iio_device_claim_direct_scoped instead of calling `iio_device _claim_direct_modeand later callingiio_device_release_direct_mode` This should make code cleaner and error handling easier Co-authored-by: Lais Nuto <[email protected]> Signed-off-by: Lais Nuto <[email protected]> Signed-off-by: Jorge Harrisonn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27wifi: rtw89: 8852c: correct logic and restore PCI PHY EQ after device resumePing-Ke Shih1-11/+12
PCI PHY EQ value is missing after card off/on, so update the value after device resume. The original commit only updates once at probe stage, which could lead problem after suspend/resume. The logic should be read a value from one register and write to another register with a mask to avoid affecting unrelated bits. Fixes: a78d33a1286c ("wifi: rtw89: 8852c: disable PCI PHY EQ to improve compatibility") Signed-off-by: Ping-Ke Shih <[email protected]> Link: https://msgid.link/[email protected]