Skip to content

Commit 6570a9c

Browse files
committed
Prepare applesmc patches again for 6.10
1 parent 677fbaf commit 6570a9c

9 files changed

+64
-66
lines changed

3001-applesmc-convert-static-structures-to-drvdata.patch

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 09dd6c563cd73d72e917de07e8d59358c41e051d Mon Sep 17 00:00:00 2001
1+
From aa8cbca2aa7fa99119fe0e7de616d5b0dcde3a15 Mon Sep 17 00:00:00 2001
22
From: Paul Pawlowski <paul@mrarm.io>
33
Date: Sun, 17 Nov 2019 23:12:55 +0100
4-
Subject: [PATCH 1/6] applesmc: convert static structures to drvdata
4+
Subject: [PATCH 1/9] applesmc: convert static structures to drvdata
55

66
All static data structures have been moved to an applesmc_device struct,
77
which is then associated with the platform device.
@@ -14,7 +14,7 @@ Signed-off-by: Aun-Ali Zaidi <admin@kodeit.net>
1414
1 file changed, 319 insertions(+), 221 deletions(-)
1515

1616
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
17-
index 79b498f816fe..62211b590a61 100644
17+
index fc6d6a905..7fb40738d 100644
1818
--- a/drivers/hwmon/applesmc.c
1919
+++ b/drivers/hwmon/applesmc.c
2020
@@ -6,6 +6,7 @@
@@ -1040,7 +1040,7 @@ index 79b498f816fe..62211b590a61 100644
10401040
}
10411041

10421042
static int applesmc_dmi_match(const struct dmi_system_id *id)
1043-
@@ -1302,86 +1393,100 @@ static const struct dmi_system_id applesmc_whitelist[] __initconst = {
1043+
@@ -1306,86 +1397,100 @@ static const struct dmi_system_id applesmc_whitelist[] __initconst = {
10441044
{ .ident = NULL }
10451045
};
10461046

@@ -1190,7 +1190,7 @@ index 79b498f816fe..62211b590a61 100644
11901190
out_driver:
11911191
platform_driver_unregister(&applesmc_driver);
11921192
out_region:
1193-
@@ -1393,14 +1498,6 @@ static int __init applesmc_init(void)
1193+
@@ -1397,14 +1502,6 @@ static int __init applesmc_init(void)
11941194

11951195
static void __exit applesmc_exit(void)
11961196
{
@@ -1205,7 +1205,7 @@ index 79b498f816fe..62211b590a61 100644
12051205
platform_device_unregister(pdev);
12061206
platform_driver_unregister(&applesmc_driver);
12071207
release_region(APPLESMC_DATA_PORT, APPLESMC_NR_PORTS);
1208-
@@ -1410,6 +1507,7 @@ module_init(applesmc_init);
1208+
@@ -1414,6 +1511,7 @@ module_init(applesmc_init);
12091209
module_exit(applesmc_exit);
12101210

12111211
MODULE_AUTHOR("Nicolas Boichat");
@@ -1214,5 +1214,5 @@ index 79b498f816fe..62211b590a61 100644
12141214
MODULE_LICENSE("GPL v2");
12151215
MODULE_DEVICE_TABLE(dmi, applesmc_whitelist);
12161216
--
1217-
2.30.0
1217+
2.45.2
12181218

3002-applesmc-make-io-port-base-addr-dynamic.patch

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 713e78b8dbb8adb92d4ee09ea11e726b05577689 Mon Sep 17 00:00:00 2001
1+
From d0b5f668d43281eda94dd64d48e39973139d107c Mon Sep 17 00:00:00 2001
22
From: Paul Pawlowski <paul@mrarm.io>
33
Date: Sun, 17 Nov 2019 23:11:56 +0100
4-
Subject: [PATCH 2/6] applesmc: make io port base addr dynamic
4+
Subject: [PATCH 2/9] applesmc: make io port base addr dynamic
55

66
This change makes the port base runtime configurable.
77
The reason why this change is made is so that when we switch to an
@@ -16,7 +16,7 @@ Signed-off-by: Aun-Ali Zaidi <admin@kodeit.net>
1616
1 file changed, 49 insertions(+), 42 deletions(-)
1717

1818
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
19-
index 62211b590a61..39ed0bb21365 100644
19+
index 7fb40738d..a599db68b 100644
2020
--- a/drivers/hwmon/applesmc.c
2121
+++ b/drivers/hwmon/applesmc.c
2222
@@ -35,10 +35,11 @@
@@ -280,7 +280,7 @@ index 62211b590a61..39ed0bb21365 100644
280280
if (ret)
281281
return ret;
282282

283-
@@ -1468,7 +1475,7 @@ static int __init applesmc_init(void)
283+
@@ -1472,7 +1479,7 @@ static int __init applesmc_init(void)
284284
goto out;
285285
}
286286

@@ -289,7 +289,7 @@ index 62211b590a61..39ed0bb21365 100644
289289
"applesmc")) {
290290
ret = -ENXIO;
291291
goto out;
292-
@@ -1490,7 +1497,7 @@ static int __init applesmc_init(void)
292+
@@ -1494,7 +1501,7 @@ static int __init applesmc_init(void)
293293
out_driver:
294294
platform_driver_unregister(&applesmc_driver);
295295
out_region:
@@ -298,7 +298,7 @@ index 62211b590a61..39ed0bb21365 100644
298298
out:
299299
pr_warn("driver init failed (ret=%d)!\n", ret);
300300
return ret;
301-
@@ -1500,7 +1507,7 @@ static void __exit applesmc_exit(void)
301+
@@ -1504,7 +1511,7 @@ static void __exit applesmc_exit(void)
302302
{
303303
platform_device_unregister(pdev);
304304
platform_driver_unregister(&applesmc_driver);
@@ -308,5 +308,5 @@ index 62211b590a61..39ed0bb21365 100644
308308

309309
module_init(applesmc_init);
310310
--
311-
2.30.0
311+
2.45.2
312312

3003-applesmc-switch-to-acpi_device-from-platform.patch

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From ee3d4bf4a01bc94553bde2ae3e806a63a13faa12 Mon Sep 17 00:00:00 2001
1+
From c405f826e30e0035581b350084d61457ddde6146 Mon Sep 17 00:00:00 2001
22
From: Paul Pawlowski <paul@mrarm.io>
3-
Date: Sun, 17 Nov 2019 23:12:08 +0100
4-
Subject: [PATCH 3/6] applesmc: switch to acpi_device (from platform)
3+
Date: Sat, 29 Jun 2024 04:49:16 +0000
4+
Subject: [PATCH 3/9] applesmc: switch to acpi_device (from platform)
55

66
This change makes the change from platform_device
77
to acpi_device. The rationale for this change is
@@ -17,11 +17,11 @@ should not result in any incompatibilities.
1717

1818
Signed-off-by: Aun-Ali Zaidi <admin@kodeit.net>
1919
---
20-
drivers/hwmon/applesmc.c | 125 ++++++++++++++++++++++++++-------------
21-
1 file changed, 85 insertions(+), 40 deletions(-)
20+
drivers/hwmon/applesmc.c | 124 ++++++++++++++++++++++++++-------------
21+
1 file changed, 84 insertions(+), 40 deletions(-)
2222

2323
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
24-
index 39ed0bb21365..bdaaf696f7b6 100644
24+
index a599db68b..b4fe412c0 100644
2525
--- a/drivers/hwmon/applesmc.c
2626
+++ b/drivers/hwmon/applesmc.c
2727
@@ -19,7 +19,7 @@
@@ -167,7 +167,7 @@ index 39ed0bb21365..bdaaf696f7b6 100644
167167
/* Synchronize device with memorized backlight state */
168168
static int applesmc_pm_resume(struct device *dev)
169169
{
170-
@@ -763,18 +820,28 @@ static int applesmc_pm_restore(struct device *dev)
170+
@@ -763,17 +820,26 @@ static int applesmc_pm_restore(struct device *dev)
171171
return applesmc_pm_resume(dev);
172172
}
173173

@@ -194,23 +194,21 @@ index 39ed0bb21365..bdaaf696f7b6 100644
194194
+ .ops = {
195195
+ .add = applesmc_add,
196196
+ .remove = applesmc_remove
197-
},
197+
+ },
198198
+ .drv = {
199199
+ .pm = &applesmc_pm_ops
200-
+ },
201-
+ .owner = THIS_MODULE
200+
},
202201
};
203202

204-
/*
205-
@@ -1262,7 +1329,6 @@ static int applesmc_create_nodes(struct applesmc_device *smc,
203+
@@ -1262,7 +1328,6 @@ static int applesmc_create_nodes(struct applesmc_device *smc,
206204
static int applesmc_create_accelerometer(struct applesmc_device *smc)
207205
{
208206
int ret;
209207
-
210208
if (!smc->reg.has_accelerometer)
211209
return 0;
212210

213-
@@ -1463,8 +1529,6 @@ static void applesmc_destroy_modules(struct applesmc_device *smc)
211+
@@ -1467,8 +1532,6 @@ static void applesmc_destroy_modules(struct applesmc_device *smc)
214212
applesmc_destroy_nodes(smc, info_group);
215213
}
216214

@@ -219,7 +217,7 @@ index 39ed0bb21365..bdaaf696f7b6 100644
219217
static int __init applesmc_init(void)
220218
{
221219
int ret;
222-
@@ -1475,29 +1539,12 @@ static int __init applesmc_init(void)
220+
@@ -1479,29 +1542,12 @@ static int __init applesmc_init(void)
223221
goto out;
224222
}
225223

@@ -251,7 +249,7 @@ index 39ed0bb21365..bdaaf696f7b6 100644
251249
out:
252250
pr_warn("driver init failed (ret=%d)!\n", ret);
253251
return ret;
254-
@@ -1505,9 +1552,7 @@ static int __init applesmc_init(void)
252+
@@ -1509,9 +1555,7 @@ static int __init applesmc_init(void)
255253

256254
static void __exit applesmc_exit(void)
257255
{
@@ -263,5 +261,5 @@ index 39ed0bb21365..bdaaf696f7b6 100644
263261

264262
module_init(applesmc_init);
265263
--
266-
2.30.0
264+
2.45.2
267265

3004-applesmc-key-interface-wrappers.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 43df89a1377782788760808d8ea4bcf0730effbb Mon Sep 17 00:00:00 2001
1+
From 1ce5dd27e4464383ddfba3ee0d7ffdc7020bd81c Mon Sep 17 00:00:00 2001
22
From: Paul Pawlowski <paul@mrarm.io>
33
Date: Sun, 17 Nov 2019 23:12:14 +0100
4-
Subject: [PATCH 4/6] applesmc: key interface wrappers
4+
Subject: [PATCH 4/9] applesmc: key interface wrappers
55

66
This change replaces the read_smc and write_smc
77
methods with wrappers, additionally removing the
@@ -20,7 +20,7 @@ Signed-off-by: Aun-Ali Zaidi <admin@kodeit.net>
2020
1 file changed, 79 insertions(+), 40 deletions(-)
2121

2222
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
23-
index bdaaf696f7b6..3017d8ca2c79 100644
23+
index b4fe412c0..5442897e3 100644
2424
--- a/drivers/hwmon/applesmc.c
2525
+++ b/drivers/hwmon/applesmc.c
2626
@@ -172,7 +172,7 @@ static const int debug;
@@ -294,5 +294,5 @@ index bdaaf696f7b6..3017d8ca2c79 100644
294294

295295
out:
296296
--
297-
2.30.0
297+
2.45.2
298298

3005-applesmc-basic-mmio-interface-implementation.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 799e7a54c62a36007f7874c58d7dac87c9651759 Mon Sep 17 00:00:00 2001
1+
From 665609158a43eb6ab3d79e6ee06b9c1edf1cd331 Mon Sep 17 00:00:00 2001
22
From: Aun-Ali Zaidi <admin@kodeit.net>
33
Date: Sun, 17 Nov 2019 23:12:16 +0100
4-
Subject: [PATCH 5/6] applesmc: basic mmio interface implementation
4+
Subject: [PATCH 5/9] applesmc: basic mmio interface implementation
55

66
This change introduces a basic MMIO-based
77
interface implementation required to communicate
@@ -21,7 +21,7 @@ Signed-off-by: Aun-Ali Zaidi <admin@kodeit.net>
2121
1 file changed, 231 insertions(+), 6 deletions(-)
2222

2323
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
24-
index 3017d8ca2c79..2d23bb9ad9dd 100644
24+
index 5442897e3..435541f9f 100644
2525
--- a/drivers/hwmon/applesmc.c
2626
+++ b/drivers/hwmon/applesmc.c
2727
@@ -42,6 +42,18 @@
@@ -339,5 +339,5 @@ index 3017d8ca2c79..2d23bb9ad9dd 100644
339339
}
340340

341341
--
342-
2.30.0
342+
2.45.2
343343

3006-applesmc-fan-support-on-T2-Macs.patch

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 4e63e9b77422aae8e7411ddc7a8458c2585c86df Mon Sep 17 00:00:00 2001
1+
From e77e6a12cd389d1d61b861a1c88a6f393daa6d91 Mon Sep 17 00:00:00 2001
22
From: Paul Pawlowski <paul@mrarm.io>
33
Date: Sun, 17 Nov 2019 23:12:18 +0100
4-
Subject: [PATCH 6/6] applesmc: fan support on T2 Macs
4+
Subject: [PATCH 6/9] applesmc: fan support on T2 Macs
55

66
T2 Macs changed the fan values from shorts to
77
floats, and changed the fan manual override
@@ -19,7 +19,7 @@ Signed-off-by: Aun-Ali Zaidi <admin@kodeit.net>
1919
1 file changed, 102 insertions(+), 17 deletions(-)
2020

2121
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
22-
index 2d23bb9ad9dd..0938227be612 100644
22+
index 435541f9f..46b64eba7 100644
2323
--- a/drivers/hwmon/applesmc.c
2424
+++ b/drivers/hwmon/applesmc.c
2525
@@ -87,6 +87,7 @@
@@ -81,15 +81,15 @@ index 2d23bb9ad9dd..0938227be612 100644
8181
/*
8282
* applesmc_device_init - initialize the accelerometer. Can sleep.
8383
*/
84-
@@ -1242,6 +1280,7 @@ static ssize_t applesmc_show_fan_speed(struct device *dev,
84+
@@ -1241,6 +1279,7 @@ static ssize_t applesmc_show_fan_speed(struct device *dev,
8585
struct device_attribute *attr, char *sysfsbuf)
8686
{
8787
struct applesmc_device *smc = dev_get_drvdata(dev);
8888
+ const struct applesmc_entry *entry;
8989
int ret;
9090
unsigned int speed = 0;
9191
char newkey[5];
92-
@@ -1250,11 +1289,21 @@ static ssize_t applesmc_show_fan_speed(struct device *dev,
92+
@@ -1249,11 +1288,21 @@ static ssize_t applesmc_show_fan_speed(struct device *dev,
9393
scnprintf(newkey, sizeof(newkey), fan_speed_fmt[to_option(attr)],
9494
to_index(attr));
9595

@@ -113,15 +113,15 @@ index 2d23bb9ad9dd..0938227be612 100644
113113
return sysfs_emit(sysfsbuf, "%u\n", speed);
114114
}
115115

116-
@@ -1263,6 +1312,7 @@ static ssize_t applesmc_store_fan_speed(struct device *dev,
116+
@@ -1262,6 +1311,7 @@ static ssize_t applesmc_store_fan_speed(struct device *dev,
117117
const char *sysfsbuf, size_t count)
118118
{
119119
struct applesmc_device *smc = dev_get_drvdata(dev);
120120
+ const struct applesmc_entry *entry;
121121
int ret;
122122
unsigned long speed;
123123
char newkey[5];
124-
@@ -1274,9 +1324,18 @@ static ssize_t applesmc_store_fan_speed(struct device *dev,
124+
@@ -1273,9 +1323,18 @@ static ssize_t applesmc_store_fan_speed(struct device *dev,
125125
scnprintf(newkey, sizeof(newkey), fan_speed_fmt[to_option(attr)],
126126
to_index(attr));
127127

@@ -143,7 +143,7 @@ index 2d23bb9ad9dd..0938227be612 100644
143143

144144
if (ret)
145145
return ret;
146-
@@ -1291,12 +1350,26 @@ static ssize_t applesmc_show_fan_manual(struct device *dev,
146+
@@ -1290,12 +1349,26 @@ static ssize_t applesmc_show_fan_manual(struct device *dev,
147147
int ret;
148148
u16 manual = 0;
149149
u8 buffer[2];
@@ -172,7 +172,7 @@ index 2d23bb9ad9dd..0938227be612 100644
172172
return sysfs_emit(sysfsbuf, "%d\n", manual);
173173
}
174174

175-
@@ -1307,27 +1380,39 @@ static ssize_t applesmc_store_fan_manual(struct device *dev,
175+
@@ -1306,27 +1379,39 @@ static ssize_t applesmc_store_fan_manual(struct device *dev,
176176
struct applesmc_device *smc = dev_get_drvdata(dev);
177177
int ret;
178178
u8 buffer[2];
@@ -223,5 +223,5 @@ index 2d23bb9ad9dd..0938227be612 100644
223223
out:
224224
if (ret)
225225
--
226-
2.30.0
226+
2.45.2
227227

3007-applesmc-Add-iMacPro-to-applesmc_whitelist.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 58868e6f356229eab48cfdee1603011653a19c79 Mon Sep 17 00:00:00 2001
1+
From 5c95c8e1ada14babfba0f21a2f481d7ff53d17c7 Mon Sep 17 00:00:00 2001
22
From: Orlando Chamberlain <redecorating@protonmail.com>
33
Date: Sun, 9 Oct 2022 15:59:01 +0530
4-
Subject: [PATCH] applesmc: Add iMacPro to applesmc_whitelist
4+
Subject: [PATCH 7/9] applesmc: Add iMacPro to applesmc_whitelist
55

66
The iMacPro1,1 is the only iMacPro released before the line was
77
discontinued. Add it to the applesmc_whitelist.
@@ -12,10 +12,10 @@ Signed-off-by: Orlando Chamberlain <redecorating@protonmail.com>
1212
1 file changed, 4 insertions(+)
1313

1414
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
15-
index 8b3f73fcb..493f95bb0 100644
15+
index 46b64eba7..8c7b2e2cd 100644
1616
--- a/drivers/hwmon/applesmc.c
1717
+++ b/drivers/hwmon/applesmc.c
18-
@@ -1804,6 +1804,10 @@ static const struct dmi_system_id applesmc_whitelist[] __initconst = {
18+
@@ -1803,6 +1803,10 @@ static const struct dmi_system_id applesmc_whitelist[] __initconst = {
1919
DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
2020
DMI_MATCH(DMI_PRODUCT_NAME, "Macmini") },
2121
},
@@ -27,5 +27,5 @@ index 8b3f73fcb..493f95bb0 100644
2727
DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
2828
DMI_MATCH(DMI_PRODUCT_NAME, "MacPro") },
2929
--
30-
2.34.1
30+
2.45.2
3131

3008-applesmc-make-applesmc_remove-void.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
From e52b0fad357b6203691942831715fce4f26d66e2 Mon Sep 17 00:00:00 2001
1+
From 4d444d98c6f5f7f39540386b97aa8d77102ada74 Mon Sep 17 00:00:00 2001
22
From: Orlando Chamberlain <orlandoch.dev@gmail.com>
33
Date: Tue, 24 Jan 2023 15:46:48 +1100
4-
Subject: [PATCH 1/1] applesmc: make applesmc_remove void
4+
Subject: [PATCH 8/9] applesmc: make applesmc_remove void
55

66
for linux6.2 compatibility
77
---
88
drivers/hwmon/applesmc.c | 4 ++--
99
1 file changed, 2 insertions(+), 2 deletions(-)
1010

1111
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
12-
index d071130ff68d..12be9269a314 100644
12+
index 8c7b2e2cd..5f67d7362 100644
1313
--- a/drivers/hwmon/applesmc.c
1414
+++ b/drivers/hwmon/applesmc.c
1515
@@ -979,7 +979,7 @@ static int applesmc_add(struct acpi_device *dev)
@@ -31,5 +31,5 @@ index d071130ff68d..12be9269a314 100644
3131

3232
static acpi_status applesmc_walk_resources(struct acpi_resource *res,
3333
--
34-
2.39.1
34+
2.45.2
3535

0 commit comments

Comments
 (0)