diff --git a/patches.suse/hwmon-amc6821-add-of_match-table.patch b/patches.suse/hwmon-amc6821-add-of_match-table.patch new file mode 100644 index 0000000..c1028bd --- /dev/null +++ b/patches.suse/hwmon-amc6821-add-of_match-table.patch @@ -0,0 +1,51 @@ +From 3f003fda98a7a8d5f399057d92e6ed56b468657c Mon Sep 17 00:00:00 2001 +From: Josua Mayer +Date: Thu, 7 Mar 2024 12:06:58 +0100 +Subject: [PATCH] hwmon: (amc6821) add of_match table +Git-commit: 3f003fda98a7a8d5f399057d92e6ed56b468657c +Patch-mainline: v6.9-rc1 +References: stable-fixes + +Add of_match table for "ti,amc6821" compatible string. +This fixes automatic driver loading by userspace when using device-tree, +and if built as a module like major linux distributions do. + +While devices probe just fine with i2c_device_id table, userspace can't +match the "ti,amc6821" compatible string from dt with the plain +"amc6821" device id. As a result, the kernel module can not be loaded. + +Cc: stable@vger.kernel.org +Signed-off-by: Josua Mayer +Link: https://lore.kernel.org/r/20240307-amc6821-of-match-v1-1-5f40464a3110@solid-run.com +[groeck: Cleaned up patch description] +Signed-off-by: Guenter Roeck +Acked-by: Takashi Iwai + +--- + drivers/hwmon/amc6821.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/hwmon/amc6821.c ++++ b/drivers/hwmon/amc6821.c +@@ -934,10 +934,21 @@ static const struct i2c_device_id amc682 + + MODULE_DEVICE_TABLE(i2c, amc6821_id); + ++static const struct of_device_id __maybe_unused amc6821_of_match[] = { ++ { ++ .compatible = "ti,amc6821", ++ .data = (void *)amc6821, ++ }, ++ { } ++}; ++ ++MODULE_DEVICE_TABLE(of, amc6821_of_match); ++ + static struct i2c_driver amc6821_driver = { + .class = I2C_CLASS_HWMON, + .driver = { + .name = "amc6821", ++ .of_match_table = of_match_ptr(amc6821_of_match), + }, + .probe_new = amc6821_probe, + .id_table = amc6821_id, diff --git a/series.conf b/series.conf index 059df2d..59e254b 100644 --- a/series.conf +++ b/series.conf @@ -45986,6 +45986,7 @@ patches.suse/mmc-tmio-avoid-concurrent-runs-of-mmc_request_done.patch patches.suse/mmc-wmt-sdmmc-remove-an-incorrect-release_mem_region.patch patches.suse/mmc-core-Fix-switch-on-gp3-partition.patch + patches.suse/hwmon-amc6821-add-of_match-table.patch patches.suse/PM-suspend-Set-mem_sleep_current-during-kernel-comma.patch patches.suse/cpufreq-amd-pstate-Fix-min_perf-assignment-in-amd_ps.patch patches.suse/cpufreq-brcmstb-avs-cpufreq-add-check-for-cpufreq_cp.patch