aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2024-08-27md/md-bitmap: merge md_bitmap_update_sb() into bitmap_operationsYu Kuai4-11/+13
So that the implementation won't be exposed, and it'll be possible to invent a new bitmap by replacing bitmap_operations. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
2024-08-27md/md-bitmap: make md_bitmap_print_sb() internalYu Kuai2-4/+2
md_bitmap_print_sb() is only used inside md-bitmap.c, hence make it static, also rename it to bitmap_print_sb. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
2024-08-27md/md-bitmap: merge md_bitmap_flush() into bitmap_operationsYu Kuai3-6/+5
So that the implementation won't be exposed, and it'll be possible to invent a new bitmap by replacing bitmap_operations. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
2024-08-27md/md-bitmap: merge md_bitmap_destroy() into bitmap_operationsYu Kuai3-11/+13
So that the implementation won't be exposed, and it'll be possible to invent a new bitmap by replacing bitmap_operations. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
2024-08-27md/md-bitmap: merge md_bitmap_load() into bitmap_operationsYu Kuai4-8/+11
So that the implementation won't be exposed, and it'll be possible to invent a new bitmap by replacing bitmap_operations. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
2024-08-27md/md-bitmap: merge md_bitmap_create() into bitmap_operationsYu Kuai3-6/+7
So that the implementation won't be exposed, and it'll be possible to invent a new bitmap by replacing bitmap_operations. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
2024-08-27md/md-bitmap: simplify md_bitmap_create() + md_bitmap_load()Yu Kuai3-30/+25
Other than internal api get_bitmap_from_slot(), all other places will set returned bitmap to mddev->bitmap. So move the setting of mddev->bitmap into md_bitmap_create() to simplify code. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
2024-08-27md/md-bitmap: introduce struct bitmap_operationsYu Kuai4-0/+14
The structure is empty for now, and will be used in later patches to merge in bitmap operations, so that bitmap implementation won't be exposed. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
2024-08-27md/md-bitmap: add a new helper md_bitmap_set_pages()Yu Kuai3-3/+8
Currently md-cluster will set bitmap->counts.pages directly, add a helper to do this to avoid dereferencing bitmap directly. Noted that after this patch bitmap is not dereferenced directly anymore and following patches will move the structure inside md-bitmap.c. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
2024-08-27md/md-cluster: use helper md_bitmap_get_stats() to get pages in resize_bitmaps()Yu Kuai1-5/+15
Use the existed helper instead of open coding it, avoid dereferencing bitmap directly to prepare inventing a new bitmap. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
2024-08-27md/md-bitmap: add 'behind_writes' and 'behind_wait' into struct md_bitmap_statsYu Kuai3-5/+13
There are no functional changes, avoid dereferencing bitmap directly to prepare inventing a new bitmap. Also fix following checkpatch warning by using wq_has_sleeper(). WARNING: waitqueue_active without comment Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
2024-08-27md/md-bitmap: add 'file_pages' into struct md_bitmap_statsYu Kuai3-8/+17
There are no functional changes, avoid dereferencing bitmap directly to prepare inventing a new bitmap. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
2024-08-27md/md-bitmap: add 'sync_size' into struct md_bitmap_statsYu Kuai3-14/+27
To avoid dereferencing bitmap directly in md-cluster to prepare inventing a new bitmap. BTW, also fix following checkpatch warnings: WARNING: Deprecated use of 'kmap_atomic', prefer 'kmap_local_page' instead WARNING: Deprecated use of 'kunmap_atomic', prefer 'kunmap_local' instead Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
2024-08-27md/md-cluster: fix spares warnings for __le64Yu Kuai1-3/+3
drivers/md/md-cluster.c:1220:22: warning: incorrect type in assignment (different base types) drivers/md/md-cluster.c:1220:22: expected unsigned long my_sync_size drivers/md/md-cluster.c:1220:22: got restricted __le64 [usertype] sync_size drivers/md/md-cluster.c:1252:35: warning: incorrect type in assignment (different base types) drivers/md/md-cluster.c:1252:35: expected unsigned long sync_size drivers/md/md-cluster.c:1252:35: got restricted __le64 [usertype] sync_size drivers/md/md-cluster.c:1253:41: warning: restricted __le64 degrades to integer Fix the warnings by using le64_to_cpu() to convet __le64 to integer. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
2024-08-27md/md-bitmap: add 'events_cleared' into struct md_bitmap_statsYu Kuai3-2/+17
Also add a new helper to get events_cleared to avoid dereferencing bitmap directly to prepare inventing a new bitmap. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
2024-08-27md: use new helper md_bitmap_get_stats() in update_array_info()Yu Kuai1-5/+7
There are no functional changes, avoid dereferencing bitmap directly to prepare inventing a new bitmap. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
2024-08-27md/md-bitmap: replace md_bitmap_status() with a new helper md_bitmap_get_stats()Yu Kuai3-21/+41
There are no functional changes, and the new helper will be used in multiple places in following patches to avoid dereferencing bitmap directly. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
2024-08-27md/raid1: use md_bitmap_wait_behind_writes() in raid1_read_request()Yu Kuai2-5/+3
Use the existed helper instead of open coding it to make the code cleaner. There are no functional changes, and also avoid dereferencing bitmap directly to prepare inventing a new bitmap. Noted that this patch also export md_bitmap_wait_behind_writes(), which is necessary for now, and the exported api will be removed in following patches to convert bitmap apis into ops. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
2024-08-27md/raid1: Clean up local variable 'b' from raid1_read_request()Yu Kuai1-17/+4
The local variable will only be used onced, in the error path that read_balance() failed to find a valid rdev to read. Since now the rdev is ensured can't be removed from conf while IO is still pending, remove the local variable and dereference rdev directly. Since we're here, also remove an extra empty line, and unnecessary type conversion from sector_t(u64) to unsigned long long. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
2024-08-27md: Don't flush sync_work in md_write_start()Yu Kuai1-1/+0
Because flush sync_work may trigger mddev_suspend() if there are spares, and this should never be done in IO path because mddev_suspend() is used to wait for IO. This problem is found by code review. Fixes: bc08041b32ab ("md: suspend array in md_start_sync() if array need reconfiguration") Cc: [email protected] Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
2024-08-27power: supply: max77693: Expose input current limit and CC current propertiesArtur Weber1-0/+52
There are two charger current limit registers: - Fast charge current limit (which controls current going from the charger to the battery); - CHGIN input current limit (which controls current going into the charger through the cable). Add the necessary functions to retrieve the CHGIN input limit (from CHARGER regulator) and maximum fast charge current values, and expose them as power supply properties. Tested-by: Henrik Grimler <[email protected]> Signed-off-by: Artur Weber <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2024-08-27power: supply: max17042_battery: Fix SOC threshold calc w/ no current senseArtur Weber1-1/+4
Commit 223a3b82834f ("power: supply: max17042_battery: use VFSOC for capacity when no rsns") made it so that capacity on systems without current sensing would be read from VFSOC instead of RepSOC. However, the SOC threshold calculation still read RepSOC to get the SOC regardless of the current sensing option state. Fix this by applying the same conditional to determine which register should be read. This also seems to be the intended behavior as per the datasheet - SOC alert config value in MiscCFG on setups without current sensing is set to a value of 0b11, indicating SOC alerts being generated based on VFSOC, instead of 0b00 which indicates SOC alerts being generated based on RepSOC. This fixes an issue on the Galaxy S3/Midas boards, where the alert interrupt would be constantly retriggered, causing high CPU usage on idle (around ~12%-15%). Fixes: e5f3872d2044 ("max17042: Add support for signalling change in SOC") Signed-off-by: Artur Weber <[email protected]> Reviewed-by: Henrik Grimler <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2024-08-27HID: winwing: constify read-only structsThomas Weißschuh1-3/+3
These structs are never modified, so mark them as const. Signed-off-by: Thomas Weißschuh <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Benjamin Tissoires <[email protected]>
2024-08-27power: supply: axp20x_usb_power: add input-current-limit-microampChris Morgan1-0/+22
Allow users to specify a maximum input current for the device. Some devices allow up to 3.25A of input current (such as the AXP717), which may be too much for some implementations. Signed-off-by: Chris Morgan <[email protected]> Acked-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2024-08-27power: supply: axp20x_usb_power: Make VBUS and IIO config per deviceChris Morgan1-33/+54
Make reading of the vbus value and configuring of the iio channels device specific, to allow additional devices (such as the AXP717) to be supported by this driver. Signed-off-by: Chris Morgan <[email protected]> Acked-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2024-08-27power: supply: axp20x_battery: Make iio and battery config per deviceChris Morgan1-49/+88
Move the configuration of battery specific information and available iio channels from the probe function to a device specific routine, allowing us to use this driver for devices with slightly different configurations (such as the AXP717). Signed-off-by: Chris Morgan <[email protected]> Acked-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2024-08-27power: supply: axp20x_battery: Remove design from min and max voltageChris Morgan1-8/+8
The POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN and POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN values should be immutable properties of the battery, but for this driver they are writable values and used as the minimum and maximum values for charging. Remove the DESIGN designation from these values. Fixes: 46c202b5f25f ("power: supply: add battery driver for AXP20X and AXP22X PMICs") Suggested-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Chris Morgan <[email protected]> Acked-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2024-08-27Input: mt6779-keypad - fix module autoloadingLiao Chen1-0/+1
Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based on the alias from of_device_id table. Signed-off-by: Liao Chen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
2024-08-27pktcdvd: remove unnecessary debugfs_create_dir() error checkYang Ruibin1-2/+0
Remove the debugfs_create_dir() error check. It's safe to pass in error pointers to the debugfs API, hence the user isn't supposed to include error checking of the return values. Signed-off-by: Yang Ruibin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
2024-08-27hwmon: (pwmfan) Do not force disable pwm controllerJohannes Kirchmair1-5/+6
The pwm1_enable attribute of the pwmfan driver influences the mode of operation, especially in case of a requested pwm1 duty cycle of zero. Especially setting pwm1_enable to two, should keep the pwm controller enabled even if the duty cycle is set to zero [1]. This is not the case at the moment, as the pwm controller is disabled always if pwm1 is set to zero. This commit tries to fix this behavior. [1] https://docs.kernel.org/hwmon/pwm-fan.html Signed-off-by: Johannes Kirchmair <[email protected]> Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2024-08-27hwmon: (pc87360) Use min() macroShen Lichuan1-1/+1
Use the min() macro to simplify the pc87360_init_device() function and improve its readability. Signed-off-by: Shen Lichuan <[email protected]> Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2024-08-27hwmon: Add sophgo SG2042 external hardware monitor supportInochi Amaoto3-0/+400
SG2042 use an external MCU to provide basic hardware information and thermal sensors. Add driver support for the onboard MCU of SG2042. Signed-off-by: Inochi Amaoto <[email protected]> Message-ID: <IA1PR20MB49536C786048D1E676BB9C20BB822@IA1PR20MB4953.namprd20.prod.outlook.com> Signed-off-by: Guenter Roeck <[email protected]>
2024-08-27hwmon: (tmp464): Simplify with scoped for each OF child loopJinjie Ruan1-5/+2
Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Jinjie Ruan <[email protected]> Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2024-08-27hwmon: (tmp421): Simplify with scoped for each OF child loopJinjie Ruan1-5/+2
Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Jinjie Ruan <[email protected]> Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2024-08-27hwmon: (npcm750-pwm-fan): Simplify with scoped for each OF child loopJinjie Ruan1-3/+2
Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Jinjie Ruan <[email protected]> Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2024-08-27hwmon: (nct7802): Simplify with scoped for each OF child loopJinjie Ruan1-5/+2
Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Jinjie Ruan <[email protected]> Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2024-08-27hwmon: (lm90): Simplify with scoped for each OF child loopJinjie Ruan1-5/+2
Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Jinjie Ruan <[email protected]> Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2024-08-27hwmon: (ina3221): Simplify with scoped for each OF child loopJinjie Ruan1-5/+2
Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Jinjie Ruan <[email protected]> Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2024-08-27hwmon: (aspeed-pwm-tacho): Simplify with scoped for each OF child loopJinjie Ruan1-5/+3
Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Jinjie Ruan <[email protected]> Reviewed-by: Andrew Jeffery <[email protected]> Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2024-08-27hwmon: (aspeed-g6-pwm-tacho): Simplify with scoped for each OF child loopJinjie Ruan1-3/+1
Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Jinjie Ruan <[email protected]> Reviewed-by: Andrew Jeffery <[email protected]> Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2024-08-27hwmon: (k10temp): Use cpu_feature_enabled() for detecting zenMario Limonciello1-16/+10
This removes some boilerplate from the code and will allow adding future CPUs by just device IDs. Signed-off-by: Mario Limonciello <[email protected]> Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2024-08-27hwmon: (oxp-sensors) Add support for multiple new devices.Derek J. Clark1-45/+254
Add support for the OrangePi NEO-01. It uses different registers for PWM manual mode, set PWM, and read fan speed than previous devices. Valid PWM input and duty cycle is 1-244, we scale this from 1-255 to maintain compatibility with the existing interface. Add OneXPlayer 2 series, OneXFly, and X1 series models. The 2/X1 series use new registers for turbo button takeover and read fan speed. X1 has an Intel variant so change the CPU detection at init to only check for the affected devices. While at it, adjust formatting of some constants and reorder all cases alphabetically for consistency. Rename OXP_OLD constants to OXP_MINI for disambiguation. Update code comments for clarity. Add support for AYANEO models 2S, AIR 1S, Flip series, GEEK 1S, and KUN. Signed-off-by: Derek J. Clark <[email protected]> Tested-by: Kevin Greenberg <[email protected]> Tested-by: Joshua Tam <[email protected]> Tested-by: Parth Menon <[email protected]> Tested-by: Philip Müller <[email protected]> Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2024-08-27hwmon: (stts751) Add "st" vendor prefix to "stts751" compatible stringRob Herring (Arm)1-1/+1
The documented compatible string is "st,stts751", not "stts751". Even if "stts751" was in use, there's no need to list "stts751" in the DT match table. The I2C core will strip any vendor prefix and match against the i2c_device_id table which has an "stts751" entry. Signed-off-by: Rob Herring (Arm) <[email protected]> Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2024-08-27hwmon: (ntc_thermistor) fix module autoloadingYuntao Liu1-0/+1
Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based on the alias from of_device_id table. Fixes: 9e8269de100d ("hwmon: (ntc_thermistor) Add DT with IIO support to NTC thermistor driver") Signed-off-by: Yuntao Liu <[email protected]> Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2024-08-27hwmon: (sch5627) Remove unused declaration sch56xx_watchdog_unregister()Yue Haibing1-1/+0
Commit 2be5f0d75325 ("hwmon: (sch56xx) Use devres functions for watchdog") removed the implementation but leave declaration. Signed-off-by: Yue Haibing <[email protected]> Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2024-08-27hwmon: (gsc-hwmon) fix module autoloadingLiao Chen1-0/+1
Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based on the alias from of_device_id table. Signed-off-by: Liao Chen <[email protected]> Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2024-08-27hwmon: Add thermal sensor driver for Surface Aggregator ModuleMaximilian Luz3-0/+247
Some of the newer Microsoft Surface devices (such as the Surface Book 3 and Pro 9) have thermal sensors connected via the Surface Aggregator Module (the embedded controller on those devices). Add a basic driver to read out the temperature values of those sensors. The EC can have up to 16 thermal sensors connected via a single sub-device, each providing temperature readings and a label string. Link: https://github.com/linux-surface/surface-aggregator-module/issues/59 Reviewed-by: Hans de Goede <[email protected]> Co-developed-by: Ivor Wanders <[email protected]> Signed-off-by: Ivor Wanders <[email protected]> Signed-off-by: Maximilian Luz <[email protected]> Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2024-08-27hwmon: (nct6775) add G15CF to ASUS WMI monitoring listDenis Pauk1-0/+1
Boards G15CF has got a nct6775 chip, but by default there's no use of it because of resource conflict with WMI method. Add the board to the WMI monitoring list. Link: https://bugzilla.kernel.org/show_bug.cgi?id=204807 Signed-off-by: Denis Pauk <[email protected]> Tested-by: Attila <[email protected]> Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2024-08-27hwmon: (chipcap2) Drop cc2_disable() in the probe and return dev_err_probe()Javier Carrasco1-22/+11
There is no need to actively disable a regulator that has not been enabled by the driver, which makes the call to cc2_disable() in the probe function meaningless, because the probe function never enables the device's dedicated regulator. Once the call to cc2_disable() is dropped, the error paths can directly return dev_err_probe() in all cases. Signed-off-by: Javier Carrasco <[email protected]> Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2024-08-27hwmon: (lm92) Update documentationGuenter Roeck1-1/+1
Update datasheet references. Replace misleading 'force parameter needed' with 'must be instantiated explicitly'. Explain the reason for the missing auto-detection. Mention all supported chips in Kconfig. Reviewed-by: Tzung-Bi Shih <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>